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

# Full Preference

> API to fetch object preferences across all channels and categories.



## OpenAPI

````yaml GET /v1/object/{object_type}/{id}/preference/
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/object/{object_type}/{id}/preference/:
    get:
      summary: Full Preference
      description: API to fetch object preferences across all channels and categories.
      operationId: fetch-object-full-preference
      parameters:
        - name: object_type
          in: path
          description: >-
            Used to group similar objects together. Give plural namespace like
            teams, organizations, and roles.
          schema:
            type: string
          required: true
        - name: tenant_id
          in: query
          description: to fetch object 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: true
        - name: id
          in: path
          description: Unique identifier of the object in your system
          schema:
            type: string
          required: true
        - 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:
                    sections:
                      - subcategories:
                          - name: Newsletter
                            category: newsletter
                            description: Send me updates on new product updates
                            preference: opt_in
                            is_editable: true
                            channels:
                              - channel: androidpush
                                preference: opt_in
                                is_editable: true
                              - channel: email
                                preference: opt_in
                                is_editable: true
                    channel_preferences:
                      - channel: email
                        is_restricted: false
              schema:
                type: object
                properties:
                  sections:
                    type: array
                    items:
                      type: object
                      properties:
                        subcategories:
                          type: array
                          items:
                            type: object
                            properties:
                              name:
                                type: string
                                example: Newsletter
                              category:
                                type: string
                                example: newsletter
                              description:
                                type: string
                                example: Send me updates on new product updates
                              preference:
                                type: string
                                enum:
                                  - opt_in
                                  - opt_out
                                example: opt_in
                              is_editable:
                                type: boolean
                                description: >-
                                  false when category default preference is set
                                  to can't unsubscribe
                              channels:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    channel:
                                      type: string
                                      example: email
                                    preference:
                                      type: string
                                      enum:
                                        - opt_in
                                        - opt_out
                                      example: opt_in
                                    is_editable:
                                      type: boolean
                                      description: >-
                                        false when category default preference
                                        is set to can't unsubscribe
                  channel_preferences:
                    type: array
                    items:
                      type: object
                      properties:
                        channel:
                          type: string
                          description: channel name
                          example: androidpush
                        is_restricted:
                          type: boolean
                          description: >-
                            True means notification will be sent in categories
                            where this channel is marked as mandatory channel.
                            False means opt_in on channel.
        '404':
          description: '404'
          content:
            application/json:
              examples:
                Result:
                  value:
                    code: 404
                    message: object 'object_type/id' not found
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 404
                  message:
                    type: string
                    example: object 'object_type/id' 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.

````

Built with [Mintlify](https://mintlify.com).