> ## 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 /v2/core/document-types
```

## Authentication

This endpoint requires an OAuth access token. Send it as a bearer token:

```bash theme={null}
Authorization: Bearer your_access_token
```

**Required scope:** `sor:read`

## Request

This endpoint takes no path, query, or body parameters. The document types returned are scoped to the organization the access token belongs to.

## Request Example

```bash cURL theme={null}
curl -X GET https://platform.chamelio.ai/v2/core/document-types \
  -H "Authorization: Bearer your_access_token"
```

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

url = "https://platform.chamelio.ai/v2/core/document-types"
headers = {
    "Authorization": "Bearer your_access_token"
}

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

```javascript JavaScript theme={null}
const response = await fetch('https://platform.chamelio.ai/v2/core/document-types', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer your_access_token'
  }
});

const data = await response.json();
console.log(data);
```

## 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`](https://docs.chamelio.ai/api-reference/endpoint/v2/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

### 400 Bad Request

Returned when the access token has no user behind it.
`client_credentials` tokens act as the admin who created the application, so this applies only to
tokens issued before application creators were recorded.

```json theme={null}
{
  "detail": "client_credentials tokens are not associated with a user"
}
```

### 401 Unauthorized

Returned when the access token is missing, unknown, revoked, or expired, or when an `X-API-Key` was
sent instead of a bearer token. See [OAuth error responses](https://docs.chamelio.ai/api-reference/oauth-apps.md#error-responses).

```json theme={null}
{
  "detail": "Invalid access token"
}
```

### 403 Forbidden

Returned when the token does not carry the required scope.

```json theme={null}
{
  "detail": "Insufficient scope; this endpoint requires: sor:read"
}
```

### 429 Too Many Requests

Returned when your organization exceeds its per-minute request limit.

```json theme={null}
{
  "detail": "Rate limit exceeded"
}
```

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

## Notes

> [!NOTE]
>
> The result is organization-global and is not filtered per user. A user who may reach only some
> document types still sees every name here - the token's user is used only to authenticate and
> scope-check the request.

> [!TIP]
>
> Call this endpoint to discover valid `document_type_id` values before uploading a document. Passing an invalid `document_type_id` to [`POST /v2/core/upload`](https://docs.chamelio.ai/api-reference/endpoint/v2/core/upload) returns a `400` error.

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