---
schema_version: "1"
id: b7e61041c791758a722fb432d71330db96573df0b003a982f014675c3c4bffba
title: Campaigns
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/references/generated-api-specs/mc_rest_campaigns.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/references/mc_rest_campaigns
source_site: developer.salesforce.com
content_type: documentation
content_hash: 8e6ccc02fea2b840c1fd562acaea3dca9a79f044c3cf11c4cba22f3ba706295e
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
Campaigns

# Campaigns

Retrieve, create, update, and delete campaigns and campaign assets.

This table lists the use cases that the Campaign API supports.

| Supported Use Case | HTTP Verb | URI |
| --- | --- | --- |
| Get campaigns | [GET](/docs/marketing/marketing-cloud/references/mc_rest_campaigns?meta=getCampaigns) | /v1/campaigns/ |
| Create a campaign | [POST](/docs/marketing/marketing-cloud/references/mc_rest_campaigns?meta=createCampaign) | /v1/campaigns/ |
| Get a campaign | [GET](/docs/marketing/marketing-cloud/references/mc_rest_campaigns?meta=getCampaign) | /v1/campaigns/{id} |
| Update a campaign | [PATCH](/docs/marketing/marketing-cloud/references/mc_rest_campaigns?meta=updateCampaign) | /v1/campaigns/{id} |
| Delete a campaign | [DELETE](/docs/marketing/marketing-cloud/references/mc_rest_campaigns?meta=deleteCampaign) | /v1/campaigns/{id} |
| Get campaign assets | [GET](/docs/marketing/marketing-cloud/references/mc_rest_campaigns?meta=getCampaignAssets) | /v1/campaigns/{id}/assets |
| Add an asset to a campaign | [POST](/docs/marketing/marketing-cloud/references/mc_rest_campaigns?meta=addAssetToCampaign) | /v1/campaigns/{id}/assets |
| Get a campaign asset | [GET](/docs/marketing/marketing-cloud/references/mc_rest_campaigns?meta=getCampaignAsset) | /v1/campaigns/{id}/assets/{assetId} |
| Remove an asset from a campaign | [DELETE](/docs/marketing/marketing-cloud/references/mc_rest_campaigns?meta=removeAssetFromCampaign) | /v1/campaigns/{id}/assets/{assetId} |

**Version:** 1

## Servers

*   `https://{subdomain}.rest.marketingcloudapis.com`
    *   `subdomain (default N/A) The unique API subdomain for your Marketing Cloud Engagement tenant. You can find this value in the Installed Packages section of Marketing Cloud Engagement Setup.`

## Operations

### GET Retrieve a list of campaigns in your account.

`GET /hub/v1/campaigns/`

Operation ID: `getCampaigns`.

Required permission scope: Campaign > Read

#### Parameters

*   `Authorization` (header, string, required) A unique, time-limited token that you can use to issue requests to REST API. Replace `YOUR_ACCESS_TOKEN` with your authentication token.
    
    _Example_
    
    ```
    Bearer YOUR_ACCESS_TOKEN
    ```
    
*   `$page` (query, string) The page of results to retrieve. Each page includes the number of records specified by the `$pageSize` parameter. You can retrieve additional pages by incrementing this number in subsequent calls.
*   `$pageSize` (query, number) The number of records to return on each page of results. The default value is 25.
*   `$orderBy` (query, string) The field and sort method to use to sort the results. You can sort on these fields: `modifiedDate`, `createdDate`, `name`, and `id`. You can sort these fields in ascending (`ASC`) or descending (`DESC`) order. The default value is 'modifiedDate DESC'.

#### Responses

*   **200** Indicates that the request to retrieve campaigns was successful.
    
    Media type: `application/json`. Schema: `campaignsGetResponseBody`.
    
    _Example_
    
    ```
    {
      "count": 1,
      "page": 1,
      "pageSize": 50,
      "links": {
        "self": {
          "href": "/v1/campaigns"
        }
      },
      "items": [
        {
          "createdDate": "2023-08-05T11:18:43",
          "modifiedDate": "2023-08-05T11:18:43",
          "id": "1",
          "name": "Final Hours for Summer Sale",
          "description": "Invite our most engaged customers to shop our Summer Sale before it ends.",
          "campaignCode": "summer2023",
          "color": "800080",
          "favorite": false
        }
      ]
    }
    ```
    
