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

# List Org Fields

> Retrieve the org fields configured for your organization, optionally including the mapped attributes available for document uploads.

## Endpoint

```
GET /core/org-fields
```

## Authentication

This endpoint requires authentication via API key. Include your API key in the `X-API-Key` header:

```bash theme={null}
X-API-Key: ca_your_api_key_here
```

## Query Parameters

| Parameter            | Type    | Required | Description                                                                                                                |
| -------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------- |
| `include_attributes` | boolean | No       | When `true`, the response also includes the `attributes` array of mapped fields available for uploads. Defaults to `false` |

## Request Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://platform.chamelio.ai/core/org-fields?include_attributes=true" \
    -H "X-API-Key: ca_your_api_key_here"
  ```

  ```python Python theme={null}
  import requests

  url = "https://platform.chamelio.ai/core/org-fields"
  headers = {
      "X-API-Key": "ca_your_api_key_here"
  }
  params = {
      "include_attributes": True
  }

  response = requests.get(url, headers=headers, params=params)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://platform.chamelio.ai/core/org-fields?include_attributes=true', {
    method: 'GET',
    headers: {
      'X-API-Key': 'ca_your_api_key_here'
    }
  });

  const data = await response.json();
  console.log(data);
  ```
</CodeGroup>

## Response

### Success Response

**Status Code:** `200 OK`

```json theme={null}
{
  "org_fields": [
    {
      "org_field_id": 301,
      "name": "Governing Law",
      "field_value_type": "enum",
      "field_scope": "global",
      "description": "The jurisdiction whose laws govern the agreement",
      "enum_values": ["Delaware", "New York", "California"],
      "document_types": ["Master Services Agreement", "Non-Disclosure Agreement"]
    },
    {
      "org_field_id": 302,
      "name": "Effective Date",
      "field_value_type": "date",
      "field_scope": "global",
      "description": null,
      "enum_values": null,
      "document_types": null
    }
  ],
  "attributes": [
    {
      "name": "contract_type",
      "field_type": "text"
    },
    {
      "name": "renewal_date",
      "field_type": "date"
    }
  ]
}
```

### Response Fields

| Field        | Type          | Description                                                                                                                                                            |
| ------------ | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `org_fields` | array         | List of org fields configured for your organization. Each entry is an [Org Field Object](#org-field-object)                                                            |
| `attributes` | array or null | List of mapped attributes available for uploads. Present only when `include_attributes=true`; otherwise `null`. Each entry is an [Attribute Object](#attribute-object) |

### Org Field Object

Each object in the `org_fields` array contains:

| Field              | Type           | Description                                                                           |
| ------------------ | -------------- | ------------------------------------------------------------------------------------- |
| `org_field_id`     | integer        | Unique identifier of the org field                                                    |
| `name`             | string         | Human-readable name of the field                                                      |
| `field_value_type` | string         | Type of the field value. One of `text`, `enum`, `number`, `boolean`, `date`, `clause` |
| `field_scope`      | string         | Scope the field applies to within your organization                                   |
| `description`      | string or null | Optional description of the field                                                     |
| `enum_values`      | array or null  | Allowed values when `field_value_type` is `enum`; otherwise `null`                    |
| `document_types`   | array or null  | Names of the document types this field applies to, if restricted; otherwise `null`    |

### Attribute Object

Each object in the `attributes` array contains:

| Field        | Type   | Description                                                               |
| ------------ | ------ | ------------------------------------------------------------------------- |
| `name`       | string | Name of the mapped attribute                                              |
| `field_type` | string | Type of the attribute. One of `text`, `number`, `boolean`, `date`, `link` |

## Error Responses

### 401 Unauthorized

Returned when authentication fails. See the [authentication errors](/api-reference/introduction#authentication-errors) section for details.

```json theme={null}
{
  "detail": "Invalid API key"
}
```

### 500 Internal Server Error

Returned when the org fields could not be retrieved due to a server error.

```json theme={null}
{
  "detail": "Failed to fetch org fields: Internal processing error"
}
```

## Notes

<Tip>
  Use the `org_field_id` and `field_value_type` values returned here to populate `field_overrides` when uploading a document via [`POST /core/upload`](/api-reference/endpoint/core/upload).
</Tip>

## Use Cases

This endpoint is useful for:

* **Field discovery** - Look up the org fields configured for your organization and their value types
* **Override mapping** - Retrieve valid `org_field_id` values before setting `field_overrides` on an upload
* **Attribute mapping** - Discover the mapped attributes available to attach to documents
