> ## Documentation Index
> Fetch the complete documentation index at: https://cpaas.fireflo.au/llms.txt
> Use this file to discover all available pages before exploring further.

# PATCH /v1/cdp/audiences/{audience_id}

> Rename an audience, or change its rules — who is in it is then worked out again.

Renames an audience, changes its description, or changes its rules. Send only what changes. New rules make it `building` while who is in it is worked out again; people who no longer match leave it.

> [!NOTE]
>
> Needs the `cdp.audiences:write` scope.

## Path parameters

| Field | Type | Required | Notes |
| :- | :- | :- | :- |
| `audience_id` | string | Yes | The audience's id. |

## Body

| Field | Type | Required | Notes |
| :- | :- | :- | :- |
| `name` | string | No | Up to 120 characters, and not another audience's name. |
| `description` | string | No | Up to 300 characters. |
| `rules` | object | No | The new rules, whole — as [POST /v1/cdp/audiences](https://cpaas.fireflo.au/api-reference/customer-data/create-audience.md#rules) describes. |

## Request

```bash cURL theme={null}
curl -X PATCH "https://api.fireflo.au/v1/cdp/audiences/5b2e8d14-7c3a-4f9e-a1d6-3e8b0c4f2a71" \
  -H "Authorization: Bearer $OMNI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "rules": {
      "match": "all",
      "conditions": [
        {
          "type": "event",
          "op": "did",
          "name": "cart_added",
          "days": 3
        },
        {
          "type": "event",
          "op": "did_not",
          "name": "order_placed",
          "days": 3
        },
        {
          "type": "consent",
          "channel": "whatsapp",
          "purpose": "marketing"
        }
      ]
    }
  }'
```

```python Python theme={null}
import os

import requests

response = requests.patch(
    "https://api.fireflo.au/v1/cdp/audiences/5b2e8d14-7c3a-4f9e-a1d6-3e8b0c4f2a71",
    headers={"Authorization": f"Bearer {os.environ['OMNI_API_KEY']}"},
    json={
        "rules": {
            "match": "all",
            "conditions": [
                {
                    "type": "event",
                    "op": "did",
                    "name": "cart_added",
                    "days": 3,
                },
                {
                    "type": "event",
                    "op": "did_not",
                    "name": "order_placed",
                    "days": 3,
                },
                {
                    "type": "consent",
                    "channel": "whatsapp",
                    "purpose": "marketing",
                },
            ],
        },
    },
)
print(response.status_code, response.json())
```

```javascript Node theme={null}
const response = await fetch("https://api.fireflo.au/v1/cdp/audiences/5b2e8d14-7c3a-4f9e-a1d6-3e8b0c4f2a71", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.OMNI_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "rules": {
      "match": "all",
      "conditions": [
        {
          "type": "event",
          "op": "did",
          "name": "cart_added",
          "days": 3
        },
        {
          "type": "event",
          "op": "did_not",
          "name": "order_placed",
          "days": 3
        },
        {
          "type": "consent",
          "channel": "whatsapp",
          "purpose": "marketing"
        }
      ]
    }
  }),
});
console.log(response.status, await response.json());
```

## Response

`200 OK` — the audience as it now is.

```json theme={null}
{
  "id": "5b2e8d14-7c3a-4f9e-a1d6-3e8b0c4f2a71",
  "name": "Carts left this week",
  "description": "Added to cart in the last 7 days and didn't order",
  "status": "building",
  "error": "",
  "members": 312,
  "refreshed_at": "2026-10-06T10:15:02+05:30",
  "created_at": "2026-09-22T11:04:37+05:30",
  "updated_at": "2026-10-06T11:20:08+05:30",
  "rules": {
    "match": "all",
    "conditions": [
      {
        "type": "event",
        "op": "did",
        "name": "cart_added",
        "days": 3
      },
      {
        "type": "event",
        "op": "did_not",
        "name": "order_placed",
        "days": 3
      },
      {
        "type": "consent",
        "channel": "whatsapp",
        "purpose": "marketing"
      }
    ]
  }
}
```

## Errors

Every refusal is `{"error": {"code", "message", "field"}}`; `field` is there when one input is at fault.

| Status | Error code | When |
| :- | :- | :- |
| 404 | `not_found` | No audience of this account's has that id. |
| 400 | `invalid_request` | `field` names `name` (empty, or another audience has it) or `rules` (the message says what's wrong). |
| 403 | `scope_missing` | The key doesn't have the `cdp.audiences:write` scope. |
| 404 | `module_off` | The account doesn't have Customer data on. |

Any request can also be refused for its key, its account or its rate (`key_required`, `invalid_key`, `account_suspended`, `plan_excludes_api`, `address_not_allowed`, `rate_limited`); see [the overview](https://cpaas.fireflo.au/api-reference/overview.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.