*   **400** Indicates that the request contained information that the API couldn’t process. If you receive a 400 response, verify that the request uses the correct syntax.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "message": "JSON Deserialization Exception: Location Unknown",
      "errorcode": 10004,
      "documentation": ""
    }
    ```
    
*   **401** Indicates that the API wasn’t able to authorize your request. If you receive a 401 response, verify that you obtained an authorization token and that the token is still valid.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm",
      "errorcode": 0,
      "message": "Not Authorized"
    }
    ```
    
*   **403** This response indicates that the API accepted your request but couldn’t authorize it. If you receive a 403 response, make sure that you have the necessary permission scope for the operation. You can modify permission scopes on the Installed Apps page in Marketing Cloud Engagement Setup.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "",
      "errorcode": 20002,
      "message": "Insufficient privileges to complete this action."
    }
    ```
    
*   **500** Indicates that the API encountered an error when processing the request. If you receive a 500 response, verify that the request uses the correct syntax.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm",
      "errorcode": 0,
      "message": "Internal Server Error"
    }
    ```
    

### POST Create a campaign.

`POST /hub/v1/campaigns/`

Operation ID: `createCampaign`.

Required permission scope: Campaign > Write

#### Parameters

*   `Authorization` (header, string, required) A unique, time-limited token that you can use to issue requests to REST API. Replace `YOUR_ACCESS_TOKEN` with your authentication token.
    
    _Example_
    
    ```
    Bearer YOUR_ACCESS_TOKEN
    ```
    

#### Request body (required)

Media type: `application/json`. Schema: `campaignPostRequestBody`.

#### Responses

*   **200** Indicates that the request to create the campaign was successful.
    
    Media type: `application/json`. Schema: `campaignResponseBody`.
    
    _Example_
    
    ```
    {
      "createdDate": "2023-08-05T11:18:43",
      "modifiedDate": "2023-08-05T11:18:43",
      "id": "4561",
      "name": "Final Hours for Summer Sale",
      "description": "Invite our most engaged customers to shop our Summer Sale before it ends.",
      "campaignCode": "summer2023",
      "color": "800080",
      "favorite": false
    }
    ```
    
*   **400** Indicates that the request contained information that the API couldn’t process. If you receive a 400 response, verify that the request uses the correct syntax.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "message": "JSON Deserialization Exception: Location Unknown",
      "errorcode": 10004,
      "documentation": ""
    }
    ```
    
*   **401** Indicates that the API wasn’t able to authorize your request. If you receive a 401 response, verify that you obtained an authorization token and that the token is still valid.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm",
      "errorcode": 0,
      "message": "Not Authorized"
    }
    ```
    
*   **403** This response indicates that the API accepted your request but couldn’t authorize it. If you receive a 403 response, make sure that you have the necessary permission scope for the operation. You can modify permission scopes on the Installed Apps page in Marketing Cloud Engagement Setup.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "",
      "errorcode": 20002,
      "message": "Insufficient privileges to complete this action."
    }
    ```
    
*   **500** Indicates that the API encountered an error when processing the request. If you receive a 500 response, verify that the request uses the correct syntax.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm",
      "errorcode": 0,
      "message": "Internal Server Error"
    }
    ```
    

### GET Retrieve information about a single campaign.

`GET /hub/v1/campaigns/{id}`

Operation ID: `getCampaign`.

Required permission scope: Campaign > Read

#### Parameters

*   `id` (path, number, required) The unique ID of the campaign.
*   `Authorization` (header, string, required) A unique, time-limited token that you can use to issue requests to REST API. Replace `YOUR_ACCESS_TOKEN` with your authentication token.
    
    _Example_
    
    ```
    Bearer YOUR_ACCESS_TOKEN
    ```
    

#### Responses

*   **200** Indicates that the request to create the campaign was successful.
    
    Media type: `application/json`. Schema: `campaignResponseBody`.
    
    _Example: same as POST /hub/v1/campaigns/ 200 response._
    
