> ## 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](https://docs.clustr-ai.com/api-reference/set-account-state.md), applied
to every id in `company_ids`. Up to 1000 accounts in one call.

Tags across a selection go through
[Bulk Set Record Tags](https://docs.clustr-ai.com/api-reference/bulk-set-record-tags.md) instead.

```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": ["acc_rvvwwmsy2037szdrzy7gjt390z", "acc_sh25p7wy33yek2q7xhs0fm0hdg"],
    "owner_id": "own_3gp4h4j95n3atvhqh02y941x4t",
    "push_to_crm": true
  }'
```

```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" }
}
```


## OpenAPI

````yaml POST /account-states/bulk
openapi: 3.1.0
info:
  title: Clustr Public API
  description: >
    Programmatic access to your Clustr network: import connectors, search warm
    intros (opportunities), and manage target accounts.


    ## Authentication

    All endpoints require a Bearer token (API key) in the `Authorization`
    header.


    ```

    Authorization: Bearer <your_api_key>

    ```


    API keys can be created and managed from the [API settings
    page](https://app.clustr-ai.com/api).
  version: '1.0'
  contact:
    name: Clustr Support
    url: https://clustr-ai.com
servers:
  - url: https://api.clustr-ai.com/api/public
    description: Production
security:
  - BearerAuth: []
paths:
  /account-states/bulk:
    post:
      tags:
        - Account States
      summary: Bulk Set Account State
      description: >-
        Applies the same changes to every company in a selection, up to 1000 at
        once. Only the

        fields you send change. More than 1000 companies answers 400.


        Set tags across a selection with PUT /record-tags/bulk.
      operationId: bulkSetAccountStates
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkSetAccountStateRequest'
      responses:
        '200':
          description: How many accounts were updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      updated:
                        type: integer
                        description: How many accounts were updated.
                      intros_moved:
                        type: integer
                        description: >-
                          How many warm intros followed an `is_discarded`
                          change, across the whole

                          selection.
                      crmPush:
                        allOf:
                          - $ref: '#/components/schemas/CRMPushOutcome'
                        description: >-
                          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.
                      csCrmPush:
                        allOf:
                          - $ref: '#/components/schemas/CRMPushOutcome'
                        description: >-
                          The same as `crmPush`, for the CS owner: present only
                          when `cs_owner_id`

                          was written and the CRM was involved.
                      fits:
                        type: object
                        description: >-
                          Each account's grade after this write, recomputed
                          before the response, keyed by company UUID. Accounts
                          with no grade are omitted.
                        additionalProperties:
                          $ref: '#/components/schemas/AccountFit'
        '400':
          description: Invalid company_ids, or a referenced tier or owner does not exist
        '401':
          description: Invalid or missing API key
components:
  schemas:
    BulkSetAccountStateRequest:
      type: object
      properties:
        filters:
          type: object
          additionalProperties: true
          description: >-
            In place of `company_ids`: the query of the Accounts list (the
            filters of List Accounts, as an object of parameter to value or
            values). The change applies to every account that query matches.
            Send exactly one of `company_ids` and `filters`.
        intros:
          type: string
          enum:
            - follow
            - keep
          description: >-
            What an `is_discarded` change does to the warm intros at the
            account: `follow` (the default) carries it onto them, `keep` leaves
            them as they are.
        company_ids:
          type: array
          description: >-
            Up to 1,000 account Clustr IDs (`acc_…`). A longer list returns
            `400`. The `company_id` values

            from earlier responses also work.
          maxItems: 1000
          items:
            type: string
        tier_id:
          type: string
          nullable: true
          description: >-
            A tier's Clustr ID (`tier_…`), or `""` to clear. The id from earlier
            responses also works.
        owner_id:
          type: string
          nullable: true
          description: >-
            An owner's Clustr ID (`own_…`), or `""` to clear. The id from
            earlier responses also works.
        cs_owner_id:
          type: string
          nullable: true
          description: >-
            The CS owner: an owner's Clustr ID (`own_…`), or `""` to clear. The
            id from earlier responses

            also works.
        is_discarded:
          type: boolean
        notes:
          type: string
        dismiss_reason:
          type: string
          description: >-
            Why these accounts are dismissed, sent with is_discarded true. Every
            account in the selection records the same reason, stored apart from
            its note. Sent on its own, it updates the reason already recorded.
            On a restore the last reason stays recorded.
          example: Already a customer of a partner
        push_to_crm:
          type: boolean
          default: false
          description: >-
            Also write the owner to each matched CRM company. It applies when
            `owner_id` sets an

            owner; clearing an owner stays in Clustr. `pushToCrm` is the same
            flag.
        pushToCrm:
          type: boolean
          description: The same flag as `push_to_crm`.
        status_id:
          type: string
          nullable: true
          description: >-
            The Clustr ID (`tag_…`) of the account tag that holds this status.
            It writes that tag on every

            selected account. PUT /record-tags/bulk sets any tag. The id from
            earlier responses also works.
    CRMPushOutcome:
      type: object
      description: >-
        What an owner write did in the connected CRM. The owner is saved in
        Clustr whatever this says.
      properties:
        status:
          type: string
          enum:
            - pushed
            - refused
            - failed
            - skipped
        reason:
          type: string
          description: >-
            A machine code when the push did not land: direction_crm_owns,
            direction_off, no_owner_field, writes_disabled, owner_not_in_crm,
            owner_deactivated, record_not_found, record_not_matched,
            clear_not_pushed, crm_not_connected, invalid_request,
            provider_error, owner_lookup_failed.
        message:
          type: string
          description: One sentence written for a person.
        provider:
          type: string
          description: The CRM written to.
        pushed:
          type: integer
          description: How many records were written in the CRM.
        notPushed:
          type: integer
          description: How many records the push did not cover.
    AccountFit:
      type: object
      description: >-
        An account's grade and what produced it, in the same four fields a row
        of GET /accounts

        carries. Tier and dismissal both feed the grade, so a write that sets
        either answers

        with the recomputed grade, ready to use without reading the account
        again.


        Omitted when the account has no grade, which means the workspace has
        configured no

        targeting yet.
      properties:
        fit_grade:
          type: string
          enum:
            - A+
            - A
            - B
            - C
            - D
        fit_score:
          type: number
          description: >-
            The share of the configured criterion weight this account meets,
            from 0 to 1. It reflects this workspace's own criteria, so compare
            scores within one workspace.
        fit_reasons:
          type: array
          items:
            type: string
          description: >-
            What produced the grade: the matched ICP's title, then each
            criterion met.
        fit_breakdown:
          type: object
          description: Every configured criterion behind the grade, met or not.
          properties:
            icp_id:
              type: string
              description: The Company ICP the dimensions were scored against.
            icp_title:
              type: string
            discarded:
              type: boolean
              description: >-
                True when the account is dismissed, which sets the score to
                zero.
            parts:
              type: array
              items:
                type: object
                properties:
                  key:
                    type: string
                    enum:
                      - target
                      - tier
                      - industry
                      - headcount
                      - revenue
                      - country
                  label:
                    type: string
                  weight:
                    type: number
                    description: Points this criterion is worth.
                  earned:
                    type: number
                    description: Points the account earned on it, from 0 to `weight`.
                  status:
                    type: string
                    enum:
                      - met
                      - partial
                      - missed
                      - unknown
                      - unset
                    description: >-
                      How the account did on this criterion. `unknown` means
                      Clustr holds no value for this company, and `unset` means
                      nobody has set a curated criterion (the target list or the
                      tier) on this account. Both are left out of the score;
                      only `missed` counts against it.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: The API key you created on the API settings page of the Clustr app.

````

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