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

> Upload or create a new translation file. The file content should be valid JSON following the translation file structure.



## OpenAPI

````yaml POST /v1/{workspace}/translation/content/{locale_file}/
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}/translation/content/{locale_file}/:
    post:
      summary: Add Translation
      description: >-
        Upload or create a new translation file. The file content should be
        valid JSON following the translation file structure.
      operationId: add-translation
      parameters:
        - in: path
          name: workspace
          required: true
          schema:
            type: string
          description: Workspace slug (staging, production, etc.)
        - in: path
          name: locale_file
          required: true
          schema:
            type: string
          description: Locale file name (e.g., "fr.json", "es-MX.json", "auth.en.json")
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - locale
                - content
              properties:
                locale:
                  type: string
                  description: >-
                    Locale file name (e.g., "fr.json", "es-MX.json",
                    "auth.en.json")
                  example: fr.json
                content:
                  type: object
                  description: Translation key-value pairs in JSON format
                  additionalProperties: true
            example:
              locale: fr.json
              content:
                welcome: Bienvenue
                goodbye: Au revoir
                greeting: Bonjour, {{name}}!
      responses:
        '201':
          description: Translation file successfully updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  filename:
                    type: string
                    description: Name of the translation file
                    example: fr.json
                  locale:
                    type: string
                    description: Locale code for the translation file
                    example: fr
                  locale_name:
                    type: string
                    description: Human-readable name of the locale
                    example: French
                  namespace:
                    type: string
                    nullable: true
                    description: >-
                      Namespace for the translation file, if any. Namespace can
                      be used to group translations by feature or module.
                    example: null
                  action:
                    type: string
                    description: action done in the version compared to last commit.
                    enum:
                      - added
                      - updated
                      - deleted
                      - unchanged
                    example: updated
                  updated_at:
                    type: string
                    format: date-time
                    description: When the translation file was last updated
                  content:
                    type: object
                    description: Translation key-value pairs
                    additionalProperties:
                      type: string
              example:
                filename: fr.json
                locale: fr
                locale_name: French
                namespace: null
                action: updated
                updated_at: '2025-10-29T17:14:33.048313Z'
                content:
                  task_created: Tâche créée
                  task_completed: Tâche terminée
                  task_due: Tâche due
                  task_assigned: Tâche assignée
        '400':
          description: Invalid translation format
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 400
                  error_code:
                    type: string
                    example: validation_error
                  type:
                    type: string
                    example: ValidationError
                  message:
                    type: string
                    example: Invalid JSON format
        '401':
          $ref: '#/components/responses/AuthenticationError'
          description: AuthenticationFailed - Invalid service token.
        '404':
          $ref: '#/components/responses/NotFoundError'
          description: Workspace not found
      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}/translation/content/{locale_file}/"
            \
              --header 'Authorization: ServiceToken <token>' \
              --header 'Content-Type: application/json' \
              --data '{
                "content": {
                  "welcome": "Bienvenue",
                  "goodbye": "Au revoir"
                }
              }'
components:
  responses:
    AuthenticationError:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 401
            error_code: authentication_failed
            type: AuthenticationFailed
            message: Invalid service token.
            detail: Invalid service token.
    NotFoundError:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 404
            error_code: not_found
            type: NotFound
            message: workspace 'demo' not found
            detail: workspace 'demo' not found
  schemas:
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
          description: HTTP status code
        error_code:
          type: string
          description: Specific error code identifier
        type:
          type: string
          description: Error type classification
        message:
          type: string
          description: Human-readable error message
        detail:
          type: string
          description: Additional error details
  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.

````