*   **400** Indicates that the request contained information that the API couldn’t process. If you receive a 400 response, verify that the request uses the correct syntax.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "message": "JSON Deserialization Exception: Location Unknown",
      "errorcode": 10004,
      "documentation": ""
    }
    ```
    
*   **401** Indicates that the API wasn’t able to authorize your request. If you receive a 401 response, verify that you obtained an authorization token and that the token is still valid.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm",
      "errorcode": 0,
      "message": "Not Authorized"
    }
    ```
    
*   **403** This response indicates that the API accepted your request but couldn’t authorize it. If you receive a 403 response, make sure that you have the necessary permission scope for the operation. You can modify permission scopes on the Installed Apps page in Marketing Cloud Engagement Setup.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "",
      "errorcode": 20002,
      "message": "Insufficient privileges to complete this action."
    }
    ```
    
*   **500** Indicates that the API encountered an error when processing the request. If you receive a 500 response, verify that the request uses the correct syntax.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm",
      "errorcode": 0,
      "message": "Internal Server Error"
    }
    ```
    

### DELETE Delete a campaign.

`DELETE /hub/v1/campaigns/{id}`

Operation ID: `deleteCampaign`.

Required permission scope: Campaign > Write

#### Parameters

*   `id` (path, number, required) The unique ID of the campaign.
*   `Authorization` (header, string, required) A unique, time-limited token that you can use to issue requests to REST API. Replace `YOUR_ACCESS_TOKEN` with your authentication token.
    
    _Example_
    
    ```
    Bearer YOUR_ACCESS_TOKEN
    ```
    

#### Request body (required)

Media type: `application/json`. Schema: `campaignPostRequestBody`.

#### Responses

*   **200** Indicates that the API accepted the request to delete the campaign. The response doesn’t contain any additional information.
*   **400** Indicates that the request contained information that the API couldn’t process. If you receive a 400 response, verify that the request uses the correct syntax.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "message": "JSON Deserialization Exception: Location Unknown",
      "errorcode": 10004,
      "documentation": ""
    }
    ```
    
*   **401** Indicates that the API wasn’t able to authorize your request. If you receive a 401 response, verify that you obtained an authorization token and that the token is still valid.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm",
      "errorcode": 0,
      "message": "Not Authorized"
    }
    ```
    
*   **403** This response indicates that the API accepted your request but couldn’t authorize it. If you receive a 403 response, make sure that you have the necessary permission scope for the operation. You can modify permission scopes on the Installed Apps page in Marketing Cloud Engagement Setup.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "",
      "errorcode": 20002,
      "message": "Insufficient privileges to complete this action."
    }
    ```
    
*   **500** Indicates that the API encountered an error when processing the request. If you receive a 500 response, verify that the request uses the correct syntax.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm",
      "errorcode": 0,
      "message": "Internal Server Error"
    }
    ```
    

### PATCH Update a campaign.

`PATCH /hub/v1/campaigns/{id}`

Operation ID: `updateCampaign`.

Required permission scope: Campaign > Write

#### Parameters

*   `id` (path, number, required) The unique ID of the campaign.
*   `Authorization` (header, string, required) A unique, time-limited token that you can use to issue requests to REST API. Replace `YOUR_ACCESS_TOKEN` with your authentication token.
    
    _Example_
    
    ```
    Bearer YOUR_ACCESS_TOKEN
    ```
    

#### Request body (required)

Media type: `application/json`. Schema: `campaignPostRequestBody`.

#### Responses

*   **200** Indicates that the request to create the campaign was successful.
    
    Media type: `application/json`. Schema: `campaignResponseBody`.
    
    _Example: same as POST /hub/v1/campaigns/ 200 response._
    
*   **400** Indicates that the request contained information that the API couldn’t process. If you receive a 400 response, verify that the request uses the correct syntax.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "message": "JSON Deserialization Exception: Location Unknown",
      "errorcode": 10004,
      "documentation": ""
    }
    ```
    
*   **401** Indicates that the API wasn’t able to authorize your request. If you receive a 401 response, verify that you obtained an authorization token and that the token is still valid.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm",
      "errorcode": 0,
      "message": "Not Authorized"
    }
    ```
    
