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

# List Client Rule Fields

> The CRM company properties a client rule can use

Lists the company properties of a connected CRM that a
[client rule](https://docs.clustr-ai.com/api-reference/set-client-rule.md) can use, read live from the CRM.
Each has its API `name` (for `field`), `label`, `type` (for `fieldType`) and,
for a dropdown, its `options` (whose `value`s go in `values`).

For Attio, the response also carries `dealStages`, the deal stages a won deal can
mean. Pass the `id`s you want in `wonStages`. If the stages could not be read,
`dealStages` is empty and `dealStagesUnavailable` is `true`; the properties are
still listed.

## Errors

| Status | Code | When |
| - | - | - |
| 404 | `CRM_NOT_CONNECTED` | That CRM is not connected for this workspace |
| 502 | `CRM_UNAVAILABLE`, `CRM_SCHEMA_UNAVAILABLE` | The CRM or its company schema could not be reached |

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

```json 200 theme={null}
{
  "success": true,
  "data": {
    "fields": [
      {
        "name": "customer_status",
        "label": "Customer status",
        "type": "single_select",
        "options": [
          { "value": "active", "label": "Active" },
          { "value": "churned", "label": "Churned" }
        ]
      },
      { "name": "is_customer", "label": "Is customer", "type": "boolean", "options": [] }
    ],
    "dealStages": [
      { "id": "8f2c...", "title": "Won", "archived": false },
      { "id": "1a7d...", "title": "Lost", "archived": false }
    ]
  }
}
```


## OpenAPI

````yaml GET /client-companies/rule/{provider}/fields
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}/fields:
    parameters:
      - $ref: '#/components/parameters/ClientRuleProvider'
    get:
      tags:
        - Client Companies
      summary: List Client Rule Fields
      description: |
        The company properties a client rule can use, with their type and
        options. For Attio, also `dealStages`: the deal stages a won deal can
        mean, whose ids go in `wonStages`.
      operationId: listClientRuleFields
      responses:
        '200':
          description: The fields
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      fields:
                        type: array
                        items:
                          type: object
                          additionalProperties: true
                          properties:
                            name:
                              type: string
                              description: The property's API name, for `field`.
                            label:
                              type: string
                            type:
                              type: string
                              enum:
                                - boolean
                                - single_select
                                - multi_select
                                - text
                            options:
                              type: array
                              items:
                                type: object
                                properties:
                                  value:
                                    type: string
                                  label:
                                    type: string
                      dealStages:
                        type: array
                        description: Attio only. The deal stages, for `wonStages`.
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: The stage id, for `wonStages`.
                            title:
                              type: string
                              description: The stage name, for `wonStageLabels`.
                            archived:
                              type: boolean
                      dealStagesUnavailable:
                        type: boolean
                        description: >-
                          Attio only. True when the deal stages could not be
                          read. The fields are still returned.
        '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'
        '502':
          description: >-
            The CRM or its company schema could not be reached
            (`CRM_UNAVAILABLE`, `CRM_SCHEMA_UNAVAILABLE`)
          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.