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

> ## Agent Instructions
> Weaverse component configuration uses `settings`. `inspector` is deprecated; never generate it.
> Weaverse Hydrogen themes use React Router v7: import from `react-router`, never `react-router-dom` or `@remix-run/*`.
> Define component schemas with `createSchema()` from `@weaverse/hydrogen` (React Router themes) or `@weaverse/next` (Next.js themes).
> These docs cover @weaverse/hydrogen, @weaverse/react and @weaverse/core 5.x, and @weaverse/next 1.x. Do not use APIs from other major versions.
> For live project data (pages, theme settings, translations), use the Weaverse MCP server: https://docs.weaverse.io/developer-tools/weaverse-mcp

# Manage languages, glossary and static text

> Runs one localization operation, selected by `op`. Language and static text changes are live project state (no draft or publish step) and refresh the storefront cache. Glossary entries are translation aids, not storefront content.

Operations:

- `add-language` (`content:write`): adds a language by `code` and `languageCode` (2-35 characters each; `code` is lowercased). Re-adding an existing language is a no-op and returns `language: null`; re-adding a deleted one revives it with its translations.
- `delete-language` (`content:delete`, `confirm` equal to `languageId`): deletes a language under the project lock and advances the project revision, so drafts captured against the old language set are fenced. A missing or foreign id returns `404` with nothing written.
- `static-save` (`content:write`): merges `translations` (flattened key to value, e.g. `cart.title`) into language `languageId`'s static text. An empty string removes that key's value. Returns the number of keys sent.
- `static-key-default` (`content:write`): sets the default value of static key `keyId` (max 20,000 characters).
- `static-key-delete` (`content:delete`, `confirm` equal to `keyId`): deletes a static key.
- `glossary-upsert` (`content:write`): creates an entry, or updates entry `id` when given. `sourceTerm` (1-200 characters) is required; optional `doNotTranslate`, `caseSensitive` (both default `false`) and `notes` (max 2,000).
- `glossary-delete` (`content:delete`, `confirm` equal to `entryId`): deletes a glossary entry.

`delete-language` returns `cacheDelivery: "degraded"` when the delete committed but the cache refresh failed. A wrong `confirm` value returns `400 INVALID_PARAMS`.

Required scope: `content:write` (all operations); `delete-language`, `static-key-delete` and `glossary-delete` also need `content:delete`



## OpenAPI

````yaml https://studio.weaverse.io/api/v1/content/openapi.json post /projects/{projectId}/localization
openapi: 3.1.0
info:
  title: Weaverse Content API
  version: 1.0.0
  description: >-
    Authenticated REST API for querying Weaverse-managed content (projects,
    pages, theme settings, languages) and for reading and writing per-locale
    translations.
servers:
  - url: https://studio.weaverse.io/api/v1/content
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Projects
    description: List, read, rename, create, copy and delete projects.
  - name: Pages
    description: List, read, create, update and delete the pages of a project.
  - name: Drafts and publishing
    description: >-
      Edit page drafts, then publish, schedule, restore and manage page
      versions.
  - name: Global sections
    description: Read, edit and publish sections shared across pages.
  - name: Page settings
    description: Read and edit page-level settings such as SEO metadata.
  - name: Assignments
    description: Map Shopify resources and routes to Weaverse pages and templates.
  - name: Theme settings
    description: Read and update a project's theme settings.
  - name: Languages and localization
    description: List project languages and manage locales, static text and glossary.
  - name: Translations
    description: >-
      Read and write per-locale translations, built for external translation
      agents.
  - name: Project structure
    description: Manage project variants and the project hierarchy.
  - name: Backups and portability
    description: Back up, restore, export and import project content.
  - name: Previews and hostnames
    description: Create preview links and manage the hostnames a project accepts.
  - name: Specification
    description: This OpenAPI document.
