---
schema_version: "1"
id: b40ca903125a73afaa5d4c1b997698e5ff26eee84f70880deb6d5fd04a1c14df
title: Data Campaigns (deprecated)
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/b2c-commerce/references/generated-api-specs/ocapi-data-campaigns.md
canonical_url: https://developer.salesforce.com/docs/commerce/b2c-commerce/references/ocapi-data-campaigns
source_site: developer.salesforce.com
content_type: documentation
content_hash: bd50d939e45d4eed93f2e0993f5b3e2faa7cef9397ec4c8ac4645a2a5cb02b4e
products:
  - B2C Commerce
  - Salesforce APIs
---
Data Campaigns (deprecated)

# Data Campaigns (deprecated)

Data API endpoints enable developers to build applications for merchants: Create, update, delete business objects, like products, customers, pricing and promotions or assignments. They typically provide read and write access and are designed for moderate usage.

**Version:** 25.6

## Servers

*   `https://{host}/s/-/dw/data/v25_6`

Protocols: https.

## Security

*   `oauth2_application` (oauth2) Authentication flow with client ID and password with account manager.
    *   OAuth flow application (tokenUrl: https://account.demandware.com:443/dwsso/oauth2/access\_token)
    *   Scope x-info: Scopes are NOT supported. This is just a dummy, because the 'scopes' field is required.
*   `client_id` (apiKey) Add client ID for application identification. Alternative as 'client\_id' query parameter.
    *   API key in header: x-dw-client-id

## Operations

### GET Get Campaign

`GET /sites/{site_id}/campaigns/{campaign_id}`

Operation ID: `Get Campaign`. Tags: sites. Security: oauth2\_application.

Action to get campaign information.

This endpoint may return the following faults:

*   404 - CampaignNotFoundException - Thrown in case the campaign does not exist matching the given id

#### Parameters

*   `site_id` (path, string, required) The site the requested campaign belongs to.  
    Minimum length: 1.
*   `campaign_id` (path, string, required) The id of the requested campaign.  
    Minimum length: 1.

#### Responses

*   **404** `CampaignNotFoundException` - Thrown in case the campaign does not exist matching the given id
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **default**
    
    Media type: `application/json, text/xml`. Schema: `campaign`.
    

### PUT Create Campaign

`PUT /sites/{site_id}/campaigns/{campaign_id}`

Operation ID: `Create Campaign`. Tags: sites. Security: oauth2\_application.

Creates a campaign using the information provided.

This endpoint may return the following faults:

*   400 - IdConflictException - if the Id in request is not the same as the ID in document.

#### Parameters

*   `site_id` (path, string, required) The site context.  
    Minimum length: 1.
*   `campaign_id` (path, string, required) The id of the campaign to create.  
    Minimum length: 1.

#### Request body (required)

Media type: `application/json, text/xml`. Schema: `campaign`.

#### Responses

*   **400** `IdConflictException` - if the Id in request is not the same as the ID in document.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **default**
    
    Media type: `application/json, text/xml`. Schema: `campaign`.
    

### DELETE Delete Campaign

`DELETE /sites/{site_id}/campaigns/{campaign_id}`

Operation ID: `Delete Campaign`. Tags: sites. Security: oauth2\_application.

Deletes the campaign by ID

#### Parameters

*   `site_id` (path, string, required) The site context.  
    Minimum length: 1.
*   `campaign_id` (path, string, required) A campaign id to remove

#### Responses

*   **204**

### PATCH Update Campaign

`PATCH /sites/{site_id}/campaigns/{campaign_id}`

Operation ID: `Update Campaign`. Tags: sites. Security: oauth2\_application.

Updates the campaign with the specified information.

This endpoint may return the following faults:

*   400 - CampaignDuplicateException - if a campaign exists already in the site with the given campaign id.
*   404 - CampaignNotFoundException - Thrown in case the campaign does not exist matching the given id

#### Parameters

*   `site_id` (path, string, required) The site context.  
    Minimum length: 1.
*   `campaign_id` (path, string, required) The id of the requested campaign.  
    Minimum length: 1.

#### Request body (required)

Media type: `application/json, text/xml`. Schema: `campaign`.

#### Responses

*   **400** `CampaignDuplicateException` - if a campaign exists already in the site with the given campaign id.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **404** `CampaignNotFoundException` - Thrown in case the campaign does not exist matching the given id
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **default**
    
    Media type: `application/json, text/xml`. Schema: `campaign`.
    

### PUT Bind Coupon

`PUT /sites/{site_id}/campaigns/{campaign_id}/coupons/{coupon_id}`

Operation ID: `Bind Coupon`. Tags: sites. Security: oauth2\_application.

Action to bind a single coupon to a given campaign.

This endpoint may return the following faults:

*   400 - ConstraintViolationException - Indicates some parameter constraint violation occurs
*   404 - CampaignNotFoundException - Indicates that the campaign with the given campaign id is unknown.

#### Parameters

*   `site_id` (path, string, required)  
    Minimum length: 1.
*   `campaign_id` (path, string, required) The campaign ID that coupons are to be bound to  
    Minimum length: 1.
*   `coupon_id` (path, string, required) The coupon ID to bind to a campaign  
    Minimum length: 1.

#### Responses

*   **204**
*   **400** `ConstraintViolationException` - Indicates some parameter constraint violation occurs
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **404** `CampaignNotFoundException` - Indicates that the campaign with the given campaign id is unknown.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    

### DELETE Unbind Coupon

`DELETE /sites/{site_id}/campaigns/{campaign_id}/coupons/{coupon_id}`

Operation ID: `Unbind Coupon`. Tags: sites. Security: oauth2\_application.

Action to unbind a coupon from a given campaign.

This endpoint may return the following faults:

*   400 - ConstraintViolationException - Indicates some parameter constraint violation occurs
*   404 - CampaignNotFoundException - Indicates that the campaign with the given campaign id is unknown.

#### Parameters

*   `site_id` (path, string, required)  
    Minimum length: 1.
*   `campaign_id` (path, string, required) The campaign ID that coupons are to be unbound from  
    Minimum length: 1.
*   `coupon_id` (path, string, required) The coupon ID to unbind from a campaign  
    Minimum length: 1.
*   `removeInPCA` (query, string)

#### Responses

*   **204**
*   **400** `ConstraintViolationException` - Indicates some parameter constraint violation occurs
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **404** `CampaignNotFoundException` - Indicates that the campaign with the given campaign id is unknown.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    

### PUT Bind Customer Group

`PUT /sites/{site_id}/campaigns/{campaign_id}/customer_groups/{customer_group_id}`

Operation ID: `Bind Customer Group`. Tags: sites. Security: oauth2\_application.

Action to bind a single customer group to a given campaign.

This endpoint may return the following faults:

*   400 - ConstraintViolationException - Indicates some parameter constraint violation occurs
*   404 - CampaignNotFoundException - Indicates that the campaign with the given campaign id is unknown.

#### Parameters

*   `site_id` (path, string, required)  
    Minimum length: 1.
*   `campaign_id` (path, string, required) The campaign ID that coupons are to be bound to  
    Minimum length: 1.
*   `customer_group_id` (path, string, required) The customer group ID to bind to a campaign  
    Minimum length: 1.

#### Responses

*   **204**
*   **400** `ConstraintViolationException` - Indicates some parameter constraint violation occurs
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **404** `CampaignNotFoundException` - Indicates that the campaign with the given campaign id is unknown.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    

### DELETE Unbind Customer Group

`DELETE /sites/{site_id}/campaigns/{campaign_id}/customer_groups/{customer_group_id}`

Operation ID: `Unbind Customer Group`. Tags: sites. Security: oauth2\_application.

Action to unbind a customer group from a given campaign.

This endpoint may return the following faults:

*   400 - ConstraintViolationException - Indicates some parameter constraint violation occurs
*   404 - CampaignNotFoundException - Indicates that the campaign with the given campaign id is unknown.

#### Parameters

*   `site_id` (path, string, required)  
    Minimum length: 1.
*   `campaign_id` (path, string, required) The campaign ID that coupons are to be unbound from  
    Minimum length: 1.
*   `customer_group_id` (path, string, required) The customer group ID to unbind from a campaign  
    Minimum length: 1.

#### Responses

*   **204**
*   **400** `ConstraintViolationException` - Indicates some parameter constraint violation occurs
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **404** `CampaignNotFoundException` - Indicates that the campaign with the given campaign id is unknown.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    

### PUT Bind Promotion to Campaign

`PUT /sites/{site_id}/campaigns/{campaign_id}/promotions/{promotion_id}`

Operation ID: `Bind Promotion to Campaign`. Tags: sites. Security: oauth2\_application.

Action to bind a single promotion to a given campaign.

This endpoint may return the following faults:

*   404 - CampaignNotFoundException - Indicates that the campaign with the given campaign ID is not found.
*   404 - PromotionNotFoundException - Indicates that the promotion with the given promotion ID is not found.
*   404 - SiteNotFoundException - thrown when site with the given site id is not found.

#### Parameters

*   `site_id` (path, string, required) The ID of the site that contains the campaign and promotion.  
    Minimum length: 1.
*   `campaign_id` (path, string, required) The ID of the campaign to which the promotion is to be assigned.  
    Minimum length: 1.
*   `promotion_id` (path, string, required) The ID of the promotion that is to be assigned to the campaign.  
    Minimum length: 1.

#### Request body

Media type: `application/json, text/xml`. Schema: `promotion_campaign_assignment`.

#### Responses

*   **204**
*   **404** `CampaignNotFoundException` - Indicates that the campaign with the given campaign ID is not found. or `PromotionNotFoundException` - Indicates that the promotion with the given promotion ID is not found. or `SiteNotFoundException` - thrown when site with the given site id is not found.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    

### DELETE Unbind Promotion

`DELETE /sites/{site_id}/campaigns/{campaign_id}/promotions/{promotion_id}`

Operation ID: `Unbind Promotion`. Tags: sites. Security: oauth2\_application.

Action to unbind a single promotion from a given campaign.

This endpoint may return the following faults:

*   404 - CampaignNotFoundException - Indicates that the campaign with the given campaign ID is not found.
*   404 - PromotionNotFoundException - Indicates that the campaign with the given promotion ID is not found.
*   404 - SiteNotFoundException - thrown when site with the given site id is not found.

#### Parameters

*   `site_id` (path, string, required) The ID of the site that contains the campaign and promotion.  
    Minimum length: 1.
*   `campaign_id` (path, string, required) The ID of the campaign to which the promotion is to be assigned.  
    Minimum length: 1.
*   `promotion_id` (path, string, required) The ID of the promotion that is to be assigned to the campaign.  
    Minimum length: 1.

#### Responses

*   **204**
*   **404** `CampaignNotFoundException` - Indicates that the campaign with the given campaign ID is not found. or `PromotionNotFoundException` - Indicates that the campaign with the given promotion ID is not found. or `SiteNotFoundException` - thrown when site with the given site id is not found.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    

### PATCH Update Promotion Campaign Assignment

`PATCH /sites/{site_id}/campaigns/{campaign_id}/promotions/{promotion_id}`

Operation ID: `Update Promotion Campaign Assignment`. Tags: sites. Security: oauth2\_application.

Action to update the assignment of promotion to a campaign.

This endpoint may return the following faults:

*   404 - CampaignNotFoundException - Indicates that the campaign with the given campaign ID is not found.
*   404 - CouponNotFoundException - Indicates that the coupon with the given coupon ID is not found.
*   404 - CustomerGroupNotFoundException - Indicates that the customer group with the given customer group ID is not found.
*   404 - PromotionNotFoundException - Indicates that the promotion with the given promotion ID is not found.
*   404 - SiteNotFoundException - thrown when site with the given site id is not found.
*   404 - SourceCodeGroupNotFoundException - Indicates that the source code group with the given source code group ID is not found.

#### Parameters

*   `campaign_id` (path, string, required) The ID of the campaign.  
    Minimum length: 1.
*   `site_id` (path, string, required) The ID of the site.  
    Minimum length: 1.
*   `promotion_id` (path, string, required) The ID of the promotion.  
    Minimum length: 1.

#### Request body (required)

Media type: `application/json, text/xml`. Schema: `promotion_campaign_assignment`.

#### Responses

*   **204**
*   **404** `CampaignNotFoundException` - Indicates that the campaign with the given campaign ID is not found. or `CouponNotFoundException` - Indicates that the coupon with the given coupon ID is not found. or `CustomerGroupNotFoundException` - Indicates that the customer group with the given customer group ID is not found. or `PromotionNotFoundException` - Indicates that the promotion with the given promotion ID is not found. or `SiteNotFoundException` - thrown when site with the given site id is not found. or `SourceCodeGroupNotFoundException` - Indicates that the source code group with the given source code group ID is not found.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    

### PUT Bind Slot Configuration to Campaign

`PUT /sites/{site_id}/campaigns/{campaign_id}/slot_configurations/{slot_id}/{slot_config_id}`

Operation ID: `Bind Slot Configuration to Campaign`. Tags: sites. Security: oauth2\_application.

Action to bind a slot configuration to a given campaign.

This endpoint may return the following faults:

*   400 - IdConflictException - Indicates the ID in the URL does not match the ID in the request
*   400 - InvalidContextTypeException - Indicates the slot context type is not one of "global", "category", or "folder"
*   404 - CampaignNotFoundException - Indicates that the campaign with the given campaign ID is not found.
*   404 - SiteNotFoundException - thrown when site with the given site id is not found.
*   404 - SlotConfigurationIdentifierNotFoundException - Indicates that the slot with the given slot ID, slot configuration ID and context type is not found.
*   404 - SlotWithContextTypeNotFoundException - Indicates that the slot with the given slot ID and context type is not found.

#### Parameters

*   `campaign_id` (path, string, required) The ID of the campaign.  
    Minimum length: 1.
*   `site_id` (path, string, required) The ID of the site.  
    Minimum length: 1.
*   `slot_id` (path, string, required) The ID of the slot.  
    Minimum length: 1.
*   `slot_config_id` (path, string, required) The ID of the slot configuration.  
    Minimum length: 1.
*   `context` (query, string) The context string, which consists of three parts: the context type (which must be folder, category or global), an equals sign (=), and the context id (either the category id or folder id). If you do not set this query parameter, the global context is used by default.  
    Minimum length: 1.

#### Request body

Media type: `application/json, text/xml`. Schema: `slot_configuration_campaign_assignment`.

#### Responses

*   **204**
*   **400** `IdConflictException` - Indicates the ID in the URL does not match the ID in the request or `InvalidContextTypeException` - Indicates the slot context type is not one of "global", "category", or "folder"
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **404** `CampaignNotFoundException` - Indicates that the campaign with the given campaign ID is not found. or `SiteNotFoundException` - thrown when site with the given site id is not found. or `SlotConfigurationIdentifierNotFoundException` - Indicates that the slot with the given slot ID, slot configuration ID and context type is not found. or `SlotWithContextTypeNotFoundException` - Indicates that the slot with the given slot ID and context type is not found.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    

### DELETE Unbind SlotConfiguration

`DELETE /sites/{site_id}/campaigns/{campaign_id}/slot_configurations/{slot_id}/{slot_config_id}`

Operation ID: `Unbind SlotConfiguration`. Tags: sites. Security: oauth2\_application.

Action to unbind a slot configuration from a given campaign.

This endpoint may return the following faults:

*   400 - InvalidContextTypeException - Indicates the slot context type is not one of "global", "category", or "folder"
*   404 - CampaignNotFoundException - Indicates that the campaign with the given campaign ID is not found.
*   404 - SiteNotFoundException - thrown when site with the given site id is not found.
*   404 - SlotConfigurationIdentifierNotFoundException - Indicates that the slot with the given slot ID, slot configuration ID and context type is not found.
*   404 - SlotWithContextTypeNotFoundException - Indicates that the slot with the given slot ID and context type is not found.

#### Parameters

*   `campaign_id` (path, string, required) The id of the campaign  
    Minimum length: 1.
*   `site_id` (path, string, required) The id of the site  
    Minimum length: 1.
*   `slot_id` (path, string, required) The of the slot  
    Minimum length: 1.
*   `slot_config_id` (path, string, required) The id of the slot configuration  
    Minimum length: 1.
*   `context` (query, string) The context string, which consists of three parts: the context type (which must be folder, category or global), an equals sign (=), and the context id (either the category id or folder id).  
    Minimum length: 1.

#### Responses

*   **204**
*   **400** `InvalidContextTypeException` - Indicates the slot context type is not one of "global", "category", or "folder"
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **404** `CampaignNotFoundException` - Indicates that the campaign with the given campaign ID is not found. or `SiteNotFoundException` - thrown when site with the given site id is not found. or `SlotConfigurationIdentifierNotFoundException` - Indicates that the slot with the given slot ID, slot configuration ID and context type is not found. or `SlotWithContextTypeNotFoundException` - Indicates that the slot with the given slot ID and context type is not found.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    

### PATCH Update Slot Configuration Campaign Assignment

`PATCH /sites/{site_id}/campaigns/{campaign_id}/slot_configurations/{slot_id}/{slot_config_id}`

Operation ID: `Update Slot Configuration Campaign Assignment`. Tags: sites. Security: oauth2\_application.

Action to update the assignment of slot configuration to a campaign.

This endpoint may return the following faults:

*   400 - InvalidContextTypeException - Indicates the slot context type is not one of "global", "category", or "folder"
*   404 - CampaignNotFoundException - Indicates that the campaign with the given campaign ID is not found.
*   404 - SiteNotFoundException - thrown when site with the given site id is not found.
*   404 - SlotConfigurationIdentifierNotFoundException - Indicates that the slot with the given slot ID, slot configuration ID and context type is not found.
*   404 - SlotWithContextTypeNotFoundException - Indicates that the slot with the given slot ID and context type is not found.

#### Parameters

*   `campaign_id` (path, string, required) The ID of the campaign.  
    Minimum length: 1.
*   `site_id` (path, string, required) The ID of the site.  
    Minimum length: 1.
*   `slot_id` (path, string, required) The ID of the slot.  
    Minimum length: 1.
*   `slot_config_id` (path, string, required) The ID of the slot configuration.  
    Minimum length: 1.
*   `context` (query, string) The context string, which consists of three parts: the context type (which must be folder, category or global), an equals sign (=), and the context id (either the category id or folder id). If you do not set this query parameter, the global context is used by default.  
    Minimum length: 1.

#### Request body (required)

Media type: `application/json, text/xml`. Schema: `slot_configuration_campaign_assignment`.

#### Responses

*   **204**
*   **400** `InvalidContextTypeException` - Indicates the slot context type is not one of "global", "category", or "folder"
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **404** `CampaignNotFoundException` - Indicates that the campaign with the given campaign ID is not found. or `SiteNotFoundException` - thrown when site with the given site id is not found. or `SlotConfigurationIdentifierNotFoundException` - Indicates that the slot with the given slot ID, slot configuration ID and context type is not found. or `SlotWithContextTypeNotFoundException` - Indicates that the slot with the given slot ID and context type is not found.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    

### PUT Bind SortingRule to Campaign

`PUT /sites/{site_id}/campaigns/{campaign_id}/sorting_rules/{sorting_rule_id}/{category_id}`

Operation ID: `Bind SortingRule to Campaign`. Tags: sites. Security: oauth2\_application.

Action to bind a single sorting rule to a given campaign.

This endpoint may return the following faults:

*   400 - InvalidCategoryException - Indicates that the category with the given category ID is not found.
*   404 - CampaignNotFoundException - Indicates that the campaign with the given campaign ID is not found.
*   404 - SiteNotFoundException - thrown when site with the given site id is not found.
*   404 - SortingRuleNotFoundException - Indicates that the sorting rule with the given sorting rule ID is not found.
*   409 - SortingRuleCampaignAssignConflictException - Indicates that there is a sorting rule already assigned to the given campaign ID and category ID. The sorting rule with the given sorting rule ID cannot be assigned to the same campaign ID and category ID.

#### Parameters

*   `site_id` (path, string, required) The ID of the site that contains the campaign, sorting rule and category.  
    Minimum length: 1.
*   `campaign_id` (path, string, required) The ID of the campaign to which the sorting rule is to be assigned.  
    Minimum length: 1.
*   `sorting_rule_id` (path, string, required) The ID of sorting rule that is to be assigned to the campaign.  
    Minimum length: 1.
*   `category_id` (path, string, required) The ID of the category that is associated with the sorting rule.  
    Minimum length: 1.
*   `rule_context` (query, string) The context in which the rule lives, either "site" or "global"

#### Responses

*   **204**
*   **400** `InvalidCategoryException` - Indicates that the category with the given category ID is not found.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **404** `CampaignNotFoundException` - Indicates that the campaign with the given campaign ID is not found. or `SiteNotFoundException` - thrown when site with the given site id is not found. or `SortingRuleNotFoundException` - Indicates that the sorting rule with the given sorting rule ID is not found.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **409** `SortingRuleCampaignAssignConflictException` - Indicates that there is a sorting rule already assigned to the given campaign ID and category ID. The sorting rule with the given sorting rule ID cannot be assigned to the same campaign ID and category ID.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    

### DELETE UnBind SortingRule

`DELETE /sites/{site_id}/campaigns/{campaign_id}/sorting_rules/{sorting_rule_id}/{category_id}`

Operation ID: `UnBind SortingRule`. Tags: sites. Security: oauth2\_application.

Action to unbind a single sorting rule from a given campaign.

This endpoint may return the following faults:

*   400 - InvalidCategoryException - Indicates that the category with the given category ID is not found.
*   404 - CampaignNotFoundException - Indicates that the campaign with the given campaign ID is not found.
*   404 - SiteNotFoundException - thrown when site with the given site id is not found.
*   404 - SortingRuleNotFoundException - Indicates that the sorting rule with the given sorting rule ID is not found.

#### Parameters

*   `site_id` (path, string, required) The ID of the site that contains the campaign, sorting rule and category.  
    Minimum length: 1.
*   `campaign_id` (path, string, required) The ID of the campaign to which the sorting rule is to be assigned.  
    Minimum length: 1.
*   `sorting_rule_id` (path, string, required) The ID of sorting rule that is to be assigned to the campaign.  
    Minimum length: 1.
*   `category_id` (path, string, required) The ID of the category that is associated with the sorting rule.  
    Minimum length: 1.
*   `rule_context` (query, string) The context in which the rule lives, either "site" or "global"

#### Responses

*   **204**
*   **400** `InvalidCategoryException` - Indicates that the category with the given category ID is not found.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **404** `CampaignNotFoundException` - Indicates that the campaign with the given campaign ID is not found. or `SiteNotFoundException` - thrown when site with the given site id is not found. or `SortingRuleNotFoundException` - Indicates that the sorting rule with the given sorting rule ID is not found.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    

### PUT Bind Source Code Group

`PUT /sites/{site_id}/campaigns/{campaign_id}/source_code_groups/{source_code_group_id}`

Operation ID: `Bind Source Code Group`. Tags: sites. Security: oauth2\_application.

Action to bind a single source code group to a given campaign.

This endpoint may return the following faults:

*   400 - ConstraintViolationException - Indicates some parameter constraint violation occurs
*   404 - CampaignNotFoundException - Indicates that the campaign with the given campaign id is unknown.

#### Parameters

*   `site_id` (path, string, required)  
    Minimum length: 1.
*   `campaign_id` (path, string, required) The campaign ID that source code group are to be bound to  
    Minimum length: 1.
*   `source_code_group_id` (path, string, required) The source code group ID to bind to a campaign  
    Minimum length: 1.

#### Responses

*   **204**
*   **400** `ConstraintViolationException` - Indicates some parameter constraint violation occurs
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **404** `CampaignNotFoundException` - Indicates that the campaign with the given campaign id is unknown.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    

### DELETE Unbind Source Code Group

`DELETE /sites/{site_id}/campaigns/{campaign_id}/source_code_groups/{source_code_group_id}`

Operation ID: `Unbind Source Code Group`. Tags: sites. Security: oauth2\_application.

Action to unbind a source code group from a given campaign.

This endpoint may return the following faults:

*   400 - ConstraintViolationException - Indicates some parameter constraint violation occurs
*   404 - CampaignNotFoundException - Indicates that the campaign with the given campaign id is unknown.

#### Parameters

*   `site_id` (path, string, required)  
    Minimum length: 1.
*   `campaign_id` (path, string, required) The campaign ID that source code groups are to be unbound from  
    Minimum length: 1.
*   `source_code_group_id` (path, string, required) The source code group ID to unbind from a campaign  
    Minimum length: 1.

#### Responses

*   **204**
*   **400** `ConstraintViolationException` - Indicates some parameter constraint violation occurs
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **404** `CampaignNotFoundException` - Indicates that the campaign with the given campaign id is unknown.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    

## Schemas

### fault

Document representing a fault message that is returned whenever the HTTP status code is greater than or equal to 400 (which indicates an error).

*   `arguments` (_object_)
    
    A map that provides fault arguments.
    
    Data can be used to provide error messages on the client side.
    
    Additional properties: `object`.
    
*   `cause` (_cause_)
*   `display_message_pattern` (_string_) The localized display message pattern, if the request parameter display\_locale was given
*   `message` (_string_) The message text of the java exception.
*   `stack_trace` (_string_)
*   `type` (_string_) The name of the java exception.

### campaign

Document representing a campaign.

*   `campaign_id` (_string_) The ID of the campaign.  
    Minimum length: 1. Maximum length: 256.
*   `coupons` (_array of string_) The array of assigned coupon IDs, not sorted
*   `creation_date` (_string (date-time)_, read-only) Returns the value of attribute 'creationDate'.
*   `customer_groups` (_array of string_) The array of assigned customer groups, not sorted
*   `description` (_string (text)_) The description of the campaign.  
    Maximum length: 4000.
*   `enabled` (_boolean_) The enabled flag for campaign.
*   `end_date` (_string (date-time)_) The date that the Scenario ends
*   `last_modified` (_string (date-time)_, read-only) Returns the value of attribute 'lastModified'.
*   `link` (_string_) link for convenience
*   `source_code_groups` (_array of string_) The array of assigned source code groups, not sorted
*   `start_date` (_string (date-time)_) The date that the Scenario begins

_Example_

```
{
  "coupons": [
    "testCoupon"
  ],
  "customer_groups": [
    "Registered"
  ],
  "description": "My Campaign",
  "enabled": true,
  "end_date": "2015-07-31T23:09:08.000Z",
  "link": "https://example.com/s/-/dw/data/{version}/sites/SiteGenesis/campaigns/my-campaign",
  "source_code_groups": [
    "WapiSourceCodeGroup1"
  ],
  "start_date": "2015-04-01T11:30:15.000Z"
}
```

### promotion\_campaign\_assignment

Document representing a promotion campaign assignment.

*   `campaign` (_campaign_) The campaign
*   `campaign_id` (_string_) The id of the campaign.  
    Minimum length: 1. Maximum length: 256.
*   `coupons` (_array of string_) The sorted array of assigned coupon ids.
*   `coupons_based` (_boolean_) True if the assigned promotion is coupon based. When set to false, Coupons in the campaign and on the PromotionCampaignAssignment are ignored. The default value is true.
*   `creation_date` (_string (date-time)_)
*   `customer_groups` (_array of string_) The sorted array of assigned customer groups.
*   `customer_groups_based` (_boolean_) True if the assigned promotion is customer group based. When set to false, Customer Groups in the campaign and on the PromotionCampaignAssignment are ignored. The default value is true.
*   `description` (_string_) The description of the promotion campaign assignment.  
    Maximum length: 4000.
*   `enabled` (_boolean_) True if the assignment resource is enabled
*   `last_modified` (_string (date-time)_)
*   `link` (_string_) link for convenience
*   `promotion` (_promotion_) The promotion
*   `promotion_id` (_string_) The id of the Promotion.  
    Minimum length: 1. Maximum length: 256.
*   `rank` (_integer (int32)_) The rank of promotion campaign assignment
*   `required_qualifier` (_string_) A constant indicating that one or all qualifier conditions must be met in order for the promotion to apply for a given customer. Valid values are "any" and "all".  
    Allowed values: `any`, `all`.
*   `schedule` (_schedule_) The schedule of the assignment resource
*   `source_code_based` (_boolean_) True if the assigned promotion is source code group based. When set to false, Source Code Groups in the campaign and on the PromotionCampaignAssignment are ignored. The default value is true.
*   `source_code_groups` (_array of string_) The sorted array of assigned source code groups.

_Example_

```
{
  "campaign": {
    "campaign_id": "coupon-campaign",
    "description": "A campaign for coupons.",
    "enabled": true
  },
  "campaign_id": "coupon-campaign",
  "coupons": [
    "order-promotion-coupon"
  ],
  "description": "Coupon Order Promotion",
  "enabled": true,
  "link": "https://example.com/s/-/dw/data/{version}/sites/SiteGenesis/promotions/coupon-promotion-order/campaigns/coupon-campaign",
  "promotion_id": "coupon-promotion-order",
  "schedule": {
    "end_date": "2050-01-01T00:00:00.000Z",
    "start_date": "2000-01-01T00:00:00.000Z"
  }
}
```

### slot\_configuration\_campaign\_assignment

Document representing a slot\_configuration\_campaign\_assignment

*   `campaign` (_campaign_) The campaign.
*   `campaign_id` (_string_) The id of the campaign that has the slot configuration assigned to it.  
    Minimum length: 1. Maximum length: 256.
*   `context` (_string_, required) The slot context.  
    Allowed values: `global`, `category`, `folder`.
*   `creation_date` (_string (date-time)_)
*   `customer_groups` (_array of string_) The list of customer groups.
*   `description` (_string_) The description of the slot configuration.  
    Maximum length: 4000.
*   `enabled` (_boolean_) True if the assignment resource is enabled
*   `last_modified` (_string (date-time)_)
*   `link` (_string_) The URL to the slot configuration-campaign assignment.
*   `rank` (_integer (int32)_) The rank of the slot confiuration-campaign assignment. This is different than the rank of the slot configuration.  
    Minimum: 1.
*   `schedule` (_schedule_) The schedule of the assignment resource
*   `slot_configuration` (_slot\_configuration_) The slotConfiguration
*   `slot_configuration_id` (_string_, required) The ID of the slot configuration.  
    Minimum length: 1. Maximum length: 256.
*   `slot_configuration_uuid` (_string_) The UUID of the slot configuration.  
    Maximum length: 28.
*   `slot_context_id` (_string_) The ID of the slot's context, for example, the category ID for a slot with category context.  
    Maximum length: 256.
*   `slot_id` (_string_, required) The ID of the slot.  
    Minimum length: 1. Maximum length: 256.

_Example_

```
{
  "campaign_id": "campaign-registered",
  "context": "global",
  "description": "Free Microsoft Zune With Purchase Of $500 Or More In Electronics",
  "enabled": true,
  "link": "https://example.com/s/-/dw/data/{version}/sites/SiteGenesis/slot_configuration_campaign_assignments/campaign-registered",
  "schedule": {},
  "slot_configuration": {
    "assignment_information": {
      "active": true,
      "active_campaign_assignments": {
        "campaign_id": "campaign-registered",
        "context": "global",
        "enabled": true,
        "rank": 40
      }
    }
  },
  "slot_configuration_id": "Promo Zune",
  "slot_configuration_uuid": "bdL6MiWcbpakEaaadkHwIhZj1N",
  "slot_id": "404-promo"
}
```

### cause

*   `cause` (_cause_)
*   `message` (_string_)
*   `type` (_string_)

### promotion

Document representing a promotion. Unless otherwise stated, attributes of this document are not supported when using the Open Commerce API to update multiple promotions at once.

*   `archived` (_boolean_) Determines whether or not this promotion is archived. This attribute is allowed to be updated when using the Open Commerce API to update multiple promotions at once.
*   `assignment_information` (_promotion\_assignment\_information_) Information about the assignments and assignment schedules of this promotion
*   `callout_msg` (_object (localized)_) The localized callout message of the promotion.
    
    Additional properties: `markup_text`.
    
*   `creation_date` (_string (date-time)_, read-only) Returns the value of attribute 'creationDate'.
*   `currency_code` (_string_) The ISO 4217 mnemonic code of the currency this promotion is restricted to. If not populated, then there is no currency restriction on the promotion.  
    Maximum length: 3.
*   `disable_globally_excluded` (_boolean_) Determines whether or not this promotion ignores the global product exclusions for promotions. This attribute is allowed to be updated when using the Open Commerce API to update multiple promotions at once.
*   `enabled` (_boolean_) Determines whether or not this promotion is enabled. This attribute is allowed to be updated when using the Open Commerce API to update multiple promotions at once.
*   `exclusivity` (_string_) Determines if the promotion can be combined with other promotions of the same promotion class or if it cannot be combined with any other promotions. This attribute is allowed to be updated when using the Open Commerce API to update multiple promotions at once.  
    Allowed values: `no`, `class`, `global`.
*   `id` (_string_) The id for the promotion.
*   `last_modified` (_string (date-time)_, read-only) Returns the value of attribute 'lastModified'.
*   `link` (_string_) A URL that is used to get the details of this promotion.
*   `name` (_object (localized)_) The user supplied name of this promotion, which can be localized
    
    Additional properties: `string`.
    
*   `promotion_class` (_string_) The class of the promotion. If the promotion class is modified, then the promotion rule and all of its values, such as whether or not to disable global product exclusions, will be reset.  
    Allowed values: `product`, `shipping`, `order`.
*   `tags` (_array of tag_) Returns the list of tags assigned to this promotion. If used to set the tags on a promotion, the promotion will only have the tags passed in the input. Any existing tags will be removed.

_Example_

```
{
  "enabled": true,
  "exclusivity": "class",
  "id": "my-promotion",
  "link": "https://example.com/s/-/dw/data/{version}/sites/SiteGenesis/promotion_campaign_assignments/my-promotion/my-promotion",
  "name": {
    "default": "My Promotion"
  },
  "promotion_class": "order"
}
```

### schedule

Document representing a time schedule for slots.

*   `end_date` (_string (date-time)_) The date to end of validity. ISO8601 date time format: yyyy-MM-dd'T'HH:mm:ssZ.
*   `recurrence` (_recurrence_) The recurrence of the schedule by day of week and time of day. Not all schedules will support a recurrence.
*   `start_date` (_string (date-time)_) The date to start validity. ISO8601 date time format: yyyy-MM-dd'T'HH:mm:ssZ.

_Example_

```
{
  "end_date": "2050-01-01T00:00:00.000Z",
  "start_date": "2000-01-01T00:00:00.000Z"
}
```

### slot\_configuration

Document representing a slot configuration.

*   `assignment_information` (_slot\_configuration\_assignment\_information_) Information about the assignments and assignment schedules of this slot configuration
*   `callout_msg` (_object (localized)_) The call out message.
    
    Additional properties: `markup_text`.
    
*   `configuration_id` (_string_) The id of this configuration.  
    Minimum length: 1. Maximum length: 256.
*   `context` (_string_) The context of the slot. Ignored in input documents.  
    Allowed values: `global`, `category`, `folder`.
*   `context_id` (_string_) When the context is _category_, this is a _category\_id_; when the context is _folder_, this is a _folder\_id_; and when the context is _global_, this is obsolete. This is ignored in input documents.
*   `creation_date` (_string (date-time)_, read-only) Returns the value of attribute 'creationDate'.
*   `customer_groups` (_array of string_) The customer groups ids.
*   `default` (_boolean_) A flag indicating whether the configuration is the default one for the slot.
*   `description` (_string_) The configuration description.  
    Maximum length: 4000.
*   `enabled` (_boolean_) A flag indicating whether the slot is enabled.
*   `last_modified` (_string (date-time)_, read-only) Returns the value of attribute 'lastModified'.
*   `link` (_string_) The link.
*   `rank` (_integer (int32)_) The rank of the slot configuration on its slot. This rank has nothing to do with the rank on any campaign-assignment, because these are completely different objects. These must be updated separately.  
    Allowed values: `10`, `20`, `30`, `40`, `50`, `60`, `70`, `80`, `90`, `100`. Minimum: 1.
*   `schedule` (_schedule_) The schedule for the slot.
*   `slot_content` (_slot\_content_, required) The content of the slot.
*   `slot_id` (_string_) The ID of the slot. Ignored in input documents.  
    Minimum length: 1. Maximum length: 256.
*   `template` (_string_) The template.  
    Maximum length: 256.
*   `uuid` (_string_, read-only) The uuid of the slot configuration. This property cannot be written and is ignored in input documents.  
    Minimum length: 1. Maximum length: 28.

_Example_

```
{
  "assigned_to_site": true,
  "callout_msg": {
    "default": "some message"
  },
  "configuration_id": "2015-06-24_16:33:18",
  "context": "global",
  "customer_groups": [
    "Administrators",
    "Registered"
  ],
  "default": true,
  "description": "slot configuration description",
  "enabled": true,
  "rank": 2,
  "schedule": {
    "end_date": "2022-03-28T23:21:00.000Z",
    "recurrence": {
      "day_of_week": [
        "monday",
        "sunday"
      ],
      "time_of_day": {
        "time_from": "00:00:00",
        "time_to": "23:59:00"
      }
    },
    "start_date": "2013-03-28T23:21:00.000Z"
  },
  "slot_content": {
    "body": {
      "default": "<html>HTML content</html>"
    },
    "type": "html"
  },
  "slot_id": "header-banner",
  "uuid": "fsdoi43ofijwdf"
}
```

### promotion\_assignment\_information

*   `abtest_id` (_string_) If there is only one assignment, and that assignment is an A/B test segment, the id of the A/B test the segment belongs to. Otherwise, empty.
*   `abtest_segment_id` (_string_) If there is only one assignment, and that assignment is an A/B test segment, the id of the A/B test segment. Otherwise, empty.
*   `active` (_boolean_) true if the individual assignment or the multiple assignments are currently active (applicable only for non default schedule assignments i.e. either campaign or A/B test schedule).
*   `active_abtest_assignments` (_array of promotion\_abtest\_group\_assignment_) A list of currently active A/B tests this is assigned to.
*   `active_campaign_assignments` (_array of promotion\_campaign\_assignment_) A list of currently active campaigns this is assigned to.
*   `campaign_id` (_string_) If there is only one assignment, and that assignment is a campaign, the id of the campaign. Otherwise, empty.
*   `enabled` (_boolean_)
*   `end_date` (_string (date-time)_) The end date of the container of the assignment (a Campaign or ABTest). If schedule\_type is schedule\_type : "multiple" or schedule\_type : "none", then then result will be null. Also, a null date will also return null.
*   `schedule` (_schedule_) The schedule of the assignment (a Campaign or ABTest). If schedule\_type is schedule\_type : "multiple" or schedule\_type : "none", then then result will be null.
*   `schedule_type` (_string_) If there is only one active assignment, or no active assignments and one upcoming assignment, this is that type of assignment (schedule\_type : "campaign" or schedule\_type : "abtest"). If there are no assignments, it will be schedule\_type : "none", otherwise, schedule\_type : "multiple".  
    Allowed values: `none`, `campaign`, `abtest`, `multiple`.
*   `start_date` (_string (date-time)_) The start date of the container of the assignment (a Campaign or ABTest). If schedule\_type is schedule\_type : "multiple" or schedule\_type : "none", then then result will be null. Also, a null date will also return null.
*   `upcoming_abtest_assignments` (_array of promotion\_abtest\_group\_assignment_) A list of upcoming A/B tests this is assigned to.
*   `upcoming_campaign_assignments` (_array of promotion\_campaign\_assignment_) A list of upcoming campaigns this is assigned to.

_Example_

```
{
  "active": true,
  "active_campaign_assignments": [
    {
      "campaign_id": "coupon-campaign",
      "coupons": [
        "limitPerCode-coupon",
        "multipleCodes-coupon",
        "longCode-coupon",
        "systemCodes-coupon",
        "limitPerTimePeriod-coupon",
        "disabled-coupon",
        "singleCode-coupon",
        "limitPerCustomer-coupon"
      ],
      "description": "Coupon Promotion",
      "link": "https://example.com/s/-/dw/data/{version}/sites/SiteGenesis/promotion_campaign_assignments/coupon-promotion/coupon-campaign",
      "promotion_id": "coupon-promotion",
      "rank": 10,
      "schedule": {}
    }
  ],
  "campaign_id": "coupon-campaign",
  "end_date": "2050-06-01T00:00:00.000Z",
  "schedule": {},
  "schedule_type": "campaign",
  "start_date": "2020-05-01T00:00:00.000Z"
}
```

### markup\_text

*   `markup` (_string_) The rendered HTML (read only)
*   `source` (_string_) The raw markup text (only this needs to be provided in update request)

### tag

Document representing a tag

*   `tag_id` (_string_) The id of the tag.

### recurrence

Document representing a schedule recurrence.

*   `day_of_week` (_array of string_) The days of week for recurrence.  
    Items: Allowed values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`. Allowed values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
*   `time_of_day` (_time\_of\_day_) The time of the day for recurrence.

_Example_

```
{
  "day_of_week": [
    "thursday",
    "sunday",
    "saturday"
  ],
  "time_of_day": {
    "time_from": "01:14:00",
    "time_to": "20:00:00"
  }
}
```

### slot\_configuration\_assignment\_information

*   `abtest_id` (_string_) If there is only one assignment, and that assignment is an A/B test segment, the id of the A/B test the segment belongs to. Otherwise, empty.
*   `abtest_segment_id` (_string_) If there is only one assignment, and that assignment is an A/B test segment, the id of the A/B test segment. Otherwise, empty.
*   `active` (_boolean_) true if the individual assignment or the multiple assignments are currently active (applicable only for non default schedule assignments i.e. either campaign or A/B test schedule).
*   `active_abtest_assignments` (_array of slot\_configuration\_abtest\_group\_assignment_) A list of currently active A/B tests this is assigned to.
*   `active_campaign_assignments` (_array of slot\_configuration\_campaign\_assignment_) A list of currently active campaigns this is assigned to.
*   `campaign_id` (_string_) If there is only one assignment, and that assignment is a campaign, the id of the campaign. Otherwise, empty.
*   `enabled` (_boolean_)
*   `end_date` (_string (date-time)_) The end date of the container of the assignment (a Campaign or ABTest). If schedule\_type is schedule\_type : "multiple" or schedule\_type : "none", then then result will be null. Also, a null date will also return null.
*   `schedule` (_schedule_) The schedule of the assignment (a Campaign or ABTest). If schedule\_type is schedule\_type : "multiple" or schedule\_type : "none", then then result will be null.
*   `schedule_type` (_string_) If there is only one active assignment, or no active assignments and one upcoming assignment, this is that type of assignment (schedule\_type : "campaign" or schedule\_type : "abtest"). If there are no assignments, it will be schedule\_type : "none", otherwise, schedule\_type : "multiple".  
    Allowed values: `none`, `campaign`, `abtest`, `multiple`.
*   `start_date` (_string (date-time)_) The start date of the container of the assignment (a Campaign or ABTest). If schedule\_type is schedule\_type : "multiple" or schedule\_type : "none", then then result will be null. Also, a null date will also return null.
*   `upcoming_abtest_assignments` (_array of slot\_configuration\_abtest\_group\_assignment_) A list of upcoming A/B tests this is assigned to.
*   `upcoming_campaign_assignments` (_array of slot\_configuration\_campaign\_assignment_) A list of upcoming campaigns this is assigned to.

_Example_

```
{
  "active": false,
  "enabled": false,
  "schedule_type": "none"
}
```

### slot\_content

Document representing the content type for a slot.

*   `body` (_object (localized)_) The HTML body (valid only for type 'html').
    
    Additional properties: `markup_text`.
    
*   `category_ids` (_array of string_) The category ids (valid only for type 'categories').
*   `content_asset_ids` (_array of string_) The content asset ids (valid only for type 'content\_assets').
*   `product_ids` (_array of string_) The product ids (valid only for type 'products').
*   `type` (_string_, required) The type of content in the slot.  
    Allowed values: `products`, `categories`, `content_assets`, `html`, `recommended_products`.

_Example_

```
{
  "type": "html"
}
```

### promotion\_abtest\_group\_assignment

Document representing a promotionabtestgroupassignment

*   `abtest_description` (_string_) The description for the ABTest assigned to the promotion in the promotionabtestgroupassignment
*   `abtest_id` (_string_) The id for the ABTest assigned to the promotion in the promotionabtestgroupassignment
*   `enabled` (_boolean_) True if the assignment resource is enabled
*   `schedule` (_schedule_) The schedule informaiton for the ABTest. Recurrence information is not supported.
*   `segment_description` (_string_) The description for the ABTest segment assigned to the promotion in the promotionabtestgroupassignment
*   `segment_id` (_string_) The id for the ABTest segment assigned to the promotion in the promotionabtestgroupassignment

### time\_of\_day

Document representing a time schedule within a single day.

*   `time_from` (_string (time)_) The time to start from. Time format: HH:mm:ss. Seconds are ignored and set to 0.
*   `time_to` (_string (time)_) The time to end on. Time format: HH:mm:ss. Seconds are ignored and set to 0.

_Example_

```
{
  "time_from": "01:14:00",
  "time_to": "20:00:00"
}
```

### slot\_configuration\_abtest\_group\_assignment

Document representing a SlotConfiguration AB test group assignment

*   `abtest_description` (_string_) The description for the ABTest assigned to the slot configuration in the SlotConfiguration AB test group assignment.
*   `abtest_id` (_string_) The id for the ABTest assigned to the slot configuration in the SlotConfiguration AB test group assignment.
*   `enabled` (_boolean_) True if the ABTest is enabled
*   `schedule` (_schedule_) The schedule information for the ABTest. Recurrence information is not supported.
*   `segment_description` (_string_) The description for the ABTest segment assigned to the slot configuration in the SlotConfiguration AB test group assignment.
*   `segment_id` (_string_) The id for the ABTest segment assigned to the slot configuration in the SlotConfiguration AB test group assignment.