> ## Documentation Index
> Fetch the complete documentation index at: https://docs.suprsend.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Single Category

> API to fetch user preferences for a given category.



## OpenAPI

````yaml GET /v1/user/{distinct_id}/preference/category/{category_slug}
openapi: 3.1.1
info:
  title: SuprSend API
  description: APIs supported on suprsend platform
  version: 1.2.2
servers:
  - url: https://hub.suprsend.com
security:
  - sec0: []
  - BearerAuth: []
paths:
  /v1/user/{distinct_id}/preference/category/{category_slug}:
    get:
      summary: Single Category
      description: API to fetch user preferences for a given category.
      operationId: get-user-preferences-single-category
      parameters:
        - name: distinct_id
          in: path
          description: distinct_id of the user whose preferences should be fetched
          schema:
            type: string
          required: true
        - name: tenant_id
          in: query
          description: to fetch user preferences for a particular tenant
          schema:
            type: string
        - name: category_slug
          in: path
          description: >-
            notification category slug. You can get this from Notification
            Categories page on SuprSend dashboard -> Settings page
          schema:
            type: string
          required: true
        - name: show_opt_out_channels
          in: query
          description: >-
            set this flag to `true` if you want to fetch channel list for
            opt-out categories.
          schema:
            type: boolean
            default: false
        - name: locale
          in: query
          description: >
            Locale code (e.g., `es`, `fr`, `de`, `ja`, `es-AR`) to fetch
            preference translations in user's locale. When provided, the API
            looks for category and section names and descriptions in the
            respective locale file. 

            If a translation is missing for the requested locale, the system
            automatically falls back in this order: `locale-region` (e.g.,
            `es-AR`) → `locale` (e.g., `es`) → `en` (English - always
            available).
          schema:
            type: string
          example: es
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    name: Newsletter
                    category: newsletter
                    description: Send me updates on new product updates
                    original_preference: null
                    preference: opt_in
                    is_editable: false
                    channels:
                      - channel: email
                        preference: opt_in
                        is_editable: false
                      - channel: ms_teams
                        preference: opt_in
                        is_editable: false
              schema:
                type: object
                properties:
                  name:
                    type: string
                    description: name of the notification category
                    example: Newsletter
                  category:
                    type: string
                    description: category slug identifier
                    example: newsletter
                  description:
                    type: string
                    description: description of the notification category
                    example: Send me updates on new product updates
                  original_preference:
                    type: string
                    description: default preference of the category
                    nullable: true
                    example: null
                  preference:
                    type: string
                    description: updated user preference of the category
                    example: opt_in
                  is_editable:
                    type: boolean
                    description: >-
                      false when category default preference is set to `can't
                      unsubscribe`
                    example: false
                  channels:
                    type: array
                    description: channel level preference in the category
                    items:
                      type: object
                      properties:
                        channel:
                          type: string
                          description: channel name
                          example: email
                        preference:
                          type: string
                          description: user preference for this channel (opt_in, opt_out)
                          example: opt_in
                        is_editable:
                          type: boolean
                          description: whether the user can edit this channel preference
                          example: false
        '404':
          description: 404 - Not Found
          content:
            application/json:
              examples:
                Result:
                  value:
                    code: 404
                    message: category 'category_slug' not found
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 404
                  message:
                    type: string
                    example: category 'category_slug' not found
      deprecated: true
      security:
        - BearerAuth: []
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where <token>
        is your auth token.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API_Key
      description: >-
        Pass as `Bearer <API_KEY>`. Get API Key from SuprSend dashboard
        Developers -> API Keys section.

````