---
title: Create application
slug: cms-13/api/create-application
docTags: 
createdAt: 2026-08-28T15:24:16.532Z
---

{
  "id": "s3aTNTaZajkFI1XA4ZTsA",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "/_cms/v1/applications",
    "servers": [
      {
        "url": "/_cms/v1/applications",
        "description": "Optimizely CMS API"
      }
    ],
    "name": "Create application",
    "description": "Create a new application.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "optional",
          "name": "Prefer",
          "type": "array",
          "example": "[\"return=representation\"]",
          "description": "<p>Indicates client preference for the response content as per IETF RFC7240. Currently only supports 'return=representation' which can be used to indicate a preference to receive a representation of the resource that has been altered in the response.</p>",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "The application that should be created.",
          "customType": "Application",
          "schema": [
            {
              "name": "key",
              "kind": "optional",
              "type": "string",
              "description": "<p>The unique identifier (key) of the resource.</p>",
              "minLength": 2,
              "maxLength": 255,
              "pattern": "^[A-Za-z][_0-9A-Za-z]+$"
            },
            {
              "name": "displayName",
              "kind": "required",
              "type": "string",
              "description": "The display name of this Application.",
              "minLength": 1,
              "maxLength": 255
            },
            {
              "name": "type",
              "kind": "required",
              "type": "object",
              "description": "Represents the type of an Application.",
              "modelRef": "#/components/schemas/ApplicationType",
              "customType": "ApplicationType",
              "schema": []
            },
            {
              "name": "entryPoint",
              "kind": "required",
              "type": "string<uri>",
              "description": "<p>A reference to the entry point (start page) content for this application.</p>",
              "format": "uri"
            },
            {
              "name": "isDefault",
              "kind": "optional",
              "type": "boolean",
              "description": "Whether this is the default application."
            },
            {
              "name": "useApplicationSpecificAssets",
              "kind": "optional",
              "type": "boolean",
              "description": "Whether this application uses a dedicated assets folder."
            },
            {
              "name": "hosts",
              "kind": "optional",
              "type": "array",
              "description": "The hosts assigned to this application.",
              "modelRef": "#/components/schemas/ApplicationHost",
              "customType": "ApplicationHost[]",
              "schema": [
                {
                  "name": "authority",
                  "kind": "required",
                  "type": "string",
                  "description": "The DNS host name or IP address and optional port of this host.",
                  "minLength": 1,
                  "maxLength": 255
                },
                {
                  "name": "type",
                  "kind": "optional",
                  "type": "object",
                  "description": "Represents the type of an ApplicationHost.",
                  "modelRef": "#/components/schemas/ApplicationHostType",
                  "customType": "ApplicationHostType",
                  "schema": []
                },
                {
                  "name": "locale",
                  "kind": "optional",
                  "type": "string",
                  "description": "The locale associated with this host."
                },
                {
                  "name": "preferredUrlScheme",
                  "kind": "optional",
                  "type": "object",
                  "description": "Specifies the preferred URL scheme to be used when accessing a host.",
                  "modelRef": "#/components/schemas/UrlScheme",
                  "customType": "UrlScheme",
                  "schema": []
                }
              ]
            },
            {
              "name": "usePreviewTokens",
              "kind": "optional",
              "type": "boolean",
              "description": "Whether to use preview tokens for this application. Only applicable when the type is 'website'."
            },
            {
              "name": "previewUrlFormats",
              "kind": "optional",
              "type": "map",
              "description": "A dictionary of preview URL formats keyed by content type base or content type key. Only applicable when the type is 'website'.",
              "example": "",
              "customType": "map<string, string>",
              "schema": []
            }
          ],
          "modelRef": "#/components/schemas/Application",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiAuth",
          "name": "apiAuth",
          "kind": "optional",
          "type": "oauth2",
          "description": "Use this scheme to generate an access token that can be used to access the API.",
          "oauth2Flows": {
            "clientCredentials": {
              "tokenUrl": "/_cms/v1/oauth/token",
              "scopes": {
                "api:admin": "Grants full administrative access to the API"
              }
            }
          },
          "requiredScopes": [
            "api:admin"
          ]
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "201",
        "description": "Created",
        "jsonExample": "",
        "isExpanded": true,
        "headers": [
          {
            "kind": "optional",
            "name": "ETag",
            "type": "string",
            "description": "<p>The RFC7232 ETag header field in a response provides the current entity-tag for the resource. An entity-tag is an opaque identifier for different versions of a resource over time, regardless whether multiple versions are valid at the same time.</p>"
          },
          {
            "kind": "optional",
            "name": "Last-Modified",
            "type": "string<http-date>",
            "description": "The date and time at which the resource was last modified.",
            "format": "http-date"
          },
          {
            "kind": "optional",
            "name": "Location",
            "type": "string",
            "description": "<p>Indicates the URL of the newly-created resource.</p>"
          },
          {
            "kind": "optional",
            "name": "Preference-Applied",
            "description": ""
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p>Represents a CMS application (website or remote website).</p>",
            "customType": "Application",
            "schema": [
              {
                "name": "key",
                "kind": "optional",
                "type": "string",
                "description": "<p>The unique identifier (key) of the resource.</p>",
                "minLength": 2,
                "maxLength": 255,
                "pattern": "^[A-Za-z][_0-9A-Za-z]+$"
              },
              {
                "name": "displayName",
                "kind": "required",
                "type": "string",
                "description": "The display name of this Application.",
                "minLength": 1,
                "maxLength": 255
              },
              {
                "name": "type",
                "kind": "required",
                "type": "object",
                "description": "Represents the type of an Application.",
                "modelRef": "#/components/schemas/ApplicationType",
                "customType": "ApplicationType",
                "schema": []
              },
              {
                "name": "source",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "A string that is used to indicate the source of this Application."
              },
              {
                "name": "entryPoint",
                "kind": "required",
                "type": "string<uri>",
                "description": "<p>A reference to the entry point (start page) content for this application.</p>",
                "format": "uri"
              },
              {
                "name": "isDefault",
                "kind": "optional",
                "type": "boolean",
                "description": "Whether this is the default application."
              },
              {
                "name": "useApplicationSpecificAssets",
                "kind": "optional",
                "type": "boolean",
                "description": "Whether this application uses a dedicated assets folder."
              },
              {
                "name": "assetsRoot",
                "kind": "optional",
                "type": "string<uri>",
                "readOnly": true,
                "nullable": true,
                "description": "<p>Returns the root for application-specific assets, if UseApplicationSpecificAssets is true.</p>",
                "format": "uri"
              },
              {
                "name": "hosts",
                "kind": "optional",
                "type": "array",
                "description": "The hosts assigned to this application.",
                "modelRef": "#/components/schemas/ApplicationHost",
                "customType": "ApplicationHost[]",
                "schema": [
                  {
                    "name": "authority",
                    "kind": "required",
                    "type": "string",
                    "description": "The DNS host name or IP address and optional port of this host.",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  {
                    "name": "type",
                    "kind": "optional",
                    "type": "object",
                    "description": "Represents the type of an ApplicationHost.",
                    "modelRef": "#/components/schemas/ApplicationHostType",
                    "customType": "ApplicationHostType",
                    "schema": []
                  },
                  {
                    "name": "locale",
                    "kind": "optional",
                    "type": "string",
                    "description": "The locale associated with this host."
                  },
                  {
                    "name": "preferredUrlScheme",
                    "kind": "optional",
                    "type": "object",
                    "description": "Specifies the preferred URL scheme to be used when accessing a host.",
                    "modelRef": "#/components/schemas/UrlScheme",
                    "customType": "UrlScheme",
                    "schema": []
                  }
                ]
              },
              {
                "name": "usePreviewTokens",
                "kind": "optional",
                "type": "boolean",
                "description": "Whether to use preview tokens for this application. Only applicable when the type is 'website'."
              },
              {
                "name": "previewUrlFormats",
                "kind": "optional",
                "type": "map",
                "description": "A dictionary of preview URL formats keyed by content type base or content type key. Only applicable when the type is 'website'.",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              },
              {
                "name": "created",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "A timestamp indicating when this resource was first created.",
                "format": "date-time"
              },
              {
                "name": "createdBy",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "The name of the user or application that created this resource."
              },
              {
                "name": "lastModified",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "Indicates the last time this resource was modified.",
                "format": "date-time"
              },
              {
                "name": "lastModifiedBy",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "The name of the user or application that last modified this resource."
              }
            ],
            "modelRef": "#/components/schemas/Application",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Bad Request",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "401",
        "description": "Unauthorized",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "403",
        "description": "Forbidden",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "409",
        "description": "Conflict",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "500",
        "description": "Internal Server Error",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "sjgbkfwytNSn_9Jm4Vwyz",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url /_cms/v1/applications \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"displayName\": \"\",\n     \"type\": \"\",\n     \"entryPoint\": \"\",\n     \"hosts\": [\n     {\n     \"authority\": \"\"\n     }\n     ]\n     }'"
        },
        {
          "id": "Be0Z6JyM6qxaxvPkkw2Qj",
          "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   \"displayName\": \"\",\n   \"type\": \"\",\n   \"entryPoint\": \"\",\n   \"hosts\": [\n      {\n         \"authority\": \"\"\n      }\n   ]\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"/_cms/v1/applications\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "nJRcEiZ2lxMaQLuAHZqb5",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"/_cms/v1/applications\")\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   \"displayName\": \"\",\n   \"type\": \"\",\n   \"entryPoint\": \"\",\n   \"hosts\": [\n      {\n         \"authority\": \"\"\n      }\n   ]\n})\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "9K0xykM9QPoXmsBAAO6xW",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"/_cms/v1/applications\"\n\npayload = json.dumps({\n   \"displayName\": \"\",\n   \"type\": \"\",\n   \"entryPoint\": \"\",\n   \"hosts\": [\n      {\n         \"authority\": \"\"\n      }\n   ]\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": "sjgbkfwytNSn_9Jm4Vwyz"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-201",
          "language": "201",
          "code": "// Created\n{\n  \"key\": \"\",\n  \"displayName\": \"\",\n  \"type\": {},\n  \"source\": \"\",\n  \"entryPoint\": \"\",\n  \"isDefault\": false,\n  \"useApplicationSpecificAssets\": false,\n  \"assetsRoot\": \"\",\n  \"hosts\": [\n    {\n      \"authority\": \"\",\n      \"type\": {},\n      \"locale\": \"\",\n      \"preferredUrlScheme\": {}\n    }\n  ],\n  \"usePreviewTokens\": false,\n  \"previewUrlFormats\": \"\",\n  \"created\": \"\",\n  \"createdBy\": \"\",\n  \"lastModified\": \"\",\n  \"lastModifiedBy\": \"\"\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Bad Request\n"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Unauthorized\n"
        },
        {
          "id": "response-3-403",
          "language": "403",
          "code": "// Forbidden\n"
        },
        {
          "id": "response-4-409",
          "language": "409",
          "code": "// Conflict\n"
        },
        {
          "id": "response-5-500",
          "language": "500",
          "code": "// Internal Server Error\n"
        }
      ],
      "selectedLanguageId": "response-0-201"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}