# Update ad status

> Activate, pause, or resume an ad or ad set.

Canonical: <https://www.tryadeli.com/docs/api/ads/update-status>

`PUT https://app.tryadeli.com/api/v1/ads/status`

Authorization: `Bearer <API key>` — see [Authentication](https://www.tryadeli.com/docs/authentication)

Sets an ad's or ad set's delivery status. Activating an ad is what starts
spending.

**Body**

| Name               | Type     | Required | Description                                                                                   |
| ------------------ | -------- | -------- | --------------------------------------------------------------------------------------------- |
| `adAccountId`      | `string` | Yes      | The ad account the object belongs to.                                                         |
| `objectId`         | `string` | Yes      | An ad or ad set id.                                                                           |
| `status`           | `string` | Yes      | ACTIVE or PAUSED.                                                                             |
| `campaignRecordId` | `uuid`   |          | Keeps Adeli's campaign record in step when the object came from POST `/api/v1/ads/campaigns`. |

## Request examples

**cURL**

```bash
curl --fail-with-body -X PUT "https://app.tryadeli.com/api/v1/ads/status?accountId=00000000-0000-0000-0000-000000000000" \
  -H "Authorization: Bearer $ADELI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "adAccountId": "act_1234567890",
  "objectId": "120210000000000004",
  "status": "PAUSED",
  "campaignRecordId": "00000000-0000-4000-8000-000000000020"
}'
```

**JavaScript**

```javascript
const response = await fetch("https://app.tryadeli.com/api/v1/ads/status?accountId=00000000-0000-0000-0000-000000000000", {
  method: "PUT",
  headers: {
    Authorization: `Bearer ${process.env.ADELI_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    adAccountId: "act_1234567890",
    objectId: "120210000000000004",
    status: "PAUSED",
    campaignRecordId: "00000000-0000-4000-8000-000000000020",
  }),
});
console.log(await response.json());
```

**Python**

```python
import os

import requests

response = requests.put(
    "https://app.tryadeli.com/api/v1/ads/status",
    headers={"Authorization": f"Bearer {os.environ['ADELI_API_KEY']}"},
    params={
        "accountId": "00000000-0000-0000-0000-000000000000",
    },
    json={
        "adAccountId": "act_1234567890",
        "objectId": "120210000000000004",
        "status": "PAUSED",
        "campaignRecordId": "00000000-0000-4000-8000-000000000020",
    },
)
print(response.json())
```

## Responses

### 200

```json
{
  "platform": "facebook",
  "accountId": "00000000-0000-0000-0000-000000000000",
  "objectId": "120210000000000004",
  "status": "PAUSED"
}
```

### 404

```json
{
  "error": {
    "code": "account_not_found",
    "message": "Ad account is not available to this connection"
  }
}
```
