# Create a change feed subscription
Source: https://www.desktopaccountingapi.com/docs/api/reference/operations/changefeedsubscriptionscreate/

`POST https://api.desktopaccountingapi.com/v1/change-feed-subscriptions`

Operation ID: `changeFeedSubscriptions.create`. Tag: Change feed.

Starts polling every connected end user of this project for changes to the listed resources. Each poll reads the watched resources changed since the previous poll (with a 2-minute overlap for the QuickBooks computer's clock) and the deleted ones, and sends one or more `data.changed` events with their IDs only. Subscribe a webhook endpoint to `data.changed` to receive them. Polls never run ahead of your own requests, and a connection that is offline, disabled or holding a write whose outcome is unknown is skipped and caught up later. A successful poll of a production company file counts as a data request for billing, like your own reads; sample company files, exempt files and test projects are free. See [Change feed](https://www.desktopaccountingapi.com/docs/guides/change-feed/). Changes made before the subscription (or a resource) was added are not included. A project can have up to 10 subscriptions.

Authentication: `Authorization: Bearer <secret key>`.

Example request:

```sh
curl -X POST https://api.desktopaccountingapi.com/v1/change-feed-subscriptions \
  -H "Authorization: Bearer $DAAPI_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"resources":["customers","invoices"]}'
```

## Headers

- `Idempotency-Key` (string): Makes a write safe to retry. Repeating a key with the same request attaches to or replays the original instead of creating a second one. 1–255 printable ASCII characters, retained 7 days. Reusing a key with a different request returns `422 IDEMPOTENCY_KEY_REUSED`. 1–255 characters; example `6f1c2a0e-1f7e-4c55-9a7a-0b2d2c9e3a10`.

## Request body (application/json, required)

- `resources` (array of string, required): Resources to watch, each listed once. Every poll reads each of them on every subscribed connection. 1–62 items.
- `intervalMinutes` (integer): Minutes between polls of each connection, 15 to 1440. Polls run on a 15-minute schedule, so a connection is polled at the first run after its interval has passed; when several subscriptions watch the same resource, the shortest interval applies. 15 to 1440; default `15`; example `15`.
- `enabled` (boolean): Poll connections. Default `true`. default `true`.

Minimal example:

```json
{
  "resources": [
    "customers",
    "invoices"
  ]
}
```

## Responses

### 201

The created subscription.

Body (application/json): object (ChangeFeedSubscription).

- `id` (string, required): Unique identifier for the change feed subscription. example `cfs_01j9x4m6v4c8k2t7q0r5s3w1zk`.
- `objectType` (string, required): Always `change_feed_subscription`. one of `change_feed_subscription`.
- `createdAt` (string (date-time), required): When the subscription was created. UTC, ISO 8601 with milliseconds. example `2026-10-05T16:03:59.002Z`.
- `updatedAt` (string (date-time), required): When the subscription was last changed. UTC, ISO 8601 with milliseconds. example `2026-10-05T16:03:59.002Z`.
- `projectId` (string, required): Unique identifier for the project. example `proj_01j9x4m6v4c8k2t7q0r5s3w1zf`.
- `resources` (array of string, required): Watched resources, in alphabetical order.
- `intervalMinutes` (integer, required): Minutes between polls of each connection. example `15`.
- `enabled` (boolean, required): Whether connections are polled. A disabled subscription keeps its settings.

### Errors

Every error body is the error object described at https://www.desktopaccountingapi.com/docs/errors/.

- `400`: The request is invalid. Codes: `UNKNOWN_HEADER`, `INVALID_JSON`, `INVALID_PARAMETER`, `UNKNOWN_PARAMETER`, `IDEMPOTENCY_KEY_INVALID`.
- `401`: The API key is missing or invalid. Codes: `API_KEY_MISSING`, `API_KEY_INVALID`.
- `403`: The operation is not permitted. Codes: `API_KEY_READ_ONLY`.
- `422`: The request is well formed but cannot be processed. Codes: `IDEMPOTENCY_KEY_REUSED`, `CHANGE_FEED_SUBSCRIPTION_LIMIT_REACHED`.
- `429`: Too many requests. Codes: `RATE_LIMITED`.
- `500`: Unexpected server error. Codes: `INTERNAL_ERROR`.
- `503`: QuickBooks Desktop or the service is not available. Codes: `SERVICE_UNAVAILABLE`.
