> ## 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.

# Sync Client Rule

> Pull one CRM's clients now

Pulls the CRM's clients now with the saved rule, the app's **Sync now**, instead
of waiting for the nightly sync. It answers `202` when a pull started, and `200`
with `started: false` and a `reason` when it did not:

| `reason` | Meaning |
| - | - |
| `no_rule` | No rule is set for this CRM, or it is disabled |
| `running` | A pull is already under way; its result will show up when it ends |

The two safeguards on every pull apply: a pull that stops before the end removes
nothing, and one that would remove more than half of that CRM's clients while the
rule has not changed is held. See [CRM rule](https://docs.clustr-ai.com/client-companies.md#crm-rule).

```bash cURL theme={null}
curl -X POST https://api.clustr-ai.com/api/public/client-companies/rule/hubspot/sync \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```json 202 theme={null}
{
  "success": true,
  "data": { "started": true }
}
```

```json 200 theme={null}
{
  "success": true,
  "data": { "started": false, "reason": "running" }
}
```


## OpenAPI

````yaml POST /client-companies/rule/{provider}/sync
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:
  /client-companies/rule/{provider}/sync:
    parameters:
      - $ref: '#/components/parameters/ClientRuleProvider'
    post:
      tags:
        - Client Companies
      summary: Sync Client Rule
      description: |
        Pull this CRM's clients now with the saved rule, instead of waiting for
        the nightly sync.
      operationId: syncClientRule
      responses:
        '200':
          description: The sync did not start, and the response gives the reason
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      started:
                        type: boolean
                        example: false
                      reason:
                        type: string
                        enum:
                          - no_rule
                          - running
                        description: >-
                          `no_rule`: no client rule is saved for this CRM.
                          `running`: a pull is already under way.
        '202':
          description: Started
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      started:
                        type: boolean
                        example: true
        '401':
          description: Invalid or missing API key
        '404':
          description: >-
            The CRM is not connected (`CRM_NOT_CONNECTED`), or the provider is
            unknown
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    ClientRuleProvider:
      name: provider
      in: path
      required: true
      schema:
        type: string
        enum:
          - hubspot
          - salesforce
          - attio
      description: >-
        The CRM whose client rule to use. It must be connected to your
        workspace.
  schemas:
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            message:
              type: string
              example: Invalid request body
            code:
              type: string
              example: BAD_REQUEST
  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.