> ## 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.

# All Categories

> API to fetch user preferences across all categories.



## OpenAPI

````yaml GET /v1/user/{distinct_id}/preference/category/
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/:
    get:
      summary: All Categories
      description: API to fetch user preferences across all categories.
      operationId: get-user-preference-all-categories
      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: 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: tags
          in: query
          description: >
            Filter preference categories with tags assigned to them. Used to
            filter preference categories relevant to the user on UI based on
            their roles, department or teams.

            You can apply single tag filter like `tags=tag1` or build nested
            conditions using logical operators - `and`, `or`, `not`, `exists`.


            Example:

            ```

            tags=admin

            tags={"or":[{"and":["admin","sales"]},{"and":["admin","manager"]}]}

            tags={"not":"admin"}

            tags={"exists":true}
          schema:
            type: string
        - 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:
                    meta:
                      count: 12
                      limit: 10
                      offset: 0
                    results:
                      - 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:
                  meta:
                    type: object
                    properties:
                      count:
                        type: integer
                        example: 12
                      limit:
                        type: integer
                        example: 10
                      offset:
                        type: integer
                        example: 0
                  results:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          description: Display name of the notification category.
                          type: string
                          example: Newsletter
                        category:
                          description: Slug of the notification category.
                          type: string
                          example: newsletter
                        description:
                          description: Description of the notification category.
                          type: string
                          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
                          enum:
                            - opt_in
                            - opt_out
                          example: opt_in
                          description: updated user preference of the category
                        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
                        digest_schedule_options:
                          type: object
                          nullable: true
                          description: >-
                            All digest schedule options configured on the
                            category, with the recipient's current selection.
                            `null` if digest schedule is not enabled on the
                            category.
                          properties:
                            options:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    description: >-
                                      Unique identifier of the digest schedule
                                      option.
                                    type: string
                                  label:
                                    type: string
                                    description: >-
                                      Display label shown to the recipient for
                                      this option.
                                  frequency:
                                    type: string
                                    description: Frequency of the digest schedule.
                                    enum:
                                      - instantly
                                      - minutely
                                      - hourly
                                      - daily
                                      - weekly
                                      - weekly_mo2fr
                                      - monthly
                                  interval:
                                    description: >-
                                      Recurrence multiplier for the frequency
                                      (for example, every 2 weeks).
                                    type: integer
                                  time:
                                    type: object
                                    description: >-
                                      Time of day to send the digest, with its
                                      edit policy and the recipient's override.
                                    properties:
                                      edit_policy:
                                        type: string
                                        enum:
                                          - locked
                                          - editable
                                        description: >-
                                          `editable` means the recipient can
                                          change this value; `locked` means it is
                                          fixed.
                                      default_value:
                                        type: string
                                        description: Default time in HH:MM (24-hour) format.
                                      value:
                                        type: string
                                        nullable: true
                                        description: Recipient's overridden value, if any.
                                  weekdays:
                                    type: object
                                    description: >-
                                      Days of the week to send on (for `weekly`
                                      frequency), with edit policy and recipient
                                      override.
                                    properties:
                                      edit_policy:
                                        description: >-
                                          `editable` means the value can be
                                          overridden; `locked` means it is fixed.
                                        type: string
                                        enum:
                                          - locked
                                          - editable
                                      default_value:
                                        description: >-
                                          Default value applied when not
                                          overridden.
                                        type: array
                                        items:
                                          type: string
                                      value:
                                        type: array
                                        nullable: true
                                        items:
                                          type: string
                                  monthdays:
                                    type: object
                                    description: >-
                                      Days of the month to send on (for
                                      `monthly` frequency), with edit policy and
                                      recipient override.
                                    properties:
                                      edit_policy:
                                        description: >-
                                          `editable` means the value can be
                                          overridden; `locked` means it is fixed.
                                        type: string
                                        enum:
                                          - locked
                                          - editable
                                      default_value:
                                        description: >-
                                          Default value applied when not
                                          overridden.
                                        type: array
                                        items:
                                          type: object
                                          properties:
                                            pos:
                                              description: >-
                                                Position in the month (1-31; use a
                                                negative value to count from the end).
                                              type: integer
                                            day:
                                              description: >-
                                                Optional day of the week (su, mo, tu,
                                                we, th, fr, sa).
                                              type: string
                                      value:
                                        type: array
                                        nullable: true
                                        items:
                                          type: object
                                  dtstart:
                                    type: object
                                    description: >-
                                      Start datetime from which the recurring
                                      schedule is calculated, with edit policy
                                      and recipient override.
                                    properties:
                                      edit_policy:
                                        description: >-
                                          `editable` means the value can be
                                          overridden; `locked` means it is fixed.
                                        type: string
                                        enum:
                                          - locked
                                          - editable
                                      default_value:
                                        description: >-
                                          Default value applied when not
                                          overridden.
                                        type: string
                                        format: date-time
                                      value:
                                        type: string
                                        nullable: true
                                  is_default:
                                    type: boolean
                                    description: >-
                                      Whether this option is the category
                                      default.
                                  is_user_selected:
                                    type: boolean
                                    description: >-
                                      Whether the recipient has selected this
                                      option.
                        digest_schedule:
                          type: object
                          nullable: true
                          description: >-
                            The recipient's currently active digest schedule,
                            resolved in order recipient selection -> tenant
                            default -> category default. `null` if digest
                            schedule is not enabled on the category.
                          properties:
                            id:
                              description: Unique identifier of the digest schedule option.
                              type: string
                            label:
                              description: Display label shown to the recipient.
                              type: string
                            frequency:
                              description: >-
                                Frequency of the digest schedule (instantly,
                                hourly, daily, weekly, weekly_mo2fr, monthly).
                              type: string
                              enum:
                                - instantly
                                - minutely
                                - hourly
                                - daily
                                - weekly
                                - weekly_mo2fr
                                - monthly
                            interval:
                              description: >-
                                Recurrence multiplier for the frequency (for
                                example, every 2 weeks).
                              type: integer
                            time:
                              type: string
                              description: Resolved time in HH:MM (24-hour) format.
                            weekdays:
                              description: >-
                                Days of the week to send on (for weekly
                                frequency), with edit policy and value.
                              type: array
                              items:
                                type: string
                            monthdays:
                              description: >-
                                Days of the month to send on (for monthly
                                frequency), with edit policy and value.
                              type: array
                              items:
                                type: object
                                properties:
                                  pos:
                                    description: >-
                                      Position in the month (1-31; use a
                                      negative value to count from the end).
                                    type: integer
                                  day:
                                    description: >-
                                      Optional day of the week (su, mo, tu, we,
                                      th, fr, sa).
                                    type: string
                            is_default:
                              description: Whether this option is the default selection.
                              type: boolean
                            is_user_selected:
                              type: boolean
                        properties:
                          type: array
                          nullable: true
                          description: >-
                            Category condition properties with the recipient's
                            overrides. Referenced in workflows as
                            `$category.properties.<key>`.
                          items:
                            type: object
                            properties:
                              key:
                                description: >-
                                  Property key identifier, referenced in
                                  workflows as `$category.properties.<key>`.
                                type: string
                              label:
                                type: string
                                description: Display label for the property.
                              value_type:
                                description: Data type of the property value.
                                type: string
                                enum:
                                  - integer
                                  - string
                                  - string_choice
                                  - list_choice
                                  - string_dynamic
                                  - list_dynamic
                              default_value:
                                nullable: true
                                description: >-
                                  Default value applied when the recipient has
                                  not set a value.
                              is_optional:
                                description: Whether this property is optional.
                                type: boolean
                              edit_policy:
                                type: string
                                enum:
                                  - locked
                                  - editable
                                description: >-
                                  `editable` means the recipient can override
                                  the value; `locked` means it is fixed.
                              is_overridden:
                                type: boolean
                                description: >-
                                  Whether the recipient has overridden the
                                  default value.
                              value:
                                nullable: true
                                description: Recipient-overridden value, if any.
        '404':
          description: 404 - Not Found
          content:
            application/json:
              examples:
                Result:
                  value:
                    code: 404
                    message: 'user [distinct_id: ''user1''] not found'
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 404
                  message:
                    type: string
                    example: 'user [distinct_id: ''user1''] not found'
      deprecated: false
      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.

````