---
title: Delete source
slug: graph/api/delete-source
docTags: 
createdAt: 2026-08-28T18:28:55.472Z
---

{
  "id": "QIwNvnwqkI2Uy2o35wyC0",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "https://cg.optimizely.com/api/content/v3/sources",
    "servers": [
      {
        "url": "https://cg.optimizely.com/api/content/v3/sources"
      }
    ],
    "name": "Delete source",
    "description": "<p>Delete content <em>types / data</em> of the source</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "id",
          "type": "string",
          "description": "<p>The id of the source</p>\n<ul>\n<li><em>(empty): all sources</em></li>\n<li><em><strong>default</strong>: only default source</em></li>\n<li><em><strong>src1</strong>:  only src1</em></li>\n</ul>"
        },
        {
          "kind": "optional",
          "name": "mode",
          "type": "object",
          "description": "<p>Delete mode</p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<table><thead><tr><th>mode</th><th>description</th><th>types</th><th>data</th></tr></thead><tbody><tr><td><em>(empty)</em></td><td><em>delete types and data</em></td><td><em>(delete)</em></td><td><em>(delete)</em></td></tr><tr><td><em><strong>types</strong></em></td><td><em>delete only types</em></td><td><em>(delete)</em></td><td></td></tr><tr><td><em><strong>data</strong></em></td><td><em>delete only data</em></td><td></td><td><em>(delete)</em></td></tr><tr><td><em><strong>reset</strong></em></td><td><em>reset data</em></td><td><em>(delete)</em></td><td><em>(reset)</em></td></tr></tbody></table>",
          "customType": "DeleteMode",
          "schema": [],
          "modelRef": "#/components/schemas/DeleteMode"
        },
        {
          "kind": "optional",
          "name": "slot",
          "type": "object",
          "description": "<p>The slot of the source <em>(optional)</em></p>\n<ul>\n<li><em>(empty): old slot</em></li>\n<li><em><strong>new</strong>: new slot</em></li>\n</ul>",
          "customType": "Slot",
          "schema": [],
          "modelRef": "#/components/schemas/Slot"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "epi-hmac",
          "name": "Authorization",
          "kind": "optional",
          "type": "apiKey",
          "description": "<p>HMAC authentication (<code>epi-hmac xxx</code>)</p>",
          "in": "header"
        },
        {
          "id": "Bearer",
          "name": "Bearer",
          "kind": "optional",
          "type": "http",
          "description": "JWT token",
          "scheme": "bearer"
        },
        {
          "id": "Basic",
          "name": "Basic",
          "kind": "optional",
          "type": "http",
          "description": "HMAC credentials",
          "scheme": "basic"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Source is deleted successfully",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "Source is not found",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "6W7iuIqYbbXEUuT4KPoAn",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url 'https://cg.optimizely.com/api/content/v3/sources?mode=object&slot=object' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "GO8pozztUQNxlnu9Sjv_T",
          "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://cg.optimizely.com/api/content/v3/sources?mode=object&slot=object\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "iXq4AhEEzOmK-MEFclf_c",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://cg.optimizely.com/api/content/v3/sources?mode=object&slot=object\")\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": "NtfEH9uP0t48EUHm5MyJk",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://cg.optimizely.com/api/content/v3/sources?mode=object&slot=object\"\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": "6W7iuIqYbbXEUuT4KPoAn"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Source is deleted successfully\n"
        },
        {
          "id": "response-1-404",
          "language": "404",
          "code": "// Source is not found\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}