> ## 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 Document Types

> Retrieve the document types available to your organization, including their identifiers for use when uploading documents.

## Endpoint

```
GET /core/document-types
```

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

## Request

This endpoint takes no path, query, or body parameters. The document types returned are scoped to the organization that owns the API key.

## Request Example

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

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

  url = "https://platform.chamelio.ai/core/document-types"
  headers = {
      "X-API-Key": "ca_your_api_key_here"
  }

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

  ```javascript JavaScript theme={null}
  const response = await fetch('https://platform.chamelio.ai/core/document-types', {
    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}
{
  "document_types": [
    {
      "document_type_id": 101,
      "name": "Master Services Agreement",
      "global_type_id": 12,
      "org_id": 5
    },
    {
      "document_type_id": 102,
      "name": "Non-Disclosure Agreement",
      "global_type_id": null,
      "org_id": 5
    }
  ]
}
```

### Response Fields

| Field            | Type  | Description                                                                                                          |
| ---------------- | ----- | -------------------------------------------------------------------------------------------------------------------- |
| `document_types` | array | List of document types available to your organization. Each entry is a [Document Type Object](#document-type-object) |

### Document Type Object

Each object in the `document_types` array contains:

| Field              | Type            | Description                                                                                                                                                     |
| ------------------ | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `document_type_id` | integer or null | Identifier of the document type. Pass this value as `document_type_id` when uploading a document via [`POST /core/upload`](/api-reference/endpoint/core/upload) |
| `name`             | string          | Human-readable name of the document type                                                                                                                        |
| `global_type_id`   | integer or null | Identifier of the global (platform-wide) document type this org-specific type maps to, if any                                                                   |
| `org_id`           | integer         | Identifier of the organization the document type belongs to                                                                                                     |

## 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 document types could not be retrieved due to a server error.

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

## Notes

<Tip>
  Call this endpoint to discover valid `document_type_id` values before uploading a document. Passing an invalid `document_type_id` to [`POST /core/upload`](/api-reference/endpoint/core/upload) returns a `400` error.
</Tip>

## Use Cases

This endpoint is useful for:

* **Document classification** - Look up the document type to assign when uploading a document
* **Validation** - Confirm a `document_type_id` is valid for your organization before uploading
* **Integration mapping** - Map your own document categories to Chamelio's document types
