Skip to main content

Endpoint

GET /core/document-types

Authentication

This endpoint requires authentication via API key. Include your API key in the X-API-Key header:
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

curl -X GET https://platform.chamelio.ai/core/document-types \
  -H "X-API-Key: ca_your_api_key_here"
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())
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);

Response

Success Response

Status Code: 200 OK
{
  "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

FieldTypeDescription
document_typesarrayList of document types available to your organization. Each entry is a Document Type Object

Document Type Object

Each object in the document_types array contains:
FieldTypeDescription
document_type_idinteger or nullIdentifier of the document type. Pass this value as document_type_id when uploading a document via POST /core/upload
namestringHuman-readable name of the document type
global_type_idinteger or nullIdentifier of the global (platform-wide) document type this org-specific type maps to, if any
org_idintegerIdentifier of the organization the document type belongs to

Error Responses

401 Unauthorized

Returned when authentication fails. See the authentication errors section for details.
{
  "detail": "Invalid API key"
}

500 Internal Server Error

Returned when the document types could not be retrieved due to a server error.
{
  "detail": "Failed to fetch document types: Internal processing error"
}

Notes

Call this endpoint to discover valid document_type_id values before uploading a document. Passing an invalid document_type_id to POST /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