paths:
  /projects/{projectId}/localization:
    summary: Languages, glossary, static text
    description: >-
      GET ?kind=languages|glossary|static|static-keys&locale=. POST
      op=add-language/static-save are content:write;
      op=delete-language/glossary-delete are content:delete + confirm;
      glossary-upsert is content:write.
    parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
      - name: kind
        in: query
        schema:
          type: string
          enum:
            - languages
            - glossary
            - static
            - static-keys
      - name: locale
        in: query
        schema:
          type: string
    post:
      tags:
        - Languages and localization
      summary: Manage languages, glossary and static text
      description: >-
        Runs one localization operation, selected by `op`. Language and static
        text changes are live project state (no draft or publish step) and
        refresh the storefront cache. Glossary entries are translation aids, not
        storefront content.


        Operations:


        - `add-language` (`content:write`): adds a language by `code` and
        `languageCode` (2-35 characters each; `code` is lowercased). Re-adding
        an existing language is a no-op and returns `language: null`; re-adding
        a deleted one revives it with its translations.

        - `delete-language` (`content:delete`, `confirm` equal to `languageId`):
        deletes a language under the project lock and advances the project
        revision, so drafts captured against the old language set are fenced. A
        missing or foreign id returns `404` with nothing written.

        - `static-save` (`content:write`): merges `translations` (flattened key
        to value, e.g. `cart.title`) into language `languageId`'s static text.
        An empty string removes that key's value. Returns the number of keys
        sent.

        - `static-key-default` (`content:write`): sets the default value of
        static key `keyId` (max 20,000 characters).

        - `static-key-delete` (`content:delete`, `confirm` equal to `keyId`):
        deletes a static key.

        - `glossary-upsert` (`content:write`): creates an entry, or updates
        entry `id` when given. `sourceTerm` (1-200 characters) is required;
        optional `doNotTranslate`, `caseSensitive` (both default `false`) and
        `notes` (max 2,000).

        - `glossary-delete` (`content:delete`, `confirm` equal to `entryId`):
        deletes a glossary entry.


        `delete-language` returns `cacheDelivery: "degraded"` when the delete
        committed but the cache refresh failed. A wrong `confirm` value returns
        `400 INVALID_PARAMS`.


        Required scope: `content:write` (all operations); `delete-language`,
        `static-key-delete` and `glossary-delete` also need `content:delete`
      operationId: localizationOperation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LocalizationOperation'
            example:
              op: add-language
              code: de
              languageCode: de
            examples:
              add-language:
                summary: Add German
                value:
                  op: add-language
                  code: de
                  languageCode: de
              static-save:
                summary: Save static text for a language
                value:
                  op: static-save
                  languageId: clza1l2g30002lg01lang0002
                  translations:
                    cart.title: Panier
                    cart.empty: Votre panier est vide
              glossary-upsert:
                summary: Keep a brand name untranslated
                value:
                  op: glossary-upsert
                  sourceTerm: Weaverse
                  doNotTranslate: true
                  caseSensitive: true
                  notes: Brand name
              delete-language:
                summary: Delete a language
                value:
                  op: delete-language
                  languageId: clza1l2g30002lg01lang0002
                  confirm: clza1l2g30002lg01lang0002
      responses:
        '200':
          description: Operation result
          content:
            application/json:
              schema:
                type: object
              example:
                object: language_upserted
                language:
                  id: clza1l2g30003lg01lang0003
                  code: de
                  name: ''
                  languageCode: de
                  projectId: clz8p2k0q0001ab12cd34ef56
                  isDefault: false
                  baseLocale: null
                  staticTranslations: null
                  createdAt: '2026-10-15T11:40:02.000Z'
                  updatedAt: '2026-10-15T11:40:02.000Z'
        '401':
          description: Missing or invalid credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Foreign project or missing scope (INSUFFICIENT_SCOPE)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found (never discloses other tenants)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    LocalizationOperation:
      type: object
      required:
        - op
      oneOf:
        - type: object
          required:
            - op
            - code
            - languageCode
          properties:
            op:
              const: add-language
            code:
              type: string
            languageCode:
              type: string
        - type: object
          required:
            - op
            - languageId
            - confirm
          properties:
            op:
              const: delete-language
            languageId:
              type: string
            confirm:
              type: string
              description: Must equal the languageId
          description: >-
            Delete a language of this project (content:delete + confirm). Same
            project-authoritative protocol as Studio: recheck and delete under
            the project lock, advancing the project revision (fences drafts
            captured against the old language set). A missing or foreign id is
            404 with nothing written.
        - type: object
          required:
            - op
            - sourceTerm
          properties:
            op:
              const: glossary-upsert
            id:
              type: string
            sourceTerm:
              type: string
            doNotTranslate:
              type: boolean
            caseSensitive:
              type: boolean
            notes:
              type:
                - string
                - 'null'
        - type: object
          required:
            - op
            - entryId
            - confirm
          properties:
            op:
              const: glossary-delete
            entryId:
              type: string
            confirm:
              type: string
        - type: object
          required:
            - op
            - languageId
            - translations
          properties:
            op:
              const: static-save
            languageId:
              type: string
            translations:
              type: object
              additionalProperties:
                type: string
        - type: object
          required:
            - op
            - keyId
            - defaultValue
          properties:
            op:
              const: static-key-default
            keyId:
              type: string
            defaultValue:
              type: string
          description: Edit a static key default value (content:write).
        - type: object
          required:
            - op
            - keyId
            - confirm
          properties:
            op:
              const: static-key-delete
            keyId:
              type: string
            confirm:
              type: string
              description: Must equal keyId
          description: Delete a static key (content:delete + confirm).
    Error:
      type: object
      required:
        - object
        - code
        - message
        - status
      properties:
        object:
          type: string
          enum:
            - error
        code:
          type: string
          enum:
            - UNAUTHORIZED
            - FORBIDDEN
            - INSUFFICIENT_SCOPE
            - PROJECT_NOT_FOUND
            - PAGE_NOT_FOUND
            - STALE_PAGE
            - STALE_PROJECT
            - STALE_TRANSLATION
            - TRANSLATION_UNIT_NOT_FOUND
            - SERVICE_UNAVAILABLE
            - CONFLICT
            - PRECONDITION_REQUIRED
            - INVALID_PARAMS
            - INTERNAL_ERROR
        message:
          type: string
        status:
          type: integer
        details:
          description: >-
            Optional machine-readable context, for example the clashing handles
            of a 409 CONFLICT.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: WEAVERSE_API_KEY
      description: >-
        Bearer authentication: a shop API key (WEAVERSE_API_KEY), a scoped API
        key, a delegated MCP OAuth token, or (translation-unit routes only) a
        project-bound translation agent token. Scopes: content:read — Read
        projects, pages, theme settings, versions, drafts and translation units.
        content:write — Save drafts and make non-destructive edits (page items,
        metadata, SEO, assignments, languages, glossary). Never publishes or
        deletes. content:publish — Publish drafts, schedule/reschedule/cancel
        publications, restore versions, publish global sections. content:delete
        — Delete pages, global sections, languages, static keys, override
        reverts; required with project:manage for project deletion.
        project:manage — Create/copy/delete projects, settings, variants,
        hierarchy, backups, restore-as-new, previews, hostname policy.
        translations:read — Read translation units only (no general content
        access). translations:write — Apply translation units only; never
        mutates page content. A legacy unscoped API key keeps
        read/write/translation baseline access and every pre-scope endpoint, but
        never gains publish/delete/project-manage implicitly.

````

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