# Update a style guide

`PATCH https://api.lingohub.com/v2/style-guides/{styleGuideId}`

LingoHub API V2 (Beta) · [Style Guides](https://developers.lingohub.com/reference/v2/operations/tags/style-guides.md) · operation `updateStyleGuide`

Changes a style guide with JSON merge-patch: leaving out a field keeps it, and `null` clears `ai_context` or `audience_description`. In `rules`, a rule left out keeps its value and `null` resets it to `NOT_SPECIFIED`. Rules for single languages and language variants have their own endpoints. Sending only the current values changes nothing. Send the ETag from getStyleGuide as If-Match to make sure nobody changed it in between. Requires workspace-level style guides management permission.

## Parameters

| Parameter | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `styleGuideId` | path | yes | string | Unique identifier of the style guide. |
| `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/style-guides/sg_0197c8f2-5a6b-7cde-8f12-3456789abcde \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Workspace Style Guide",
  "ai_context": "Translate in a friendly and approachable tone suitable for a SaaS product.",
  "audience_description": "Software developers and technical users familiar with localization workflows."
}'
```

## Responses

- `200`: The style guide.
- `400`: 
- `401`: 
- `403`: 
- `404`: 
- `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": "Style Guides",
      "description": "Manage style guides: the tone, audience and language rules that guide AI translation."
    }
  ],
  "paths": {
    "/v2/style-guides/{styleGuideId}": {
      "patch": {
        "tags": [
          "Style Guides"
        ],
        "summary": "Update a style guide",
        "description": "Changes a style guide with JSON merge-patch: leaving out a field keeps it, and `null` clears `ai_context` or `audience_description`. In `rules`, a rule left out keeps its value and `null` resets it to `NOT_SPECIFIED`. Rules for single languages and language variants have their own endpoints. Sending only the current values changes nothing. Send the ETag from getStyleGuide as If-Match to make sure nobody changed it in between. Requires workspace-level style guides management permission.",
        "operationId": "updateStyleGuide",
        "parameters": [
          {
            "name": "styleGuideId",
            "in": "path",
            "description": "Unique identifier of the style guide.",
            "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 style guide, a valid value would be : sg_0197c8f2-5a6b-7cde-8f12-3456789abcde",
              "pattern": "^sg_[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": "sg_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/UpdateStyleGuide"
              }
            },
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateStyleGuide"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The style guide.",
            "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/StyleGuide"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "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": {
      "UpdateStyleGuide": {
        "type": "object",
        "additionalProperties": false,
        "description": "Request body to partially update a LingoHub style guide (PATCH, JSON merge-patch). Omitted fields are left unchanged. `name` and `rules` cannot be null; `ai_context` and `audience_description` may be set to null to clear them, and each rule inside `rules` may be set to null to reset it to `NOT_SPECIFIED`.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Display name of the style guide.",
            "example": "Workspace Style Guide",
            "maxLength": 128,
            "minLength": 2
          },
          "ai_context": {
            "type": [
              "string",
              "null"
            ],
            "description": "Additional context provided to the AI to guide translation style and tone.",
            "example": "Translate in a friendly and approachable tone suitable for a SaaS product.",
            "maxLength": 512
          },
          "audience_description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Description of the target audience for this style guide.",
            "example": "Software developers and technical users familiar with localization workflows.",
            "maxLength": 16384
          },
          "rules": {
            "$ref": "#/components/schemas/UpdateStyleGuideRules",
            "description": "Style rules to change (JSON merge-patch): omitted rules are left unchanged, a rule set to null is reset to NOT_SPECIFIED."
          }
        }
      },
      "UpdateStyleGuideRules": {
        "type": "object",
        "additionalProperties": false,
        "description": "Style rules to change (JSON merge-patch): omitted rules are left unchanged, a rule set to null is reset to NOT_SPECIFIED.",
        "properties": {
          "age_group": {
            "description": "Target age group for translation style and vocabulary choice.",
            "example": "ADULTS",
            "oneOf": [
              {
                "$ref": "#/components/schemas/StyleGuideAgeGroup"
              },
              {
                "type": "null"
              }
            ]
          },
          "audience": {
            "description": "Target audience for translation style and vocabulary choice.",
            "example": "DEVELOPERS",
            "oneOf": [
              {
                "$ref": "#/components/schemas/StyleGuideAudience"
              },
              {
                "type": "null"
              }
            ]
          },
          "literal_translation": {
            "description": "Specifies how literally the source text should be translated.",
            "example": "NEUTRAL",
            "oneOf": [
              {
                "$ref": "#/components/schemas/StyleGuideLiteralTranslation"
              },
              {
                "type": "null"
              }
            ]
          },
          "grammatical_person": {
            "description": "Grammatical person to use for translated text.",
            "example": "SECOND_PERSON_SINGULAR",
            "oneOf": [
              {
                "$ref": "#/components/schemas/StyleGuideGrammaticalPerson"
              },
              {
                "type": "null"
              }
            ]
          },
          "vocabulary_type": {
            "description": "Type of vocabulary to guide AI word choice.",
            "example": "TECHNICAL",
            "oneOf": [
              {
                "$ref": "#/components/schemas/StyleGuideVocabularyType"
              },
              {
                "type": "null"
              }
            ]
          },
          "formality": {
            "description": "Desired level of formality for translated text.",
            "example": "FORMAL",
            "oneOf": [
              {
                "$ref": "#/components/schemas/StyleGuideFormality"
              },
              {
                "type": "null"
              }
            ]
          },
          "domain": {
            "description": "Content domain to guide context-specific AI behavior.",
            "example": "TECHNOLOGY",
            "oneOf": [
              {
                "$ref": "#/components/schemas/StyleGuideDomain"
              },
              {
                "type": "null"
              }
            ]
          },
          "text_type": {
            "description": "Type of text being translated.",
            "example": "SOFTWARE_UI",
            "oneOf": [
              {
                "$ref": "#/components/schemas/StyleGuideTextType"
              },
              {
                "type": "null"
              }
            ]
          },
          "voice": {
            "description": "Preferred grammatical voice for translated text.",
            "example": "ACTIVE",
            "oneOf": [
              {
                "$ref": "#/components/schemas/StyleGuideVoice"
              },
              {
                "type": "null"
              }
            ]
          },
          "language_complexity": {
            "description": "Desired level of language complexity for generated text.",
            "example": "STANDARD",
            "oneOf": [
              {
                "$ref": "#/components/schemas/StyleGuideLanguageComplexity"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "StyleGuideAgeGroup": {
        "type": "string",
        "description": "Defines the target age group for content, allowing tone and vocabulary to be adjusted accordingly.",
        "enum": [
          "NOT_SPECIFIED",
          "CHILDREN",
          "TEENAGERS",
          "YOUNG_ADULTS",
          "ADULTS",
          "SENIORS"
        ]
      },
      "StyleGuideAudience": {
        "type": "string",
        "description": "Defines the target audience for a piece of communication, which helps tailor the tone, vocabulary, and language complexity.",
        "enum": [
          "NOT_SPECIFIED",
          "GENERAL_PUBLIC",
          "CUSTOMERS",
          "BUSINESS",
          "PARTNERS",
          "EXPERTS",
          "DEVELOPERS",
          "MARKETING",
          "INTERNAL_EMPLOYEES"
        ]
      },
      "StyleGuideLiteralTranslation": {
        "type": "string",
        "description": "Defines the preferred translation approach, ranging from literal word-for-word to cultural or conversational adaptation.",
        "enum": [
          "NOT_SPECIFIED",
          "CULTURAL_OR_CONVERSATIONAL",
          "LITERAL",
          "NEUTRAL"
        ]
      },
      "StyleGuideGrammaticalPerson": {
        "type": "string",
        "description": "Defines the grammatical person to be used when addressing or referring to the reader in generated text.",
        "enum": [
          "NOT_SPECIFIED",
          "FIRST_PERSON_SINGULAR",
          "SECOND_PERSON_SINGULAR",
          "THIRD_PERSON_SINGULAR_MASCULINE",
          "THIRD_PERSON_SINGULAR_FEMININE",
          "THIRD_PERSON_SINGULAR_NEUTRAL",
          "FIRST_PERSON_PLURAL",
          "SECOND_PERSON_PLURAL",
          "THIRD_PERSON_PLURAL"
        ]
      },
      "StyleGuideVocabularyType": {
        "type": "string",
        "description": "Represents different types of vocabulary to guide word choice in text generation.",
        "enum": [
          "NOT_SPECIFIED",
          "POPULAR",
          "TECHNICAL",
          "FICTIONAL",
          "FORMAL",
          "SLANG"
        ]
      },
      "StyleGuideFormality": {
        "type": "string",
        "description": "Defines the desired level of formality in language, ranging from formal to informal.",
        "enum": [
          "NOT_SPECIFIED",
          "FORMAL",
          "INFORMAL"
        ]
      },
      "StyleGuideDomain": {
        "type": "string",
        "description": "Represents various content domains to help guide context-specific AI behavior.",
        "enum": [
          "NOT_SPECIFIED",
          "AGRICULTURE",
          "AEROSPACE",
          "ANIMALS",
          "ARTS",
          "AUTOMOTIVE",
          "TECHNOLOGY",
          "REAL_ESTATE",
          "CONSUMER_GOODS",
          "EDUCATION",
          "ENTERTAINMENT",
          "ECOLOGY",
          "HEALTH",
          "PHARMACEUTICAL",
          "GOVERNMENT",
          "MEDIA",
          "RELIGION",
          "FOOD",
          "RETAIL",
          "FASHION",
          "TRAVEL",
          "ENERGY",
          "FINANCIAL",
          "LEGAL",
          "RAW_MATERIALS",
          "LIFESTYLE",
          "SPORTS",
          "HOME",
          "ECONOMY",
          "SCIENCE",
          "HUMAN_RESOURCES",
          "ADULT"
        ]
      },
      "StyleGuideTextType": {
        "type": "string",
        "description": "Defines the specific type of text being processed, which helps in applying the correct style, tone, and formatting rules.",
        "enum": [
          "NOT_SPECIFIED",
          "TECHNICAL_DOCUMENTATION",
          "SOFTWARE_UI",
          "MOBILE_UI",
          "MARKETING_TEXT",
          "SYSTEM_MESSAGE",
          "EMAIL_CONTENT",
          "WEBSITE_CONTENT",
          "CONVERSATIONAL_CONTENT",
          "SURVEY_AND_FEEDBACK_TEXT",
          "SOCIAL_MEDIA_CONTENT",
          "MULTIMEDIA_TEXT",
          "SEO_CONTENT"
        ]
      },
      "StyleGuideVoice": {
        "type": "string",
        "description": "Specifies a preference for using either active or passive voice in writing.",
        "enum": [
          "NOT_SPECIFIED",
          "ACTIVE",
          "PASSIVE",
          "FLEXIBLE"
        ]
      },
      "StyleGuideLanguageComplexity": {
        "type": "string",
        "description": "Defines the desired level of language complexity and simplicity for generated text.",
        "enum": [
          "NOT_SPECIFIED",
          "STANDARD",
          "PLAIN_LANGUAGE",
          "VERY_SIMPLE"
        ]
      },
      "StyleGuide": {
        "type": "object",
        "description": "A style guide: the rules LINA follows when translating and the style checks use. General rules apply to every language; single languages can have rules of their own and a regional variant.",
        "properties": {
          "object_type": {
            "type": "string",
            "description": "Always `STYLE_GUIDE`.",
            "enum": [
              "STYLE_GUIDE"
            ],
            "example": "STYLE_GUIDE"
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the style guide.",
            "example": "sg_0197c8f2-5a6b-7cde-8f12-3456789abcde",
            "minLength": 1,
            "pattern": "^sg_[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": {
            "type": "string",
            "description": "Name of the style guide; it doesn't have to be unique.",
            "example": "Workspace Style Guide",
            "maxLength": 128,
            "minLength": 0
          },
          "ai_context": {
            "type": [
              "string",
              "null"
            ],
            "description": "Additional instructions LINA gets with the style guide, e.g. about tone.",
            "example": "Translate in a friendly and approachable tone suitable for a SaaS product.",
            "maxLength": 512,
            "minLength": 0
          },
          "audience_description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who the texts are written for, in your own words.",
            "example": "Software developers and technical users familiar with localization workflows.",
            "maxLength": 16384,
            "minLength": 0
          },
          "rules": {
            "$ref": "#/components/schemas/StyleGuideRules",
            "description": "The general rules, for every language."
          },
          "rule_language_codes": {
            "type": "array",
            "description": "Languages with rules of their own, sorted; read them with getStyleGuideLanguageRules.",
            "example": [
              "de",
              "ja"
            ],
            "items": {
              "type": "string",
              "example": "de"
            }
          },
          "language_variants": {
            "type": "array",
            "description": "Regional variants set for general languages, sorted by language; read one with getStyleGuideLanguageVariant.",
            "example": [
              {
                "language_code": "de",
                "variant_language_code": "de-AT"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/LanguageVariant"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the style guide was created.",
            "example": "2025-01-15T10:30:00.123Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the style guide was last updated.",
            "example": "2025-06-20T14:45:00.123Z"
          }
        },
        "required": [
          "ai_context",
          "audience_description",
          "created_at",
          "id",
          "language_variants",
          "name",
          "object_type",
          "rule_language_codes",
          "rules",
          "updated_at"
        ]
      },
      "StyleGuideRules": {
        "type": "object",
        "description": "The global translation rules defined for a style guide.",
        "properties": {
          "age_group": {
            "$ref": "#/components/schemas/StyleGuideAgeGroup",
            "description": "Target age group for translation style and vocabulary choice.",
            "example": "ADULTS"
          },
          "audience": {
            "$ref": "#/components/schemas/StyleGuideAudience",
            "description": "Target audience for translation style and vocabulary choice.",
            "example": "DEVELOPERS"
          },
          "literal_translation": {
            "$ref": "#/components/schemas/StyleGuideLiteralTranslation",
            "description": "Specifies how literally the source text should be translated.",
            "example": "NEUTRAL"
          },
          "grammatical_person": {
            "$ref": "#/components/schemas/StyleGuideGrammaticalPerson",
            "description": "Grammatical person to use for translated text.",
            "example": "SECOND_PERSON_SINGULAR"
          },
          "vocabulary_type": {
            "$ref": "#/components/schemas/StyleGuideVocabularyType",
            "description": "Type of vocabulary to guide AI word choice.",
            "example": "TECHNICAL"
          },
          "formality": {
            "$ref": "#/components/schemas/StyleGuideFormality",
            "description": "Desired level of formality for translated text.",
            "example": "FORMAL"
          },
          "domain": {
            "$ref": "#/components/schemas/StyleGuideDomain",
            "description": "Content domain to guide context-specific AI behavior.",
            "example": "TECHNOLOGY"
          },
          "text_type": {
            "$ref": "#/components/schemas/StyleGuideTextType",
            "description": "Type of text being translated.",
            "example": "SOFTWARE_UI"
          },
          "voice": {
            "$ref": "#/components/schemas/StyleGuideVoice",
            "description": "Preferred grammatical voice for translated text.",
            "example": "ACTIVE"
          },
          "language_complexity": {
            "$ref": "#/components/schemas/StyleGuideLanguageComplexity",
            "description": "Desired level of language complexity for generated text.",
            "example": "STANDARD"
          }
        },
        "required": [
          "age_group",
          "audience",
          "domain",
          "formality",
          "grammatical_person",
          "language_complexity",
          "literal_translation",
          "text_type",
          "vocabulary_type",
          "voice"
        ]
      },
      "LanguageVariant": {
        "type": "object",
        "description": "The regional variant a style guide sets for a general language.",
        "properties": {
          "language_code": {
            "type": "string",
            "description": "General language the variant is set for.",
            "example": "de"
          },
          "variant_language_code": {
            "type": "string",
            "description": "Regional variant that texts in the general language are written in.",
            "example": "de-AT"
          }
        },
        "required": [
          "language_code",
          "variant_language_code"
        ]
      },
      "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"
      }
    }
  }
}
````
