> ## Documentation Index
> Fetch the complete documentation index at: https://hyperlocalise.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Save a string's translation in one locale

> Requires `strings:write`; saving as `approved` or `rejected` also requires `translations:approve` (admins, localization managers and reviewers). Native projects only. Creates or replaces the translation and records a revision attributed to the token owner. Locked segments return `409`, text longer than the string's `maxLength` returns `422`. Without `origin`, the saved text is labelled as a person's: `human`, or `machine_post_edited` when it changes machine text, and unchanged text keeps its origin. Send `origin: machine` when the text comes from your own machine translation.



## OpenAPI

````yaml https://public-api.hyperlocalise.com/openapi.yaml put /v1/projects/{projectId}/strings/{stringId}/translations/{locale}
openapi: 3.1.0
info:
  title: Hyperlocalise Public API
  version: 1.0.0
  description: >-
    Read projects, Queries, jobs, glossaries, and translation memories from a
    Hyperlocalise workspace; create native projects from project templates and
    manage those templates; define custom project fields and set their values;
    manage the strings, translations, screenshots, and settings of native
    projects; search strings; round-trip bilingual files; update jobs one at a
    time or in bulk; register job-change webhook endpoints; import and export
    glossaries and translation memories; and read the Reports page's reports as
    JSON or CSV.
servers:
  - url: https://public-api.hyperlocalise.com
security:
  - personalAccessToken: []
tags:
  - name: Identity
  - name: Projects
  - name: Project templates
  - name: Custom fields
  - name: Queries
  - name: Jobs
  - name: Strings
  - name: Translations
  - name: Screenshots
  - name: Figma attachments
  - name: Bilingual files
  - name: Glossaries
  - name: Translation memories
  - name: Webhooks
  - name: CDN
  - name: Hyperlab
  - name: Reports
    description: >-
      The Reports page's reports for scripts, BI tools and payment systems.
      Every report needs `reports:read`, which only admins' and localization
      managers' keys hold, and the workspace's Reports feature. Each answer says
      whether recent work is still being counted (`stillUpdating`); figures can
      lag live work by one capture run. A workspace may ask for 30 reports a
      minute, in bursts of 10.
paths:
  /v1/projects/{projectId}/strings/{stringId}/translations/{locale}:
    parameters:
      - $ref: '#/components/parameters/ProjectId'
      - $ref: '#/components/parameters/StringId'
      - name: locale
        in: path
        required: true
        description: A target locale of the project.
        schema:
          type: string
          maxLength: 64
    put:
      tags:
        - Translations
      summary: Save a string's translation in one locale
      description: >-
        Requires `strings:write`; saving as `approved` or `rejected` also
        requires `translations:approve` (admins, localization managers and
        reviewers). Native projects only. Creates or replaces the translation
        and records a revision attributed to the token owner. Locked segments
        return `409`, text longer than the string's `maxLength` returns `422`.
        Without `origin`, the saved text is labelled as a person's: `human`, or
        `machine_post_edited` when it changes machine text, and unchanged text
        keeps its origin. Send `origin: machine` when the text comes from your
        own machine translation.
      operationId: putTranslation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - text
              properties:
                text:
                  type: string
                  maxLength: 100000
                status:
                  type: string
                  enum:
                    - draft
                    - needs_review
                    - approved
                    - rejected
                  default: draft
                origin:
                  type: string
                  enum:
                    - machine
                    - machine_post_edited
                    - human
                    - unknown
                  description: >-
                    Who wrote `text`. Omit to apply the rule for a person's
                    edit.
      responses:
        '200':
          description: Saved translation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TranslationResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '422':
          description: The translation breaks a string rule such as its max length.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  parameters:
    ProjectId:
      name: projectId
      in: path
      required: true
      schema:
        type: string
        maxLength: 128
    StringId:
      name: stringId
      in: path
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    TranslationResponse:
      type: object
      required:
        - translation
      properties:
        translation:
          $ref: '#/components/schemas/Translation'
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
        message:
          type: string
        details:
          type: object
          description: >-
            Structured context, such as the `jobId` that stopped a bulk job
            update.
          additionalProperties: true
    Translation:
      type: object
      required:
        - id
        - stringId
        - key
        - locale
        - text
        - status
        - provenance
        - origin
        - reviewedByUserId
        - reviewedAt
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          format: uuid
        stringId:
          type: string
          format: uuid
        key:
          type: string
        locale:
          type: string
        text:
          type: string
        status:
          type: string
          enum:
            - draft
            - needs_review
            - approved
            - rejected
        provenance:
          type: string
          enum:
            - manual
            - translation_job
            - import
            - agent
          description: >-
            The last writer. Overwritten by every save; use `origin` for machine
            or human authorship.
        origin:
          type: string
          enum:
            - machine
            - machine_post_edited
            - human
            - unknown
          description: >-
            Whether a machine or a person wrote `text`. `machine`: a translation
            job or the agent, or kept unchanged by a person.
            `machine_post_edited`: machine text a person changed. `human`: a
            person's own text. `unknown`: imported with no record of who wrote
            it. Approving or rejecting doesn't change it.
        reviewedByUserId:
          type:
            - string
            - 'null'
          format: uuid
        reviewedAt:
          type:
            - string
            - 'null'
          format: date-time
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  responses:
    BadRequest:
      description: Invalid query parameters or request body.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: The personal access token is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: The token lacks the required scope or workspace access.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The resource is missing or inaccessible.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: >-
        The project is not native, the key already exists, the segment is
        locked, the webhook endpoint limit was reached, or the job, memory, or
        glossary is managed elsewhere or archived.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PayloadTooLarge:
      description: >-
        The request body exceeds 256 KiB (16 MiB for a strings batch, 25 MiB for
        a bilingual file or a memory or glossary import).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnsupportedMediaType:
      description: The request body has an unsupported media type.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unavailable:
      description: Authentication or resource storage is temporarily unavailable.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    personalAccessToken:
      type: apiKey
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.