---
title: Delete application
slug: cms-saas/api/delete-application
docTags: 
createdAt: 2026-08-28T15:28:05.479Z
---

{
  "id": "U1kNgue0w2c_Iid__Amun",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "https://api.cms.optimizely.com/v1/applications/{key}",
    "servers": [
      {
        "url": "https://api.cms.optimizely.com/v1/applications/{key}",
        "description": "Optimizely CMS API"
      }
    ],
    "name": "Delete application",
    "description": "Deletes the application with the provided key.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "key",
          "type": "string",
          "description": "The key of the application to delete."
        }
      ],
      "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[]"
        },
        {
          "kind": "optional",
          "name": "If-Match",
          "type": "string",
          "description": "<p>If provided, the DELETE request will only be considered if the value matches the RFC7232 ETag of the current resource. Weak ETags will always be ignored.</p>"
        },
        {
          "kind": "optional",
          "name": "If-Unmodified-Since",
          "type": "string<http-date>",
          "description": "<p>If provided, the DELETE request will only be considered if the resource has not been modified since the provided date. This parameter will be ignored if an 'If-Match' parameter is also provided.</p>",
          "format": "http-date"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "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": "https://api.cms.optimizely.com/oauth/token",
              "scopes": {
                "api:admin": "Grants full administrative access to the API"
              }
            }
          },
          "requiredScopes": [
            "api:admin"
          ]
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true,
        "headers": [
          {
            "kind": "optional",
            "name": "Preference-Applied",
            "description": ""
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p>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": "string",
                "description": "The type of this application.",
                "example": "website",
                "examples": [
                  {
                    "value": "website"
                  },
                  {
                    "value": "inProcessWebsite"
                  }
                ],
                "maxLength": 50
              },
              {
                "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": "string",
                    "description": "The type of this host.",
                    "example": "default",
                    "examples": [
                      {
                        "value": "default"
                      },
                      {
                        "value": "primary"
                      },
                      {
                        "value": "preview"
                      },
                      {
                        "value": "redirectPermanent"
                      },
                      {
                        "value": "redirectTemporary"
                      },
                      {
                        "value": "edit"
                      },
                      {
                        "value": "media"
                      }
                    ],
                    "maxLength": 50
                  },
                  {
                    "name": "locale",
                    "kind": "optional",
                    "type": "string",
                    "description": "The locale associated with this host."
                  },
                  {
                    "name": "preferredUrlScheme",
                    "kind": "optional",
                    "type": "string",
                    "description": "The preferred URL scheme to be used when accessing this host. Will be used by the CMS when generating links to this host.",
                    "example": "http",
                    "examples": [
                      {
                        "value": "http"
                      },
                      {
                        "value": "https"
                      }
                    ],
                    "maxLength": 50
                  }
                ]
              },
              {
                "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": "204",
        "description": "No Content",
        "jsonExample": "",
        "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": "404",
        "description": "Not Found",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "412",
        "description": "Precondition Failed",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "429",
        "description": "Too Many Requests",
        "jsonExample": "",
        "isExpanded": true,
        "headers": [
          {
            "kind": "optional",
            "name": "Retry-After",
            "type": "number",
            "description": "Indicates how long the client should wait before making a new request."
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "ProblemDetails",
            "schema": [
              {
                "name": "type",
                "kind": "optional",
                "type": "string<uri>",
                "nullable": true,
                "description": "A URI reference that identifies the problem type.",
                "format": "uri"
              },
              {
                "name": "title",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "<p>A short, human-readable summary of the problem type.</p>"
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "integer<int32>",
                "nullable": true,
                "description": "The HTTP status code generated by the origin server for this occurrence of the problem.",
                "format": "int32",
                "minimum": 100,
                "maximum": 599
              },
              {
                "name": "detail",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "<p>A human-readable explanation specific to this occurrence of the problem.</p>"
              },
              {
                "name": "instance",
                "kind": "optional",
                "type": "string<uri>",
                "nullable": true,
                "description": "A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.",
                "format": "uri"
              },
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Error code that identifies the problem type."
              },
              {
                "name": "errors",
                "kind": "optional",
                "type": "array",
                "nullable": true,
                "description": "An array of error details with more detailed information about the problem.",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "detail",
                    "kind": "optional",
                    "type": "string",
                    "description": "<p>A granular explanation of one specific error related to a field, header or query parameter.</p>"
                  },
                  {
                    "name": "field",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "A string that may provide a hint to which field that was the source of the error.",
                    "example": "properties.header.displayName"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/ProblemDetails",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "500",
        "description": "Internal Server Error",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "YkAO8PieG695t0x-i2TXb",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url https://api.cms.optimizely.com/v1/applications/{key} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "SqCWMmj1_kWM5HTZyuoyw",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'DELETE',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.cms.optimizely.com/v1/applications/{key}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "bzL4RCa4A7gYq1q3nstwG",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.cms.optimizely.com/v1/applications/{key}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Delete.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "uM3lQ4AL8t-GQmL5r2ieI",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.cms.optimizely.com/v1/applications/{key}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "YkAO8PieG695t0x-i2TXb"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// OK\n{\n  \"key\": \"\",\n  \"displayName\": \"\",\n  \"type\": \"website\",\n  \"source\": \"\",\n  \"entryPoint\": \"\",\n  \"isDefault\": false,\n  \"useApplicationSpecificAssets\": false,\n  \"assetsRoot\": \"\",\n  \"hosts\": [\n    {\n      \"authority\": \"\",\n      \"type\": \"default\",\n      \"locale\": \"\",\n      \"preferredUrlScheme\": \"http\"\n    }\n  ],\n  \"usePreviewTokens\": false,\n  \"previewUrlFormats\": \"\",\n  \"created\": \"\",\n  \"createdBy\": \"\",\n  \"lastModified\": \"\",\n  \"lastModifiedBy\": \"\"\n}"
        },
        {
          "id": "response-1-204",
          "language": "204",
          "code": "// No Content\n"
        },
        {
          "id": "response-2-400",
          "language": "400",
          "code": "// Bad Request\n"
        },
        {
          "id": "response-3-401",
          "language": "401",
          "code": "// Unauthorized\n"
        },
        {
          "id": "response-4-403",
          "language": "403",
          "code": "// Forbidden\n"
        },
        {
          "id": "response-5-404",
          "language": "404",
          "code": "// Not Found\n"
        },
        {
          "id": "response-6-412",
          "language": "412",
          "code": "// Precondition Failed\n"
        },
        {
          "id": "response-7-429",
          "language": "429",
          "code": "// Too Many Requests\n{\n  \"type\": \"\",\n  \"title\": \"\",\n  \"status\": \"\",\n  \"detail\": \"\",\n  \"instance\": \"\",\n  \"code\": \"\",\n  \"errors\": [\n    {\n      \"detail\": \"\",\n      \"field\": \"properties.header.displayName\"\n    }\n  ]\n}"
        },
        {
          "id": "response-8-500",
          "language": "500",
          "code": "// Internal Server Error\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}