*   **403** This response indicates that the API accepted your request but couldn’t authorize it. If you receive a 403 response, make sure that you have the necessary permission scope for the operation. You can modify permission scopes on the Installed Apps page in Marketing Cloud Engagement Setup.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "",
      "errorcode": 20002,
      "message": "Insufficient privileges to complete this action."
    }
    ```
    
*   **500** Indicates that the API encountered an error when processing the request. If you receive a 500 response, verify that the request uses the correct syntax.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm",
      "errorcode": 0,
      "message": "Internal Server Error"
    }
    ```
    

### GET Retrieve a list of assets that are associated with a campaign.

`GET /hub/v1/campaigns/{id}/assets`

Operation ID: `getCampaignAssets`.

Required permission scope: Campaign > Read

#### Parameters

*   `id` (path, number, required) The unique ID of the campaign.
*   `Authorization` (header, string, required) A unique, time-limited token that you can use to issue requests to REST API. Replace `YOUR_ACCESS_TOKEN` with your authentication token.
    
    _Example_
    
    ```
    Bearer YOUR_ACCESS_TOKEN
    ```
    

#### Responses

*   **200** Indicates that the request to retrieve campaign assets was successful.
    
    Media type: `application/json`. Schema: `campaignAssetsGetResponseBody`.
    
    _Example_
    
    ```
    {
      "count": 9,
      "items": [
        {
          "id": "51415",
          "campaignId": 4562,
          "type": "LIST",
          "itemID": 14597792,
          "createdDate": "2023-11-28T18:00:18"
        },
        {
          "id": "51414",
          "campaignId": 4562,
          "type": "PUSH_MESSAGE",
          "itemID": 1,
          "createdDate": "2023-11-28T18:00:18"
        },
        {
          "id": "51413",
          "campaignId": 4562,
          "type": "CALENDAR_EVENT",
          "itemID": 2231020,
          "createdDate": "2023-11-28T18:00:18"
        },
        {
          "id": "51412",
          "campaignId": 4562,
          "type": "AUTOMATION_DEFINITION",
          "objectID": "8743f449-672a-4532-af3b-be773a0513c3",
          "createdDate": "2023-11-28T18:00:18"
        },
        {
          "id": "51411",
          "campaignId": 4562,
          "type": "SENDABLE_CUSTOM_OBJECT",
          "objectID": "a91e4052-687e-ee11-ba50-d4f5ef3d5360",
          "createdDate": "2023-11-28T18:00:18"
        },
        {
          "id": "51410",
          "campaignId": 4562,
          "type": "GROUP",
          "itemID": 17115404,
          "createdDate": "2023-11-28T18:00:18"
        },
        {
          "id": "51409",
          "campaignId": 4562,
          "type": "TRIGGERED",
          "objectID": "913a76f0-8746-e511-a74e-e83935a85380",
          "createdDate": "2023-11-28T18:00:18"
        },
        {
          "id": "51408",
          "campaignId": 4562,
          "type": "CMS_ASSET",
          "itemID": 948668,
          "createdDate": "2023-11-28T18:00:18"
        },
        {
          "id": "51407",
          "campaignId": 4562,
          "type": "SMS_MESSAGE",
          "itemID": 2,
          "createdDate": "2023-11-28T18:00:18"
        }
      ],
      "page": 1,
      "pageSize": 50
    }
    ```
    
*   **400** Indicates that the request contained information that the API couldn’t process. If you receive a 400 response, verify that the request uses the correct syntax.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "message": "JSON Deserialization Exception: Location Unknown",
      "errorcode": 10004,
      "documentation": ""
    }
    ```
    
*   **401** Indicates that the API wasn’t able to authorize your request. If you receive a 401 response, verify that you obtained an authorization token and that the token is still valid.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm",
      "errorcode": 0,
      "message": "Not Authorized"
    }
    ```
    
*   **403** This response indicates that the API accepted your request but couldn’t authorize it. If you receive a 403 response, make sure that you have the necessary permission scope for the operation. You can modify permission scopes on the Installed Apps page in Marketing Cloud Engagement Setup.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "",
      "errorcode": 20002,
      "message": "Insufficient privileges to complete this action."
    }
    ```
    
*   **500** Indicates that the API encountered an error when processing the request. If you receive a 500 response, verify that the request uses the correct syntax.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm",
      "errorcode": 0,
      "message": "Internal Server Error"
    }
    ```
    

