# Update a segment

`PATCH https://api.lingohub.com/v2/segments/{segmentId}`

LingoHub API V2 (Beta) · [Segments](https://developers.lingohub.com/reference/v2/operations/tags/segments.md) · operation `updateSegment`

Changes a segment and its texts with JSON merge-patch; changes apply to every key of the segment. `texts` takes only the languages you change: `variants` replaces that language's text and an empty list clears it. Texts are processed with the placeholder settings and automations of `project_id`, by default the project of the segment's oldest key. Becoming singular keeps the OTHER form and removes the other plural forms in all languages. Send the ETag from getSegment as If-Match to make sure nobody changed the segment in between. Requires stack-level segment and text view permissions, segment management to change the segment and text management to change its texts.

## Parameters

| Parameter | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `segmentId` | path | yes | string | Public identifier of the segment. |
| `project_id` | query | no | string | Project whose placeholder settings and automations process the texts. It must have a key of the segment; the project of the segment's oldest key when left out. |
| `If-Match` | header | no | string | Optional precondition. Send the quoted ETag from a GET of this resource. The mutation only runs if a strong tag matches the current representation, checked under the write lock. A comma-separated list is allowed; '*' req… |

## Example request

```sh
curl --request PATCH \
  --url https://api.lingohub.com/v2/segments/SEGMENT_ID \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "description": "Label on the sign-in button",
  "is_not_translatable": false,
  "is_plural": false,
  "label_ids": [
    "la_0197c8f2-5a6b-7cde-8f12-3456789abcde"
  ],
  "texts": {
    "de": {
      "variants": [
        {
          "content": "Anmelden"
        }
      ]
    }
  }
}'
```

## Responses

- `200`: The segment after the change, with its texts in all languages of its stack.
- `400`: 
- `401`: 
- `403`: 
- `404`: 
- `409`: `conflict`: the segment is deactivated (it is in no file) so its texts can't be changed, the project's edit settings refer to something that no longer exists, or another change to the segment's texts is in progress (retr…
- `412`: 
- `422`: 
- `429`: 
- `500`: 
- `503`: 

## OpenAPI definition

The complete definition of this operation, with every schema it references:

````json
{
  "openapi": "3.1.0",
  "info": {
    "title": "LingoHub API V2 (Beta)",
    "version": "2.0"
  },
  "servers": [
    {
      "url": "https://api.lingohub.com",
      "description": "LingoHub"
    }
  ],
  "tags": [
    {
      "name": "Segments",
      "description": "Read and change segments: a source text and its translations, which every key of the segment shows."
    }
  ],
  "paths": {
    "/v2/segments/{segmentId}": {
      "patch": {
        "tags": [
          "Segments"
        ],
        "summary": "Update a segment",
        "description": "Changes a segment and its texts with JSON merge-patch; changes apply to every key of the segment. `texts` takes only the languages you change: `variants` replaces that language's text and an empty list clears it. Texts are processed with the placeholder settings and automations of `project_id`, by default the project of the segment's oldest key. Becoming singular keeps the OTHER form and removes the other plural forms in all languages. Send the ETag from getSegment as If-Match to make sure nobody changed the segment in between. Requires stack-level segment and text view permissions, segment management to change the segment and text management to change its texts.",
        "operationId": "updateSegment",
        "parameters": [
          {
            "name": "segmentId",
            "in": "path",
            "description": "Public identifier of the segment.",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Public id that is created from the type prefix of the corresponding resource and its UUID. I.e : For a segment, a valid value would be : seg_0197c8f2-5a6b-7cde-8f12-3456789abcde",
              "pattern": "^seg_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Project whose placeholder settings and automations process the texts. It must have a key of the segment; the project of the segment's oldest key when left out.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Public id that is created from the type prefix of the corresponding resource and its UUID. I.e : For a project, a valid value would be : pr_0197c8f2-5a6b-7cde-8f12-3456789abcde",
              "pattern": "^pr_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            },
            "example": "pr_0197c8f2-5a6b-7cde-8f12-3456789abcde"
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Optional precondition. Send the quoted ETag from a GET of this resource. The mutation only runs if a strong tag matches the current representation, checked under the write lock. A comma-separated list is allowed; '*' requires an existing representation. Weak tags never match. Omit this header for an unconditional write. For an action, use the ETag from GET of the target resource, without the action suffix. A stale tag returns 412; read the current state before retrying.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSegment"
              }
            },
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSegment"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The segment after the change, with its texts in all languages of its stack.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Segment"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`conflict`: the segment is deactivated (it is in no file) so its texts can't be changed, the project's edit settings refer to something that no longer exists, or another change to the segment's texts is in progress (retry).",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableContent"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "UpdateSegment": {
        "type": "object",
        "additionalProperties": false,
        "description": "Request body to change a segment and its texts with JSON merge-patch. Changes apply to every key of the segment.",
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Note for translators. A LINA with an AI engine reads it too when its `context.is_segments_enabled` is on; LingoHub-managed LINAs always do. Null clears it.",
            "example": "Label on the sign-in button"
          },
          "is_not_translatable": {
            "type": "boolean",
            "description": "Whether the segment is excluded from translation.",
            "example": false
          },
          "is_plural": {
            "type": "boolean",
            "description": "Whether the segment has plural forms. The formats of all its files must allow it. Becoming singular keeps the OTHER form and removes the other plural forms in all languages.",
            "example": false
          },
          "label_ids": {
            "type": "array",
            "description": "Replaces the segment's labels with these labels of the workspace; `[]` removes them all. At most 150.",
            "example": [
              "la_0197c8f2-5a6b-7cde-8f12-3456789abcde"
            ],
            "items": {
              "type": "string",
              "example": "la_0197c8f2-5a6b-7cde-8f12-3456789abcde",
              "maxLength": 150,
              "minLength": 0,
              "pattern": "^la_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            },
            "maxItems": 150,
            "uniqueItems": true
          },
          "texts": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/UpdateSegmentText"
            },
            "description": "The texts to change, by language code; languages left out keep their text. `variants` replaces a language's text, and `[]` clears it.",
            "example": {
              "de": {
                "variants": [
                  {
                    "content": "Anmelden"
                  }
                ]
              }
            }
          }
        }
      },
      "UpdateSegmentText": {
        "type": "object",
        "additionalProperties": false,
        "description": "Request body part that replaces the text of a segment in one language.",
        "properties": {
          "variants": {
            "type": "array",
            "description": "The new text, one variant per device and plural form, in this order. It replaces the language's text; `[]` clears it. At most 1,000 variants.",
            "example": [
              {
                "content": "Anmelden"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/WriteTextVariant"
            },
            "maxItems": 1000,
            "minItems": 0
          },
          "is_minor_update": {
            "type": [
              "boolean",
              "null"
            ],
            "default": false,
            "description": "Whether the change is minor, such as a typo fix: the status automations for minor edits apply, so the translations of a changed source text can stay as they are. Defaults to false.",
            "example": false
          }
        },
        "required": [
          "variants"
        ]
      },
      "WriteTextVariant": {
        "type": "object",
        "additionalProperties": false,
        "description": "One variant of a text: its content for a device and a plural form. The variants of a text keep the order they are sent in.",
        "properties": {
          "device": {
            "$ref": "#/components/schemas/VariantDevice",
            "default": "OTHER",
            "description": "Device the variant is for. Defaults to OTHER.",
            "example": "OTHER"
          },
          "plural_form": {
            "$ref": "#/components/schemas/VariantPluralForm",
            "default": "OTHER",
            "description": "Plural form of the variant; a segment without plural forms takes OTHER only. Defaults to OTHER.",
            "example": "OTHER"
          },
          "content": {
            "type": "string",
            "description": "The text, with its placeholders and markup. A variant that is still empty after the project's automations is removed. At most 51,999 characters.",
            "example": "Sign in",
            "maxLength": 51999
          }
        },
        "required": [
          "content"
        ]
      },
      "VariantDevice": {
        "type": "string",
        "description": "Device of a text variant.",
        "enum": [
          "PHONE",
          "MUSIC_PLAYER",
          "TABLET",
          "WATCH",
          "TV",
          "GLASSES",
          "PC",
          "OTHER"
        ]
      },
      "VariantPluralForm": {
        "type": "string",
        "description": "Plural form of a text variant.",
        "enum": [
          "ZERO",
          "ONE",
          "TWO",
          "FEW",
          "MANY",
          "OTHER"
        ]
      },
      "Segment": {
        "type": "object",
        "description": "A source text and its translations, with the notes and labels they share. Every key of the segment shows these texts; its keys are listed by listSegmentKeys.",
        "properties": {
          "object_type": {
            "type": "string",
            "description": "Always `SEGMENT`.",
            "enum": [
              "SEGMENT"
            ],
            "example": "SEGMENT"
          },
          "id": {
            "type": "string",
            "description": "Public identifier of the segment.",
            "example": "seg_0197c8f2-5a6b-7cde-8f12-3456789abcde",
            "minLength": 1,
            "pattern": "^seg_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "stack_id": {
            "type": "string",
            "description": "Public identifier of the stack the segment belongs to.",
            "example": "stack_0197c8f2-5a6b-7cde-8f12-3456789abcde",
            "pattern": "^stack_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "is_plural": {
            "type": "boolean",
            "description": "Whether the segment has plural forms.",
            "example": false
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Note for translators. A LINA with an AI engine reads it too when its `context.is_segments_enabled` is on; LingoHub-managed LINAs always do.",
            "example": "Label on the sign-in button"
          },
          "is_not_translatable": {
            "type": "boolean",
            "description": "Whether the segment is excluded from translation.",
            "example": false
          },
          "not_translatable_reason": {
            "description": "Why the segment is not translatable: `RESOURCE_FILE` when the imported file marks it (Android XML, Rails YAML, iOS String Catalog, XLIFF 2), `EDITOR` when someone marked it in LingoHub. Null when it is translatable.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/NotTranslatableReason"
              },
              {
                "type": "null"
              }
            ]
          },
          "label_ids": {
            "type": "array",
            "description": "Public identifiers of the segment's labels.",
            "example": [
              "la_0197c8f2-5a6b-7cde-8f12-3456789abcde"
            ],
            "items": {
              "type": "string",
              "example": "la_0197c8f2-5a6b-7cde-8f12-3456789abcde",
              "pattern": "^la_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          "texts": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/SegmentText"
            },
            "description": "The segment's texts by language code, the source first. A read can limit them to the languages named by `language_codes`.",
            "example": {
              "en": {
                "is_source": true,
                "status": "APPROVED",
                "stage": "DONE",
                "variants": [
                  {
                    "content": "Sign in",
                    "device": "OTHER",
                    "plural_form": "OTHER"
                  }
                ],
                "updated_at": "2026-09-29T00:00:00.000Z",
                "content_updated_at": "2026-09-29T00:00:00.000Z"
              },
              "de": {
                "is_source": false,
                "status": "TRANSLATED",
                "stage": "NEEDS_REVIEW",
                "variants": [
                  {
                    "content": "Anmelden",
                    "device": "OTHER",
                    "plural_form": "OTHER"
                  }
                ],
                "updated_at": "2026-09-29T00:00:00.000Z",
                "content_updated_at": "2026-09-29T00:00:00.000Z"
              }
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the segment was created.",
            "example": "2026-09-29T00:00:00.123Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the segment's description, flags or labels last changed. Each text has its own timestamps.",
            "example": "2026-09-29T00:00:00.123Z"
          }
        },
        "required": [
          "created_at",
          "description",
          "id",
          "is_not_translatable",
          "is_plural",
          "label_ids",
          "not_translatable_reason",
          "object_type",
          "stack_id",
          "texts",
          "updated_at"
        ]
      },
      "NotTranslatableReason": {
        "type": "string",
        "description": "Origin of a segment's not-translatable flag: file syntax or an editor/bulk action.",
        "enum": [
          "RESOURCE_FILE",
          "EDITOR"
        ]
      },
      "SegmentText": {
        "type": "object",
        "description": "The text of a segment in one language, the source included: its variants and its workflow status.",
        "example": {
          "is_source": true,
          "status": "APPROVED",
          "stage": "DONE",
          "variants": [
            {
              "content": "Sign in",
              "device": "OTHER",
              "plural_form": "OTHER"
            }
          ],
          "updated_at": "2026-09-29T00:00:00.000Z",
          "content_updated_at": "2026-09-29T00:00:00.000Z"
        },
        "properties": {
          "is_source": {
            "type": "boolean",
            "description": "Whether this is the stack's source language.",
            "example": true
          },
          "status": {
            "$ref": "#/components/schemas/TextStatus",
            "description": "Workflow status of the text.",
            "example": "APPROVED"
          },
          "stage": {
            "$ref": "#/components/schemas/TextStage",
            "description": "Workflow stage of the status.",
            "example": "DONE"
          },
          "variants": {
            "type": "array",
            "description": "The variants of the text in their order: one per device and plural form. Empty when the text is empty.",
            "example": [
              {
                "content": "Sign in",
                "device": "OTHER",
                "plural_form": "OTHER"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/TextVariant"
            }
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the text, its status or its counts last changed.",
            "example": "2026-09-29T00:00:00.123Z"
          },
          "content_updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the variants last changed. Null before the text ever had content.",
            "example": "2026-09-29T00:00:00.123Z"
          }
        },
        "required": [
          "content_updated_at",
          "is_source",
          "stage",
          "status",
          "updated_at",
          "variants"
        ]
      },
      "TextStatus": {
        "type": "string",
        "description": "The workflow status of texts in a given language. Each status belongs to exactly one `TextStage` (see the `stage` grouping in the status counts).",
        "enum": [
          "BLOCKED",
          "NEW",
          "STALE",
          "REJECTED",
          "DRAFT",
          "AI_TRANSLATED",
          "TRANSLATED",
          "QA_PASSED",
          "QA_FLAGGED",
          "APPROVED",
          "NOT_TRANSLATABLE"
        ]
      },
      "TextStage": {
        "type": "string",
        "description": "The high-level workflow stage that groups one or more `TextStatus` values:\n  - `NOT_READY` — blocked segments\n  - `NEEDS_EDIT` — new, draft, stale or rejected segments\n  - `NEEDS_REVIEW` — AI-translated, translated, QA-passed or QA-flagged segments\n  - `DONE` — approved or not-translatable segments",
        "enum": [
          "NOT_READY",
          "NEEDS_EDIT",
          "NEEDS_REVIEW",
          "DONE"
        ]
      },
      "TextVariant": {
        "type": "object",
        "description": "One variant of a text: its content for a device and a plural form.",
        "properties": {
          "content": {
            "type": "string",
            "description": "The text, with its placeholders and markup.",
            "example": "Sign in"
          },
          "device": {
            "$ref": "#/components/schemas/VariantDevice",
            "description": "Device the variant is for.",
            "example": "OTHER"
          },
          "plural_form": {
            "$ref": "#/components/schemas/VariantPluralForm",
            "description": "Plural form of the variant; a segment without plural forms has OTHER only.",
            "example": "OTHER"
          }
        },
        "required": [
          "content",
          "device",
          "plural_form"
        ]
      },
      "Error": {
        "type": "object",
        "description": "RFC 9457 problem details. `code` identifies the problem type (one per `type` URL); `errors` lists rejected fields or parameters; `required_permission` names the permission a 403 lacked.",
        "properties": {
          "type": {
            "type": "string",
            "description": "URL identifying the problem type and pointing to its documentation.",
            "example": "https://api.lingohub.com/errors/resource-not-found"
          },
          "title": {
            "type": "string",
            "description": "Short, constant summary of the problem type.",
            "example": "Resource not found"
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "description": "HTTP status code.",
            "example": 404
          },
          "detail": {
            "type": "string",
            "description": "Human-readable explanation of this occurrence of the problem.",
            "example": "Resource with ID 'pr_0197c8f2-5a6b-7cde-8f12-3456789abcde' was not found."
          },
          "instance": {
            "type": "string",
            "description": "Path of the request that produced the problem.",
            "example": "/v2/projects/pr_0197c8f2-5a6b-7cde-8f12-3456789abcde"
          },
          "code": {
            "$ref": "#/components/schemas/ErrorCode",
            "description": "Machine-readable problem type.",
            "example": "resource_not_found"
          },
          "request_id": {
            "type": "string",
            "description": "Correlation id of the request, also returned in the `X-Request-ID` header. Quote it when contacting support.",
            "example": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
          },
          "errors": {
            "type": "array",
            "description": "Rejected fields or parameters. Present when the problem concerns specific fields or parameters.",
            "example": [
              {
                "detail": "must be at least 2 characters long",
                "pointer": "#/name",
                "parameter": "limit",
                "code": "minLength"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/FieldError"
            }
          },
          "required_permission": {
            "$ref": "#/components/schemas/RequiredPermission",
            "description": "The permission the API key lacks. Present on 403 responses."
          }
        },
        "required": [
          "code",
          "detail",
          "instance",
          "request_id",
          "status",
          "title",
          "type"
        ]
      },
      "ErrorCode": {
        "type": "string",
        "description": "Machine-readable problem type of a V2 error response. Each code has a fixed HTTP status and documentation at its `type` URL.",
        "enum": [
          "invalid_json",
          "invalid_parameter",
          "missing_parameter",
          "unknown_parameter",
          "invalid_filter",
          "invalid_cursor",
          "bad_request",
          "missing_api_key",
          "invalid_api_key",
          "expired_api_key",
          "revoked_api_key",
          "disabled_api_key",
          "insufficient_permissions",
          "resource_not_found",
          "route_not_found",
          "method_not_allowed",
          "not_acceptable",
          "precondition_failed",
          "content_too_large",
          "unsupported_media_type",
          "already_exists",
          "idempotency_outcome_unknown",
          "idempotency_key_in_use",
          "stack_not_empty",
          "branch_not_ready",
          "backup_not_ready",
          "backup_in_use",
          "default_branch_protected",
          "owner_membership_protected",
          "source_language_protected",
          "branch_limit_reached",
          "context_image_limit_reached",
          "automation_limit_reached",
          "translation_order_pending",
          "git_integration_not_configured",
          "branch_git_integration_not_configured",
          "git_integration_unauthorized",
          "conflict",
          "validation_failed",
          "idempotency_key_mismatch",
          "rate_limit_exceeded",
          "internal_error",
          "upstream_error",
          "service_unavailable",
          "upstream_timeout"
        ]
      },
      "FieldError": {
        "type": "object",
        "description": "A rejected field or parameter. `pointer` locates a body field (RFC 6901 JSON Pointer), `parameter` a query, path or header parameter or a field of a multipart upload; both are set for a position inside a JSON-valued parameter such as `filter`.",
        "properties": {
          "detail": {
            "type": "string",
            "description": "Human-readable description of the problem.",
            "example": "must be at least 2 characters long"
          },
          "pointer": {
            "type": [
              "string",
              "null"
            ],
            "description": "JSON Pointer to the offending body field, or to the position inside a JSON-valued parameter.",
            "example": "#/name"
          },
          "parameter": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name of the offending query, path or header parameter, or of the multipart form field.",
            "example": "limit"
          },
          "code": {
            "$ref": "#/components/schemas/FieldErrorCode",
            "description": "Why the field or parameter was rejected.",
            "example": "minLength"
          }
        },
        "required": [
          "code",
          "detail",
          "parameter",
          "pointer"
        ]
      },
      "FieldErrorCode": {
        "type": "string",
        "description": "Why a field or parameter was rejected: the JSON Schema keyword of the violated rule, or one of the documented rules that no schema can express.",
        "enum": [
          "required",
          "type",
          "enum",
          "minLength",
          "maxLength",
          "minimum",
          "maximum",
          "pattern",
          "format",
          "additionalProperties",
          "minItems",
          "maxItems",
          "uniqueItems",
          "already_exists",
          "not_found",
          "not_supported",
          "unsupported_file_extension",
          "file_too_large",
          "file_empty",
          "invalid_archive",
          "empty_archive"
        ]
      },
      "RequiredPermission": {
        "type": "object",
        "description": "The permission the API key lacks, in the vocabulary of the API key permission settings.",
        "properties": {
          "scope": {
            "$ref": "#/components/schemas/PermissionScope",
            "description": "Where the permission applies.",
            "example": "STACK"
          },
          "target": {
            "$ref": "#/components/schemas/PermissionTarget",
            "description": "The area the permission governs.",
            "example": "SETTINGS"
          },
          "level": {
            "$ref": "#/components/schemas/PermissionLevel",
            "description": "The access level required.",
            "example": "MANAGE"
          }
        },
        "required": [
          "level",
          "scope",
          "target"
        ]
      },
      "PermissionScope": {
        "type": "string",
        "description": "Where a permission applies: `WORKSPACE` permissions cover workspace-level resources, `STACK` permissions the resources of a stack (its projects, branches, resources, languages, ...).",
        "enum": [
          "WORKSPACE",
          "STACK"
        ]
      },
      "PermissionTarget": {
        "type": "string",
        "description": "The area a permission governs.",
        "enum": [
          "GENERAL",
          "BILLING_SUBSCRIPTION",
          "WORKSPACES",
          "MEMBERS",
          "PLUGINS_INTEGRATIONS",
          "LOGS",
          "API_ACCESS",
          "STACKS",
          "TRANSLATION_ORDERS",
          "WORK_REPORTS",
          "STYLE_GUIDES",
          "GLOSSARIES",
          "TRANSLATION_MEMORIES",
          "LABELS",
          "AI_TRANSLATION",
          "QUICK_TRANSLATIONS",
          "SETTINGS",
          "ACTIVITIES",
          "RESOURCES",
          "CONTEXT_IMAGES",
          "LANGUAGES",
          "SEGMENT_KEYS",
          "SEGMENTS",
          "SEGMENT_TEXTS"
        ]
      },
      "PermissionLevel": {
        "type": "string",
        "description": "Access level of a permission: `MANAGE` includes `WRITE` and `VIEW`.",
        "enum": [
          "NO_ACCESS",
          "VIEW",
          "WRITE",
          "MANAGE"
        ]
      }
    },
    "headers": {
      "ETag": {
        "description": "Opaque strong validator for this representation. Keep its quotation marks and use it as If-Match on a documented conditional write. A replay carries the original ETag, which may now be stale.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimit": {
        "description": "State of the rate-limit policy currently closest to rejection (IETF draft-ietf-httpapi-ratelimit-headers): the quoted policy name with `r` = requests remaining right now and `t` = seconds until the full quota is available again. Example: `\"api-key\";r=42;t=7`. Advisory: absent when the request fails authentication or the limiter state is momentarily unknown.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimit-Policy": {
        "description": "The rate-limit policies applied to the request: each quoted policy name with `q` = sustained request quota per window of `w` seconds. Example: `\"api-key\";q=180;w=60, \"workspace\";q=600;w=60`. Advisory: absent when the request fails authentication or the limiter state is momentarily unknown.",
        "schema": {
          "type": "string"
        }
      },
      "Retry-After": {
        "description": "Seconds to wait before retrying.",
        "schema": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "The request is malformed: an unknown or invalid query parameter, an invalid id in the path, or a body that is not valid JSON. `code` names the problem, `errors` the parameter or field.",
        "headers": {
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Invalid or missing API key.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Insufficient permissions.",
        "headers": {
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "The resource does not exist, or the API key cannot see it.",
        "headers": {
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PreconditionFailed": {
        "description": "The current representation does not match If-Match (`precondition_failed`). No change was applied.",
        "headers": {
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "UnprocessableContent": {
        "description": "The request is well-formed, but values are invalid; `errors` points at each of them.",
        "headers": {
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "The API rate limit was exceeded. Wait for the number of seconds given in the Retry-After header, then retry.",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          },
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "InternalServerError": {
        "description": "An unexpected internal server error occurred.",
        "headers": {
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "The service is temporarily unavailable. Retry after the number of seconds in the Retry-After header.",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          },
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "description": "API key authentication. Create API keys in your LingoHub workspace settings. Keys use the `lh-api_` prefix. Pass the full key as the Bearer token.",
        "scheme": "bearer"
      }
    }
  }
}
````
