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

# Add or Update Category Translation

> Add or update translation content for a given locale for preference categories and sections.



## OpenAPI

````yaml POST /v1/{workspace}/preference_category/translation/content/{locale}/
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/translation/content/{locale}/:
    post:
      summary: Add or Update Category Translation
      description: >-
        Add or update translation content for a given locale for preference
        categories and sections.
      operationId: add-category-translation
      parameters:
        - in: path
          name: workspace
          required: true
          schema:
            type: string
          description: Workspace slug (staging, production, etc.)
          example: my-workspace
        - in: path
          name: locale
          required: true
          schema:
            type: string
          description: Locale code (e.g., es, fr, de, ja)
          example: es
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sections:
                  type: object
                  description: Translations for sections, keyed by section slug
                  additionalProperties:
                    type: object
                    properties:
                      name:
                        type: string
                        nullable: true
                        description: Translated section name
                        example: Section Nik pour transactionnel
                      description:
                        type: string
                        nullable: true
                        description: Translated section description
                        example: Description de la section Nik pour transactionnel
                categories:
                  type: object
                  description: Translations for categories, keyed by category slug
                  additionalProperties:
                    type: object
                    properties:
                      name:
                        type: string
                        nullable: true
                        description: Translated category name
                        example: Sous-catégorie Nik
                      description:
                        type: string
                        nullable: true
                        description: Translated category description
                        example: Sous-catégorie Nik 1
            example:
              sections:
                account-updates:
                  name: Actualizaciones de Cuenta
                  description: Notificaciones importantes relacionadas con la cuenta
              categories:
                password-reset:
                  name: Restablecimiento de Contraseña
                  description: Notificaciones cuando se restablece la contraseña
      responses:
        '200':
          description: Successfully added or updated translation
          content:
            application/json:
              schema:
                type: object
                properties:
                  sections:
                    type: object
                    description: Translations for sections, keyed by section slug
                    additionalProperties:
                      type: object
                      properties:
                        name:
                          type: string
                          nullable: true
                          description: Translated section name
                        description:
                          type: string
                          nullable: true
                          description: Translated section description
                  categories:
                    type: object
                    description: Translations for categories, keyed by category slug
                    additionalProperties:
                      type: object
                      properties:
                        name:
                          type: string
                          nullable: true
                          description: Translated category name
                        description:
                          type: string
                          nullable: true
                          description: Translated category description
              example:
                sections:
                  new-5:
                    name: null
                    description: null
                  nik-section-for-transactional:
                    name: null
                    description: null
                categories:
                  nik-sub-category:
                    name: null
                    description: null
                  amount-refunded:
                    name: null
                    description: null
        '400':
          description: Invalid or unsupported locale, or invalid translation data
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 400
                  message:
                    type: string
                    example: 'invalid/unsupported locale: ''apl'''
              example:
                code: 400
                message: 'invalid/unsupported locale: ''apl'''
        '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: Add Translation
          source: >
            curl -X POST
            "https://management-api.suprsend.com/v1/{workspace}/preference_category/translation/content/{locale}/"
            \
              --header "Authorization: ServiceToken {token}" \
              --header "Content-Type: application/json" \
              --data '{
                "sections": {
                  "account-updates": {
                    "name": "Actualizaciones de Cuenta",
                    "description": "Notificaciones importantes relacionadas con la cuenta"
                  }
                },
                "categories": {
                  "password-reset": {
                    "name": "Restablecimiento de Contraseña",
                    "description": "Notificaciones cuando se restablece la contraseña"
                  }
                }
              }'
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.

````