### POST Associate an asset with a campaign.

`POST /hub/v1/campaigns/{id}/assets`

Operation ID: `addAssetToCampaign`.

Required permission scope: Campaign > Write

#### Parameters

*   `id` (path, number, required) The unique ID of the campaign.
*   `Authorization` (header, string, required) A unique, time-limited token that you can use to issue requests to REST API. Replace `YOUR_ACCESS_TOKEN` with your authentication token.
    
    _Example_
    
    ```
    Bearer YOUR_ACCESS_TOKEN
    ```
    

#### Request body (required)

Media type: `application/json`. Schema: `campaignAssetPostRequestBody`.

#### Responses

*   **200** Indicates that the request to associate assets with the campaign was successful.
    
    Media type: `application/json`. Schema: `campaignAssetPostResponseBody`.
    
    _Example_
    
    ```
    [
      {
        "id": "51417",
        "campaignId": 4562,
        "type": "EMAIL",
        "itemID": 9810196,
        "createdDate": "2023-11-29T18:18:11"
      }
    ]
    ```
    
*   **400** Indicates that the request contained information that the API couldn’t process. If you receive a 400 response, verify that the request uses the correct syntax.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "message": "JSON Deserialization Exception: Location Unknown",
      "errorcode": 10004,
      "documentation": ""
    }
    ```
    
*   **401** Indicates that the API wasn’t able to authorize your request. If you receive a 401 response, verify that you obtained an authorization token and that the token is still valid.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm",
      "errorcode": 0,
      "message": "Not Authorized"
    }
    ```
    
*   **403** This response indicates that the API accepted your request but couldn’t authorize it. If you receive a 403 response, make sure that you have the necessary permission scope for the operation. You can modify permission scopes on the Installed Apps page in Marketing Cloud Engagement Setup.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "",
      "errorcode": 20002,
      "message": "Insufficient privileges to complete this action."
    }
    ```
    
*   **500** Indicates that the API encountered an error when processing the request. If you receive a 500 response, verify that the request uses the correct syntax.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm",
      "errorcode": 0,
      "message": "Internal Server Error"
    }
    ```
    

### GET Retrieve information about a specific asset that is associated with a campaign.

`GET /hub/v1/campaigns/{id}/assets/{assetId}`

Operation ID: `getCampaignAsset`.

Required permission scope: Campaign > Read

#### Parameters

*   `id` (path, number, required) The unique ID of the campaign.
*   `assetId` (path, number, required) The unique ID of the asset.
*   `Authorization` (header, string, required) A unique, time-limited token that you can use to issue requests to REST API. Replace `YOUR_ACCESS_TOKEN` with your authentication token.
    
    _Example_
    
    ```
    Bearer YOUR_ACCESS_TOKEN
    ```
    

#### Responses

*   **200** Indicates that the request to retrieve information about a campaign asset was successful.
    
    Media type: `application/json`. Schema: `campaignAssetGetResponseBody`.
    
    _Example_
    
    ```
    {
      "id": "51414",
      "campaignId": 4562,
      "type": "PUSH_MESSAGE",
      "itemID": 1,
      "createdDate": "2023-11-28T18:00:18"
    }
    ```
    
*   **400** Indicates that the request contained information that the API couldn’t process. If you receive a 400 response, verify that the request uses the correct syntax.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "message": "JSON Deserialization Exception: Location Unknown",
      "errorcode": 10004,
      "documentation": ""
    }
    ```
    
*   **401** Indicates that the API wasn’t able to authorize your request. If you receive a 401 response, verify that you obtained an authorization token and that the token is still valid.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm",
      "errorcode": 0,
      "message": "Not Authorized"
    }
    ```
    
*   **403** This response indicates that the API accepted your request but couldn’t authorize it. If you receive a 403 response, make sure that you have the necessary permission scope for the operation. You can modify permission scopes on the Installed Apps page in Marketing Cloud Engagement Setup.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "",
      "errorcode": 20002,
      "message": "Insufficient privileges to complete this action."
    }
    ```
    
*   **500** Indicates that the API encountered an error when processing the request. If you receive a 500 response, verify that the request uses the correct syntax.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm",
      "errorcode": 0,
      "message": "Internal Server Error"
    }
    ```
    

