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

# Commit Preference Category

> Commit draft changes to the preference category to make them live



## OpenAPI

````yaml PATCH /v1/{workspace}/preference_category/commit/
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/{workspace}/preference_category/commit/:
    patch:
      summary: Commit Preference Category
      description: Commit draft changes to the preference category to make them live
      operationId: commit-category
      parameters:
        - in: path
          name: workspace
          required: true
          schema:
            type: string
          description: Workspace slug (staging, production, etc.)
        - in: query
          name: commit_message
          required: true
          schema:
            type: string
          description: Commit message describing the changes being made live.
      responses:
        '200':
          description: Successfully committed preference category
          content:
            application/json:
              schema:
                type: object
                properties:
                  $schema:
                    type: string
                    description: JSON schema reference for preference category structure
                    example: >-
                      https://schema.suprsend.com/preference_category/v1/schema.json
                  root_categories:
                    type: array
                    description: Array of root preference categories
                    items:
                      type: object
                      properties:
                        root_category:
                          type: string
                          description: >-
                            The root category classification for the preference
                            category
                          example: system
                        sections:
                          type: array
                          description: Array of sections within the preference category
                          items:
                            type: object
                            properties:
                              name:
                                type: string
                                description: Name of the section
                                example: Account Updates
                              categories:
                                type: array
                                description: Array of categories within this section
                                items:
                                  type: object
                                  properties:
                                    category:
                                      type: string
                                      description: Unique identifier for the category
                                      example: password-reset
                                    name:
                                      type: string
                                      description: Display name for the category
                                      example: Password Reset
                                    default_preference:
                                      type: string
                                      description: >-
                                        Default preference setting for this
                                        category
                                      example: opt_in
                  status:
                    type: string
                    description: Current status of the preference category
                    enum:
                      - draft
                      - active
                    example: active
                  version_no:
                    type: integer
                    description: Version number of the preference category
                    example: 2
                  commit_message:
                    type: string
                    description: Commit message describing the changes that were made live
                    example: Added password-reset category
                  committed_at:
                    type: string
                    format: date-time
                    description: Timestamp when the changes were committed
                    example: '2025-10-03T09:52:55.273317+00:00'
              example:
                $schema: https://schema.suprsend.com/preference_category/v1/schema.json
                root_categories:
                  - root_category: system
                    sections:
                      - name: Alerts
                        description: null
                        tags: null
                        categories:
                          - category: critical-updates
                            name: Critical Updates
                            description: >-
                              Important system alerts requiring immediate
                              attention
                            default_preference: opt_in
                            default_mandatory_channels: null
                            default_opt_in_channels: null
                            tags: null
                  - root_category: transactional
                    sections:
                      - name: Task Updates
                        description: null
                        tags: null
                        categories:
                          - category: tagged-to-me
                            name: Tagged to Me
                            description: >-
                              Status updates or mentions on tasks assigned by me
                              or tagged to me
                            default_preference: opt_in
                            default_mandatory_channels: null
                            default_opt_in_channels: null
                            tags: null
                  - root_category: promotional
                    sections:
                      - name: Product Updates
                        description: null
                        tags: null
                        categories:
                          - category: newsletter
                            name: Newsletter
                            description: null
                            default_preference: opt_out
                            default_mandatory_channels: null
                            default_opt_in_channels: null
                            tags: null
                version_no: 2
                status: active
                commit_message: Added password-reset category
                committed_at: '2025-10-03T09:52:55.273317+00:00'
        '401':
          description: ServiceToken not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 401
                  message:
                    type: string
                    example: ServiceToken not found
              example:
                code: 401
                message: ServiceToken not found
        '404':
          description: Workspace not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 404
                  message:
                    type: string
                    example: 'workspace not found for slug/uid: workspace'
              example:
                code: 404
                message: 'workspace not found for slug/uid: workspace'
      security:
        - ServiceTokenAuth: []
      servers:
        - url: https://management-api.suprsend.com
      x-codeSamples:
        - lang: cURL
          label: Commit Category
          source: >
            curl -X PATCH
            "https://management-api.suprsend.com/v1/{workspace}/preference_category/commit/?commit_message=Added%20password-reset%20category"
            \
              --header "Authorization: ServiceToken {token}" \
              --header "Content-Type: application/json"
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.
    ServiceTokenAuth:
      type: apiKey
      in: header
      name: ServiceToken <token>
      description: >-
        You can get Service Token from [SuprSend dashboard -> Account Settings
        -> Service
        Tokens](https://app.suprsend.com/en/account-settings/service-tokens)
        section.

````