---
title: Unassign from an entity
slug: campaign/api/unassign-from-an-entity
docTags: 
createdAt: 2026-09-02T15:04:15.718Z
---

{
  "id": "VIPejm4bGTQrE3hV-C3_7",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.campaign.episerver.net/rest/{clientId}/folders/{folderId}/unassign",
    "servers": [
      {
        "url": "https://api.campaign.episerver.net/rest/{clientId}/folders/{folderId}/unassign"
      }
    ],
    "name": "Unassign from an entity",
    "description": "<p>Unassign a folder to an entity, such as mailing, message template, custom blacklist, image, recipient list or attachment.</p>",
    "contentType": "application/x-www-form-urlencoded",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "clientId",
          "type": "string",
          "description": "Client ID"
        },
        {
          "kind": "required",
          "name": "folderId",
          "type": "integer<int64>",
          "description": "Folder ID",
          "format": "int64"
        }
      ],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [
        {
          "name": "entityId",
          "kind": "required",
          "type": "integer<int64>",
          "description": "ID of the entity to be assigned or unassigned",
          "format": "int64"
        }
      ],
      "oAuthParameters": [
        {
          "id": "Authorization",
          "name": "Authorization",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "The entity was unassigned successfully.",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "400",
        "description": "The entity ID is required. Check for the ID of the entity and add it to the request.",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "The folder could not be found. Ensure that the required parameters such as \"folderId\" or \"entitiyId\" are correct and the folder exists. ",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "409",
        "description": "The folder could not be unassigned from the mailing entity because the entity is a campaign child. Ensure that the entity is not a child of a campaign.",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "z5je672s77cnI35MlNUSd",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.campaign.episerver.net/rest/{clientId}/folders/{folderId}/unassign \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/x-www-form-urlencoded' \\\n     --data 'entityId=integer<int64>'"
        },
        {
          "id": "DMk9aXxUNKKfyUTYpTXON",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/x-www-form-urlencoded\");\n\nvar urlencoded = new URLSearchParams();\nurlencoded.append(\"entityId\", \"integer<int64>\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: urlencoded,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.campaign.episerver.net/rest/{clientId}/folders/{folderId}/unassign\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "TFDshE4DXLeGSIZzrxlqU",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.campaign.episerver.net/rest/{clientId}/folders/{folderId}/unassign\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/x-www-form-urlencoded\"\nrequest.body = \"entityId=integer%3Cint64%3E\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "9mkHrDE4q-bFXjv7JuWen",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"https://api.campaign.episerver.net/rest/{clientId}/folders/{folderId}/unassign\"\n\npayload = 'entityId=integer%3Cint64%3E'\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/x-www-form-urlencoded'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "z5je672s77cnI35MlNUSd"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// The entity was unassigned successfully.\n"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// The entity ID is required. Check for the ID of the entity and add it to the request.\n"
        },
        {
          "id": "response-2-404",
          "language": "404",
          "code": "// The folder could not be found. Ensure that the required parameters such as \"folderId\" or \"entitiyId\" are correct and the folder exists.\n"
        },
        {
          "id": "response-3-409",
          "language": "409",
          "code": "// The folder could not be unassigned from the mailing entity because the entity is a campaign child. Ensure that the entity is not a child of a campaign.\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}