> ## Documentation Index
> Fetch the complete documentation index at: https://docs.clustr-ai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bulk Set Account State

> Apply the same patch across a selection of accounts

Same fields as [Set Account State](/api-reference/set-account-state), applied
to every id in `company_ids`. Up to 1000 accounts in one call.

Tags across a selection go through
[Bulk Set Record Tags](/api-reference/bulk-set-record-tags) instead.

## Body

<ParamField body="company_ids" type="string[]" required>
  Up to 1000 company UUIDs. More is a `400`, not a truncation.
</ParamField>

<ParamField body="tier_id" type="string">A tier id, or `""` to clear.</ParamField>
<ParamField body="owner_id" type="string">An owner id, or `""` to clear.</ParamField>

<ParamField body="is_discarded" type="boolean" />

<ParamField body="notes" type="string" />

<ParamField body="push_to_crm" type="boolean" default="false">
  Also write the owner to each matched CRM company. Ignored without `owner_id`;
  a cleared owner is never pushed. `pushToCrm` is the same flag.
</ParamField>

<ParamField body="status_id" type="string" deprecated>
  **Deprecated — a status is a tag.** It writes the account tag the former
  status became. Use
  [Bulk Set Record Tags](/api-reference/bulk-set-record-tags).
</ParamField>

## Response Fields

<ResponseField name="updated" type="integer">
  How many account-state rows were written.
</ResponseField>

<ResponseField name="intros_moved" type="integer">
  How many warm intros followed an `is_discarded` change, across the whole
  selection.
</ResponseField>

<ResponseField name="crmPush" type="object">
  Present only when an owner was written and the CRM was involved. Same shape as
  on [Set Account State](/api-reference/set-account-state); `pushed` and
  `notPushed` count records across the selection.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.clustr-ai.com/api/public/account-states/bulk" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "company_ids": ["9c4d5e6f-1a2b-4c3d-8e9f-0a1b2c3d4e5f", "7a1b2c3d-4e5f-4061-8a2b-3c4d5e6f7081"],
      "owner_id": "3f2b1c40-8a11-4f2e-9d61-0f5a8c7a2b13",
      "push_to_crm": true
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "data": {
      "updated": 2,
      "intros_moved": 0,
      "crmPush": {
        "status": "pushed",
        "provider": "hubspot",
        "pushed": 1,
        "notPushed": 1,
        "message": "one account is not matched to a HubSpot company"
      }
    }
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": { "message": "cannot update more than 1000 accounts at once", "code": "BAD_REQUEST" }
  }
  ```
</ResponseExample>
