---
title: Creates a new language branch definition.
slug: cms-12/api/creates-a-new-language-branch-definition
docTags: 
createdAt: 2026-08-28T13:16:06.833Z
---

{
  "id": "2xDXBO_oPA4XHy9bD1RVA",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "/api/episerver/v3.0/languagebranches",
    "servers": [],
    "name": "Creates a new language branch definition.",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json",
            "application/problem+json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "The language that should be created.",
          "customType": "languageBranch",
          "schema": [
            {
              "name": "name",
              "kind": "required",
              "type": "string",
              "description": "The name of the language."
            },
            {
              "name": "displayName",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "The display name of the language branch.",
              "maxLength": 255
            },
            {
              "name": "urlSegment",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "<p>The URL segment used during routing that is tied to the language branch. If not set, name is used.</p>",
              "maxLength": 255
            },
            {
              "name": "sortOrder",
              "kind": "optional",
              "type": "integer<int32>",
              "description": "The sort order relative to other branches when listing branches.",
              "format": "int32"
            },
            {
              "name": "enabled",
              "kind": "optional",
              "type": "boolean",
              "description": "Indicates if the language branch is enabled."
            }
          ],
          "modelRef": "#/components/schemas/languageBranch",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "201",
        "description": "Success",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "Defines a language branch definition.",
            "customType": "languageBranch",
            "schema": [
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "The name of the language."
              },
              {
                "name": "displayName",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "The display name of the language branch.",
                "maxLength": 255
              },
              {
                "name": "urlSegment",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "<p>The URL segment used during routing that is tied to the language branch. If not set, name is used.</p>",
                "maxLength": 255
              },
              {
                "name": "sortOrder",
                "kind": "optional",
                "type": "integer<int32>",
                "description": "The sort order relative to other branches when listing branches.",
                "format": "int32"
              },
              {
                "name": "enabled",
                "kind": "optional",
                "type": "boolean",
                "description": "Indicates if the language branch is enabled."
              }
            ],
            "modelRef": "#/components/schemas/languageBranch",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Bad Request",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "403",
        "description": "Forbidden",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "409",
        "description": "Conflict",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "n9y4w50p9CHGcTLM2gwRu",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url /api/episerver/v3.0/languagebranches \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"name\": \"\"\n     }'"
        },
        {
          "id": "gTijRxwV0PVj57jDcYDZ0",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"name\": \"\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"/api/episerver/v3.0/languagebranches\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "W6dtcM8tzaE7Mdb1IK_ha",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"/api/episerver/v3.0/languagebranches\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"name\": \"\"\n})\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "JC4pJDtfnWDO307eW4lJu",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"/api/episerver/v3.0/languagebranches\"\n\npayload = json.dumps({\n   \"name\": \"\"\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "n9y4w50p9CHGcTLM2gwRu"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-201",
          "language": "201",
          "code": "// Success\n{\n  \"name\": \"\",\n  \"displayName\": \"\",\n  \"urlSegment\": \"\",\n  \"sortOrder\": \"\",\n  \"enabled\": false\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Bad Request\n"
        },
        {
          "id": "response-2-403",
          "language": "403",
          "code": "// Forbidden\n"
        },
        {
          "id": "response-3-409",
          "language": "409",
          "code": "// Conflict\n"
        }
      ],
      "selectedLanguageId": "response-0-201"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}