# Campaigns API

## createCampaign

`POST` `https://api.pushwoosh.com/json/1.3/createCampaign`

Creates a push campaign within the app.

#### Request Body

| Name                                          | Type   | Description                                    |
| --------------------------------------------- | ------ | ---------------------------------------------- |
| auth\*        | string | [API access token](/developer/api-reference/api-identifiers/#api-access-token) from Pushwoosh Control Panel. |
| application\* | string | [Pushwoosh application code](/developer/api-reference/api-identifiers/#application-code)                  |
| name\*        | string | Campaign name.                                 |
| description                                   | string | Campaign description.                          |

<Tabs>
<TabItem label="200">
```json
{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "campaign": "XXXXX-XXXXX"
  }
}
```
</TabItem>
</Tabs>



```json
{
  "request": {
    "auth": "yxoPUlwqm…………pIyEX4H",       // required. API access token from Pushwoosh Control Panel
    "application": "XXXXX-XXXXX",         // required. Pushwoosh application code
    "name": "CAMPAIGN_NAME",              // required.
    "description": "CAMPAIGN_DESCRIPTION" // optional.
  }
}
```

## deleteCampaign

`POST` `https://api.pushwoosh.com/json/1.3/deleteCampaign`

Deletes a particular campaign.

#### Request Body

| Name                                       | Type   | Description                                    |
| ------------------------------------------ | ------ | ---------------------------------------------- |
| auth\*     | string | [API access token](/developer/api-reference/api-identifiers/#api-access-token) from Pushwoosh Control Panel. |
| campaign\* | string | [Code of a campaign](/developer/api-reference/api-identifiers/#campaign-code) to delete.                    |

<Tabs>
<TabItem label="200">
```json
{
  "status_code": 200,
  "status_message": "OK",
  "response": null
}
```
</TabItem>
</Tabs>



```json title="Example"
{
  "request": {
    "auth": "yxoPUlwqm…………pIyEX4H", // required. API access token from Pushwoosh Control Panel
    "campaign": "XXXXX-XXXXX"       // required. ID of a campaign to delete
  }
}
```

## getCampaigns

`POST` `https://api.pushwoosh.com/json/1.3/getCampaigns`

Retrieves the list of campaigns for the app.

#### Request Body

| Name                                          | Type    | Description                                                     |
| --------------------------------------------- | ------- | --------------------------------------------------------------- |
| auth\*        | string  | [API access token](/developer/api-reference/api-identifiers/#api-access-token) from Pushwoosh Control Panel.                  |
| application\* | string  | [Pushwoosh application code](/developer/api-reference/api-identifiers/#application-code)                                   |
| cursor                                        | string  | Indicates the last campaign retrieved in the previous request.  |
| limit                                         | integer | The max number of campaigns for a single response.              |

<Tabs>
<TabItem label="200">
```json
{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "campaigns": [{
      "code": "7CFF3-63A7B",
      "name": "CAMPAIGN_NAME_1",
      "description": "DESCRIPTION1"
    }, {
      "code": "C284C-33DD3",
      "name": "CAMPAIGN_NAME_2",
      "description": "DESCRIPTION2"
    }],
    "limit": 100,
    "cursor": "+4PxJPhhwITD4PFsiKui1BA=="
  }
}
```
</TabItem>
</Tabs>

```json title="Example"
{
  "request": {
    "auth": "jLbec2UW........ztFSOf5Za",   // required. API access token from Pushwoosh Control Panel
    "application": "XXXXX-XXXXX",          // required. Pushwoosh application code
    "cursor": "+4PxJPhhwITD4PFsiKui1BA==", // optional. Indicates the last campaign retrieved in the previous request.
    "limit": 100                           // optional. The max number of campaigns
                                           //           for a single response.
  }
}
```