---
updatedAt: 2026-09-22T19:15:06.000Z
agentTools:
  projectIndex: https://docs.zesty.io/llms.txt
---

# Add Lang

This call will replicate all content items marked with the new language. The default language will be copied into the the new content items. For example, if english is your default language, and you add German (DE), a new item for each content item that exists will be created with a unique ZUID, the lang "DE", but the starting content will be copied from the english version.

List of all accepted codes can be found [here](https://zesty.org/getting-started/i18n-multi-language).

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "description": "A collection of available REST endpoints scoped to your unique instance.\n\n# ZUID\nAll named resources in this API have a unique identifier called a ZUID. For example an instance ZUID would look like `8-f48cf3a682-7fthvk`. The initial prefix, e.g. `8-`, represents the type of resource it is. Every discreet resource has it's own prefix. To find a full list of supported ZUIDs and to learn more read the spec; https://github.com/zesty-io/zuid-specification\n\n# URLs\nAs you peruse the available endpoints you will see the URLs which can be requested. The following is an explanation of the URL structure and the significance of specific portions.\n\nFor example the URL https://8-f48cf3a682-7fthvk.api.zesty.io/v1/content/models/6-556370-8sh47g/items/7-b939a4-457q19/publishings/18-660e14-jpx715 would breakdown as follows:\n\n| URL portion                       | description                                                           |\n| ---                               | ---                                                                   |\n| https://                          | protocol                                                              |\n| 8-f48cf3a682-7fthvk               | Your instances unique identifier                                      |\n| .api.zesty.io/                    | domain for the API                                                    |\n| v1                                | version of the API                                                    |\n| /content/models/6-556370-8sh47g   | path to a unique content model                                        |\n| /items/7-b939a4-457q19            | path to a unique item which belongs to the prior model                |\n| /publishings/18-660e14-jpx715     | path to a unique publishings record which belongs to the prior item   |\n\n# Getting an Auth Token\nThere are two types of authorization; session and access tokens. Read more about them here https://zesty.org/apis/auth-api#user-authentication",
    "title": "Instances API",
    "contact": {},
    "version": "1.0"
  },
  "paths": {
    "/env/langs": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "description": "This call will replicate all content items marked with the new language. The default language will be copied into the the new content items. For example, if english is your default language, and you add German (DE), a new item for each content item that exists will be created with a unique ZUID, the lang \"DE\", but the starting content will be copied from the english version.\n\nList of all accepted codes can be found [here](https://zesty.org/getting-started/i18n-multi-language).",
        "tags": [
          "/env/langs"
        ],
        "summary": "Add Lang",
        "operationId": "add-lang",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/body_samples.EnvLangsCreate"
              }
            }
          },
          "description": "Lang object to create",
          "required": true
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/body_samples.JSONResult"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/body_samples.EnvLangsResponseSuccess"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/body_samples.EnvLangsInvalidCode"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/body_samples.JSONResultUnauthorized"
                }
              }
            }
          }
        },
        "x-readme": {
          "explorer-enabled": false
        }
      }
    }
  },
  "tags": [
    {
      "description": "Any instance can have multi-lang support. Once multi-lang is activated languages can be added. When a language is added it does not become immediately available. A separate request must be made to activate the specific language. This allows for a workflow of adding a language, creating content for the language and activating the language to make it public.",
      "name": "/env/langs"
    }
  ],
  "servers": [
    {
      "url": "https://{instance_zuid}.api.zesty.io/v1",
      "variables": {
        "instance_zuid": {
          "default": "unknown"
        }
      }
    }
  ],
  "components": {
    "securitySchemes": {
      "Bearer": {
        "description": "Type \"Bearer\" followed by a space and JWT token.",
        "type": "apiKey",
        "name": "Authorization",
        "in": "header"
      }
    },
    "schemas": {
      "body_samples.EmptyData": {
        "type": "object"
      },
      "body_samples.EnvLangsCreate": {
        "type": "object",
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "description": "Language code. See link in the description for list of accepted lang codes.",
            "type": "string",
            "example": "en-ES"
          }
        }
      },
      "body_samples.EnvLangsInvalidCode": {
        "type": "object",
        "properties": {
          "_meta": {
            "$ref": "#/components/schemas/body_samples.Meta"
          },
          "data": {
            "$ref": "#/components/schemas/body_samples.EmptyData"
          },
          "error": {
            "type": "string",
            "example": "Bad Request: validation error: language code provided (lang-code-provided) is invalid"
          }
        }
      },
      "body_samples.EnvLangsResponseSuccess": {
        "type": "object",
        "properties": {
          "ID": {
            "type": "integer",
            "example": 1
          },
          "active": {
            "type": "boolean",
            "example": true
          },
          "code": {
            "type": "string",
            "example": "en-CA"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "example": "2021-06-29T20:00:00Z"
          },
          "default": {
            "type": "boolean",
            "example": true
          },
          "name": {
            "type": "string",
            "example": "English (Canada)"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "example": "2021-06-29T20:00:00Z"
          }
        }
      },
      "body_samples.JSONResult": {
        "type": "object",
        "properties": {
          "_meta": {
            "$ref": "#/components/schemas/body_samples.Meta"
          },
          "data": {}
        }
      },
      "body_samples.JSONResultUnauthorized": {
        "type": "object",
        "properties": {
          "_meta": {
            "$ref": "#/components/schemas/body_samples.Meta"
          },
          "data": {
            "$ref": "#/components/schemas/body_samples.EmptyData"
          },
          "error": {
            "type": "string",
            "example": "invalid session"
          }
        }
      },
      "body_samples.Meta": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "example": 1
          },
          "offset": {
            "type": "integer",
            "example": 0
          },
          "start": {
            "type": "integer",
            "example": 0
          },
          "timestamp": {
            "type": "string",
            "example": "2024-04-11T14:49:51.039478001Z"
          },
          "totalResults": {
            "type": "integer",
            "example": 1
          }
        }
      }
    }
  }
}
```