# Retrieve stack automation settings

`GET https://api.lingohub.com/v2/stacks/{stackId}/automation-settings`

LingoHub API V2 (Beta) · [Stacks](https://developers.lingohub.com/reference/v2/operations/tags/stacks.md) · operation `getStackAutomationSettings`

Returns the stack's automation rules in the order they run, and the maximum number of rules allowed. The rules apply to every project of the stack and run grouped by type: text replacements first, then status changes, then labels. A label action whose label was deleted shows `label_id: null`. Requires stack-level settings management permission.

## Parameters

| Parameter | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `stackId` | path | yes | string |  |

## Example request

```sh
curl --request GET \
  --url https://api.lingohub.com/v2/stacks/STACK_ID/automation-settings \
  --header 'Authorization: Bearer YOUR_API_KEY'
```

## Responses

- `200`: Current automation settings retrieved.
- `400`: 
- `401`: 
- `403`: 
- `404`: 
- `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": "Stacks",
      "description": "Manage stacks. A stack holds the languages, members and texts its projects share: a `PUBLIC` stack can serve several projects, a `PRIVATE` stack belongs to one project."
    }
  ],
  "paths": {
    "/v2/stacks/{stackId}/automation-settings": {
      "get": {
        "tags": [
          "Stacks"
        ],
        "summary": "Retrieve stack automation settings",
        "description": "Returns the stack's automation rules in the order they run, and the maximum number of rules allowed. The rules apply to every project of the stack and run grouped by type: text replacements first, then status changes, then labels. A label action whose label was deleted shows `label_id: null`. Requires stack-level settings management permission.",
        "operationId": "getStackAutomationSettings",
        "parameters": [
          {
            "name": "stackId",
            "in": "path",
            "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 stack, a valid value would be : 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}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current automation settings retrieved.",
            "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/StackAutomationSettings"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "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"
        }
      }
    },
    "schemas": {
      "StackAutomationSettings": {
        "type": "object",
        "description": "Current automation configuration of the stack, which applies to every project of it; not a simulation of effective behavior across the keys of shared segments.",
        "properties": {
          "object_type": {
            "type": "string",
            "description": "Always `STACK_AUTOMATION_SETTINGS`.",
            "enum": [
              "STACK_AUTOMATION_SETTINGS"
            ],
            "example": "STACK_AUTOMATION_SETTINGS"
          },
          "id": {
            "type": "string",
            "description": "Stack public identity addressing this singleton.",
            "example": "stack_0197c8f2-5a6b-7cde-8f12-3456789abcde",
            "minLength": 1,
            "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}$"
          },
          "rules": {
            "type": "array",
            "description": "Complete ordered configuration. Evaluation runs TEXT, STATUS, LABEL families with order preserved within each family.",
            "example": [
              {
                "rule_key": "0197c8f2-5a6b-7cde-8f12-3456789abcde",
                "type": "STATUS",
                "is_enabled": true,
                "trigger": "TEXT_UPDATED",
                "scope": {
                  "origin": "IMPORT",
                  "role": "TARGET",
                  "language_codes": [
                    "de"
                  ]
                },
                "conditions": [
                  {
                    "subject": "TEXT",
                    "mode": "CONTAINS",
                    "value": "draft"
                  }
                ],
                "action": {
                  "type": "SET_STATUS",
                  "target": {
                    "selector": "TRIGGERING_TEXT",
                    "language_codes": [],
                    "conditions": []
                  },
                  "status": "APPROVED"
                }
              }
            ],
            "items": {
              "$ref": "#/components/schemas/StackAutomationRule"
            }
          },
          "max_rules": {
            "type": "integer",
            "format": "int64",
            "description": "Current maximum number of rules allowed for the stack; does not truncate existing configuration.",
            "example": 50,
            "minimum": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Creation time of the stack settings row.",
            "example": "2026-09-30T00:00:00.123Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Last change to the stack settings row.",
            "example": "2026-09-30T00:00:00.123Z"
          }
        },
        "required": [
          "created_at",
          "id",
          "max_rules",
          "object_type",
          "rules",
          "updated_at"
        ]
      },
      "StackAutomationRule": {
        "type": "object",
        "description": "One rule in the ordered configuration of a stack; not a separately persisted V2 resource.",
        "properties": {
          "rule_key": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Stored UUID configuration key, stable across saves. Null preserves a historical missing key; reads never mint one.",
            "example": "0197c8f2-5a6b-7cde-8f12-3456789abcde"
          },
          "type": {
            "$ref": "#/components/schemas/AutomationType",
            "description": "How the rule's group runs. `TEXT`: every matching rule applies, in list order, so the replacements chain. `STATUS`: the first matching rule wins. `LABEL`: every matching rule applies.",
            "example": "STATUS"
          },
          "is_enabled": {
            "type": "boolean",
            "description": "Whether this configured rule is enabled.",
            "example": true
          },
          "trigger": {
            "$ref": "#/components/schemas/AutomationTrigger",
            "description": "Incoming event that may trigger the rule.",
            "example": "TEXT_UPDATED"
          },
          "scope": {
            "$ref": "#/components/schemas/AutomationScope",
            "description": "Origin, text role and language selection.",
            "example": {
              "origin": "IMPORT",
              "role": "TARGET",
              "language_codes": [
                "de"
              ]
            }
          },
          "conditions": {
            "type": "array",
            "description": "All trigger conditions must match.",
            "example": [
              {
                "subject": "TEXT",
                "mode": "CONTAINS",
                "value": "draft"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/AutomationCondition"
            }
          },
          "action": {
            "$ref": "#/components/schemas/AutomationAction",
            "description": "What the rule does and to which texts. Its `type` follows from the rule's `type` for now: `TEXT` → `REPLACE_TEXT`, `STATUS` → `SET_STATUS`, `LABEL` → `ADD_LABEL`.",
            "example": {
              "type": "SET_STATUS",
              "target": {
                "selector": "TRIGGERING_TEXT",
                "language_codes": [],
                "conditions": []
              },
              "status": "APPROVED"
            }
          }
        },
        "required": [
          "action",
          "conditions",
          "is_enabled",
          "rule_key",
          "scope",
          "trigger",
          "type"
        ]
      },
      "AutomationType": {
        "type": "string",
        "description": "The rule family. It decides the rule's action and how the family's matching rules run. `TEXT` replaces text (`REPLACE_TEXT`): every matching rule applies, in list order, so the replacements chain. `STATUS` sets a status (`SET_STATUS`): the first matching rule wins and the others are skipped. `LABEL` adds a label (`ADD_LABEL`): every matching rule applies. The families run in this order: text replacements first, then status changes, then labels.",
        "enum": [
          "TEXT",
          "STATUS",
          "LABEL"
        ]
      },
      "AutomationTrigger": {
        "type": "string",
        "description": "What starts the rule. `KEY_CREATED`, `KEY_UPDATED` and `KEY_CREATED_OR_UPDATED`: a key is created, changed, or either; only `LABEL` rules can react to keys. `TEXT_CREATED`, `TEXT_UPDATED` and `TEXT_CREATED_OR_UPDATED`: a text is created, changed, or either.",
        "enum": [
          "KEY_CREATED",
          "KEY_UPDATED",
          "KEY_CREATED_OR_UPDATED",
          "TEXT_CREATED",
          "TEXT_UPDATED",
          "TEXT_CREATED_OR_UPDATED"
        ]
      },
      "AutomationScope": {
        "type": "object",
        "description": "Which incoming changes may trigger a configured rule.",
        "properties": {
          "origin": {
            "$ref": "#/components/schemas/AutomationOrigin",
            "description": "IMPORT, EDITOR, or ANY. LINA/pretranslation bypass this workflow pipeline.",
            "example": "ANY"
          },
          "role": {
            "$ref": "#/components/schemas/AutomationRole",
            "description": "Source/target scope; meaningful only for text-level triggers.",
            "example": "ANY"
          },
          "language_codes": {
            "type": "array",
            "description": "Empty means every language; meaningful only for text-level triggers.",
            "example": [
              "de"
            ],
            "items": {
              "type": "string",
              "description": "Language code that uniquely identifies a locale. Valid examples would be 'en', 'en-GB', 'de', 'de-DE' etc. according to [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes)."
            }
          }
        },
        "required": [
          "language_codes",
          "origin",
          "role"
        ]
      },
      "AutomationOrigin": {
        "type": "string",
        "description": "Where the change comes from. `IMPORT`: an import of files, including Git and integration syncs. `EDITOR`: a key or text changed directly, in the editor or through the API. `ANY`: either. Changes made by LINA or pre-translation don't run automation rules.",
        "enum": [
          "IMPORT",
          "EDITOR",
          "ANY"
        ]
      },
      "AutomationRole": {
        "type": "string",
        "description": "Which texts of a segment can start the rule. `SOURCE`: the source text. `TARGET`: a text in a target language. `ANY`: either. A rule that reacts to keys takes `ANY`, because a key has no language.",
        "enum": [
          "SOURCE",
          "TARGET",
          "ANY"
        ]
      },
      "AutomationCondition": {
        "type": "object",
        "description": "A plain-text condition; conditions in one list must all match.",
        "properties": {
          "subject": {
            "$ref": "#/components/schemas/AutomationConditionSubject",
            "description": "Subject inspected by the condition.",
            "example": "TEXT"
          },
          "mode": {
            "$ref": "#/components/schemas/AutomationMatchMode",
            "description": "Plain-text matching mode. Regular expressions are not used.",
            "example": "CONTAINS"
          },
          "value": {
            "type": [
              "string",
              "null"
            ],
            "description": "Match text; null for conditions that require no text value.",
            "example": "draft"
          }
        },
        "required": [
          "mode",
          "subject",
          "value"
        ]
      },
      "AutomationConditionSubject": {
        "type": "string",
        "description": "What a condition looks at. `KEY`: the segment's keys; the condition matches when one of them does. `TEXT`: the content of the text. `DESCRIPTION`: the segment's description.",
        "enum": [
          "KEY",
          "TEXT",
          "DESCRIPTION"
        ]
      },
      "AutomationMatchMode": {
        "type": "string",
        "description": "How a condition compares, case-sensitively and as plain text (no regular expressions). `IS_EMPTY` and `IS_NOT_EMPTY` take no `value`. `EQUALS`, `STARTS_WITH`, `ENDS_WITH` and `CONTAINS` compare with `value`, which they require.",
        "enum": [
          "IS_EMPTY",
          "IS_NOT_EMPTY",
          "EQUALS",
          "STARTS_WITH",
          "ENDS_WITH",
          "CONTAINS"
        ]
      },
      "AutomationAction": {
        "type": "object",
        "description": "What the rule does and to which texts. `type` selects the shape; it follows from the rule's `type` for now.",
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "REPLACE_TEXT": "#/components/schemas/AutomationReplaceTextAction",
            "SET_STATUS": "#/components/schemas/AutomationSetStatusAction",
            "ADD_LABEL": "#/components/schemas/AutomationAddLabelAction"
          }
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/AutomationReplaceTextAction"
          },
          {
            "$ref": "#/components/schemas/AutomationSetStatusAction"
          },
          {
            "$ref": "#/components/schemas/AutomationAddLabelAction"
          }
        ]
      },
      "AutomationReplaceTextAction": {
        "type": "object",
        "description": "Replaces every occurrence of `search` in the text with `replace`.",
        "properties": {
          "type": {
            "type": "string",
            "description": "Selects this shape of the body.",
            "enum": [
              "REPLACE_TEXT"
            ],
            "example": "REPLACE_TEXT"
          },
          "target": {
            "$ref": "#/components/schemas/AutomationTarget",
            "description": "The texts the action changes.",
            "example": {
              "selector": "TRIGGERING_TEXT",
              "language_codes": [],
              "conditions": []
            }
          },
          "search": {
            "type": "string",
            "description": "The plain text to search for, case-sensitively.",
            "example": "colour"
          },
          "replace": {
            "type": "string",
            "description": "The replacement; an empty string deletes the found text.",
            "example": "color"
          },
          "is_placeholder_excluded": {
            "type": "boolean",
            "description": "Whether placeholders in the text are left unchanged.",
            "example": true
          }
        },
        "required": [
          "is_placeholder_excluded",
          "replace",
          "search",
          "target",
          "type"
        ]
      },
      "AutomationTarget": {
        "type": "object",
        "description": "Which texts an action writes; separate from trigger scope.",
        "properties": {
          "selector": {
            "$ref": "#/components/schemas/AutomationTargetSelector",
            "description": "Act on the triggering text or matching target texts of its segment.",
            "example": "TRIGGERING_TEXT"
          },
          "language_codes": {
            "type": "array",
            "description": "Empty means every target language; relevant for SEGMENT_TARGET_TEXTS.",
            "example": [
              "de"
            ],
            "items": {
              "type": "string",
              "description": "Language code that uniquely identifies a locale. Valid examples would be 'en', 'en-GB', 'de', 'de-DE' etc. according to [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes)."
            }
          },
          "conditions": {
            "type": "array",
            "description": "Conditions checked per acted-on target text, separately from trigger conditions.",
            "example": [
              {
                "subject": "TEXT",
                "mode": "CONTAINS",
                "value": "draft"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/AutomationCondition"
            }
          }
        },
        "required": [
          "conditions",
          "language_codes",
          "selector"
        ]
      },
      "AutomationTargetSelector": {
        "type": "string",
        "description": "Which texts the action changes. `TRIGGERING_TEXT`: the text that started the rule. `SEGMENT_TARGET_TEXTS`: the segment's texts in the target languages, optionally limited by `language_codes` and `conditions`; only a status rule that reacts to the source text can use it.",
        "enum": [
          "TRIGGERING_TEXT",
          "SEGMENT_TARGET_TEXTS"
        ]
      },
      "AutomationSetStatusAction": {
        "type": "object",
        "description": "Sets the status of the texts.",
        "properties": {
          "type": {
            "type": "string",
            "description": "Selects this shape of the body.",
            "enum": [
              "SET_STATUS"
            ],
            "example": "SET_STATUS"
          },
          "target": {
            "$ref": "#/components/schemas/AutomationTarget",
            "description": "The texts the action changes.",
            "example": {
              "selector": "TRIGGERING_TEXT",
              "language_codes": [],
              "conditions": []
            }
          },
          "status": {
            "$ref": "#/components/schemas/TextStatus",
            "description": "The status to set.",
            "example": "APPROVED"
          }
        },
        "required": [
          "status",
          "target",
          "type"
        ]
      },
      "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"
        ]
      },
      "AutomationAddLabelAction": {
        "type": "object",
        "description": "Adds a label to the segment.",
        "properties": {
          "type": {
            "type": "string",
            "description": "Selects this shape of the body.",
            "enum": [
              "ADD_LABEL"
            ],
            "example": "ADD_LABEL"
          },
          "target": {
            "$ref": "#/components/schemas/AutomationTarget",
            "description": "The texts the action changes.",
            "example": {
              "selector": "TRIGGERING_TEXT",
              "language_codes": [],
              "conditions": []
            }
          },
          "label_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The label to add; null when the label no longer exists in the workspace.",
            "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}$"
          }
        },
        "required": [
          "label_id",
          "target",
          "type"
        ]
      },
      "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"
        ]
      }
    },
    "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"
            }
          }
        }
      },
      "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"
      }
    }
  }
}
````