### DELETE Remove an association between an asset and a campaign.

`DELETE /hub/v1/campaigns/{id}/assets/{assetId}`

Operation ID: `removeAssetFromCampaign`.

Required permission scope: Campaign > Write

#### Parameters

*   `id` (path, number, required) The unique ID of the campaign.
*   `assetId` (path, number, required) The unique ID of the asset.
*   `Authorization` (header, string, required) A unique, time-limited token that you can use to issue requests to REST API. Replace `YOUR_ACCESS_TOKEN` with your authentication token.
    
    _Example_
    
    ```
    Bearer YOUR_ACCESS_TOKEN
    ```
    

#### Responses

*   **200** Indicates that the API accepted the request to remove the association between the asset and the campaign. The response doesn’t contain any additional information.
*   **400** Indicates that the request contained information that the API couldn’t process. If you receive a 400 response, verify that the request uses the correct syntax.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "message": "JSON Deserialization Exception: Location Unknown",
      "errorcode": 10004,
      "documentation": ""
    }
    ```
    
*   **401** Indicates that the API wasn’t able to authorize your request. If you receive a 401 response, verify that you obtained an authorization token and that the token is still valid.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm",
      "errorcode": 0,
      "message": "Not Authorized"
    }
    ```
    
*   **403** This response indicates that the API accepted your request but couldn’t authorize it. If you receive a 403 response, make sure that you have the necessary permission scope for the operation. You can modify permission scopes on the Installed Apps page in Marketing Cloud Engagement Setup.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "",
      "errorcode": 20002,
      "message": "Insufficient privileges to complete this action."
    }
    ```
    
*   **500** Indicates that the API encountered an error when processing the request. If you receive a 500 response, verify that the request uses the correct syntax.
    
    Media type: `application/json`. Schema: `errorResponseBody`.
    
    _Example_
    
    ```
    {
      "documentation": "https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm",
      "errorcode": 0,
      "message": "Internal Server Error"
    }
    ```
    

## Schemas

### campaignsGetResponseBody

*   `count` (_number_) The total number of campaigns returned by the operation.
*   `page` (_number_) The current page of results. Each page includes the number of records specified by the `pageSize` parameter. You can retrieve additional pages by incrementing this number in subsequent calls.
*   `pageSize` (_number_) The maximum number of results returned in a page of results.
*   `links` (_object_)
    *   `self` (_object_)
        *   `href` (_string_) The path of the API endpoint.
*   `items` (_array of object_)
    *   `createdDate` (_string_) The date and time when the campaign was created.
    *   `modifiedDate` (_string_) The date and time when the campaign was last modified.
    *   `id` (_string_) The campaign ID.
    *   `name` (_string_) The name of the campaign.
    *   `description` (_string_) A description of the campaign.
    *   `campaignCode` (_string_) The campaign code associated with the campaign.
    *   `color` (_string_) The color used to identify the campaign in the Marketing Cloud Engagement web interface, expressed as an HTML color code.
    *   `favorite` (_boolean_) Indicates whether the campaign has been identified as a favorite.

### errorResponseBody

*   `documentation` (_string_) A link to the [documentation page that describes how to handle API errors](/docs/marketing/marketing-cloud/guide/error-handling.html). For some types of errors, this property contains an empty string.
*   `errorcode` (_number_) An internal error code. For a complete list of error codes, see [Handle Errors in REST API](/docs/marketing/marketing-cloud/guide/error-handling.html). For some types of errors, the value of this property is 0.
*   `message` (_string_) The error message.

### campaignPostRequestBody

*   `name` (_string_) The name of the campaign.
*   `description` (_string_) A description of the campaign.
*   `campaignCode` (_string_) A campaign code to associate with the campaign.
*   `color` (_string_) The color used to identify the campaign in the Marketing Cloud Engagement web interface, expressed as an HTML color code.
*   `favorite` (_boolean_) Indicates whether to identify the campaign as a favorite.

_Example_

```
{
  "name": "Final Hours for Summer Sale",
  "description": "Invite our most engaged customers to shop our Summer Sale before it ends.",
  "campaignCode": "summer2023",
  "color": "800080",
  "favorite": false
}
```

### campaignResponseBody

*   `createdDate` (_string_) The date and time when the campaign was created.
*   `modifiedDate` (_string_) The date and time when the campaign was last modified.
*   `id` (_string_) The campaign ID.
*   `name` (_string_) The name of the campaign.
*   `description` (_string_) A description of the campaign.
*   `campaignCode` (_string_) The campaign code associated with the campaign.
*   `color` (_string_) The color used to identify the campaign in the Marketing Cloud Engagement web interface, expressed as an HTML color code.
*   `favorite` (_boolean_) Indicates whether the campaign has been identified as a favorite.

### campaignAssetsGetResponseBody

*   `count` (_number_) The total number of assets returned by the operation.
*   `page` (_number_) The current page of results. Each page includes the number of records specified by the `pageSize` parameter. You can retrieve additional pages by incrementing this number in subsequent calls.
*   `pageSize` (_number_) The number of results returned in a page of results.
*   `items` (_array of object_) An array of objects. Each object corresponds to an asset that is associated with the campaign. If the specified campaign isn’t found, this array contains no objects.
    *   `id` (_string_) A sequential ID for the campaign asset.
    *   `campaignId` (_number_) The campaign ID that the asset is associated with.
    *   `type` (_string_) The campaign asset type.  
        Allowed values: `AUTOMATION_DEFINITION`, `CALENDAR_EVENT`, `CMS_ASSET`, `EMAIL`, `GROUP`, `LIST`, `PUSH_MESSAGE`, `SENDABLE_CUSTOM_OBJECT`, `SMS_MESSAGE`, `TRIGGERED`.
    *   `itemID` (_number_) A unique ID for the campaign asset. Not present for assets that have an `objectID` value.
    *   `objectID` (_string_) A GUID for the campaign asset. Not present for assets that have an `itemID` value.
    *   `createdDate` (_string_) The date and time when the campaign asset was added to the campaign.

### campaignAssetPostRequestBody

*   `ids` (_array of string_) An array that contains the legacy IDs of the assets to add to the campaign. To find the legacy ID for an asset, use the [Advanced Asset Query operation](/docs/marketing/marketing-cloud/references/mc_rest_assets/assetAdvancedQuery.html).
*   `type` (_string_) The type of the asset.  
    Allowed values: `EMAIL`, `automation_definition`, `calendar_event`, `triggered`, `list`, `group`, `data_extension`, `sendable_custom_object`, `landing_page`, `facebook_tab`, `ct_facebook_post`, `ct_twitter_post`, `sms_message`, `push_message`, `CMS_asset`.

_Example_

```
{
  "ids": [
    "9810196",
    "9810197"
  ],
  "type": "EMAIL"
}
```

### campaignAssetPostResponseBody

Array of `object`.

*   `id` (_string_) The ID of the asset.
*   `campaignId` (_number_) The ID of the campaign that the asset is associated with.
*   `type` (_string_) The content type of the asset.
*   `itemID` (_number_) The legacy ID of the asset.
*   `createdDate` (_string_) The date and time when the asset was associated with the campaign.

### campaignAssetGetResponseBody

*   `id` (_string_) A sequential ID for the campaign asset.
*   `campaignId` (_number_) The campaign ID that the asset is associated with.
*   `type` (_string_) The campaign asset type.  
    Allowed values: `AUTOMATION_DEFINITION`, `CALENDAR_EVENT`, `CMS_ASSET`, `EMAIL`, `GROUP`, `LIST`, `PUSH_MESSAGE`, `SENDABLE_CUSTOM_OBJECT`, `SMS_MESSAGE`, `TRIGGERED`.
*   `itemID` (_number_) A unique ID for the campaign asset. Not present for assets that have an `objectID` value.
*   `objectID` (_string_) A GUID for the campaign asset. Not present for assets that have an `itemID` value.
*   `createdDate` (_string_) The date and time when the campaign asset was added to the campaign.