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

# Create a translation job

> Starts an asynchronous job that translates a Study into another locale.



## OpenAPI

````yaml /reference/study-api-v2.json post /v2/studies/{studyId}/translationJobs
openapi: 3.1.0
info:
  title: Sprig Public API V2 — Studies
  version: 1.0.0
  description: >-
    Programmatically create and manage Sprig Studies (surveys), their Questions,
    Blocks, invitations, and translations.
  contact:
    name: Support
    email: support@sprig.com
servers:
  - url: https://api.sprig.com
security: []
tags:
  - name: Studies
    description: The root resource for a programmatically managed survey.
  - name: Questions
    description: Questions, with their nested options, owned by a Study.
  - name: Blocks
    description: >-
      Blocks and Pages; Pages are not supported for IN_PRODUCT_SURVEY Studies.
      Group skip and display logic live on the Block. Question logic is member
      display, plus skip logic only outside a Page.
  - name: Invitations
    description: >-
      Invitation codes for SURVEY Studies; invitations are not supported for
      IN_PRODUCT_SURVEY Studies.
  - name: Translations
    description: >-
      Per-locale translated content for a Study, and the asynchronous jobs that
      generate it. Job cancellation is best-effort and does not roll back
      committed output.
  - name: Attributes
    description: Custom Attribute definitions available in the environment.
  - name: Targeting
    description: Event triggers and audience conditions for IN_PRODUCT_SURVEY Studies.
  - name: Events
    description: Existing tracked and page-URL Events available for Study targeting.
paths:
  /v2/studies/{studyId}/translationJobs:
    post:
      tags:
        - Translations
      summary: Create a translation job
      description: Starts an asynchronous job that translates a Study into another locale.
      operationId: createTranslationJob
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: studyId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTranslationJobInput'
      responses:
        '202':
          description: Accepted. The Location header points at the created job.
          headers:
            Location:
              description: URL of the created translation job.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TranslationJob'
        '400':
          description: The request is not valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            The environment API key is missing or invalid, cannot access this
            resource, or the Study API is not available for the account.
        '404':
          description: Study not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            The Study is not editable, or its stored definition cannot be
            translated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            The Study failed validation, or the requested locale is not
            supported.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - EnvironmentApiKey: []
components:
  schemas:
    CreateTranslationJobInput:
      type: object
      properties:
        targetLocale:
          type: string
          minLength: 2
          maxLength: 35
          pattern: ^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$
          description: One BCP 47 locale token.
        mode:
          $ref: '#/components/schemas/TranslationJobMode'
      required:
        - targetLocale
      additionalProperties: false
      description: Input for starting asynchronous Study translation generation.
    TranslationJob:
      type: object
      properties:
        id:
          type: string
          format: uuid
        targetLocale:
          type: string
        mode:
          $ref: '#/components/schemas/TranslationJobMode'
        status:
          $ref: '#/components/schemas/TranslationJobStatus'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        progress:
          type: object
          additionalProperties: {}
        result:
          type: object
          additionalProperties: {}
        error:
          $ref: '#/components/schemas/TranslationJobError'
      required:
        - id
        - targetLocale
        - mode
        - status
        - createdAt
        - updatedAt
      additionalProperties: false
      description: >-
        Canonical state and result metadata for one asynchronous translation
        job.
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: A machine-readable error code (e.g. STUDY_NOT_FOUND).
        message:
          type: string
          description: A human-readable description of the error.
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              path:
                type: string
              message:
                type: string
              resource:
                type: object
                properties:
                  type:
                    type: string
                  id:
                    type: string
                required:
                  - type
                  - id
                description: >-
                  The other resource this issue points at, when the issue is not
                  about the request itself.
            required:
              - code
              - message
          description: >-
            Per-field validation issues, present when the request itself was
            malformed.
      required:
        - code
        - message
      description: Error response returned by the Public API V2.
    TranslationJobMode:
      type: string
      enum:
        - FILL_MISSING
        - REPLACE_ALL
      description: >-
        Whether generation fills only missing values or replaces every
        translated value.
    TranslationJobStatus:
      type: string
      enum:
        - PENDING
        - RUNNING
        - COMPLETED
        - FAILED
        - CANCELLED
      description: >-
        PENDING and RUNNING jobs can be cancelled. CANCELLED means no further
        translation output will be persisted. COMPLETED and FAILED are terminal.
        Cancelling does not roll back translations already committed by a
        completed job.
    TranslationJobError:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
      additionalProperties: false
      description: Failure details recorded for an asynchronous translation job.
  securitySchemes:
    EnvironmentApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Use `API-Key YOUR_API_KEY`. The key selects the Production or
        Development environment.

````