COUNTCOUNT
Sign Up
DocumentsList document types

List document types

GET/partners/document-types

Returns the document types this workspace can use, grouped by type group.

Includes COUNT's built-in types for the workspace's country and the custom types the workspace created in COUNT. A built-in group with no type for the workspace's country is left out. `isSystem` is true for COUNT's built-in types and groups; `aiDescription` (the instructions COUNT's classifier follows) appears on the workspace's own types only. Not paginated.

HMAC signature + Bearer access token
Try this request

Responses

200Type groups with their types under data.documentTypeGroups.
401Missing or invalid HMAC signature, expired timestamp, or invalid Bearer token. Troubleshoot
403The credential does not have access to this workspace or resource. Troubleshoot
429Rate limit exceeded (100 requests per minute per clientId). Retry after the Retry-After header. Troubleshoot
GEThttps://api.getcount.com/partners/document-types
Request
import crypto from 'node:crypto';

const BASE_URL = 'https://api.getcount.com';
const CLIENT_ID = process.env.COUNT_CLIENT_ID;
const CLIENT_SECRET = process.env.COUNT_CLIENT_SECRET;
const ACCESS_TOKEN = process.env.COUNT_ACCESS_TOKEN;

const method = 'GET';
const signingPath = '/document-types';
const timestamp = Math.floor(Date.now() / 1000).toString();
const bodyString = '';

const bodyHash = '';
const baseString = `${method}:${signingPath}:${timestamp}:${bodyHash}`;
const signature = crypto.createHmac('sha256', CLIENT_SECRET).update(baseString).digest('hex');

const response = await fetch(`${BASE_URL}/partners/document-types`, {
  method,
  headers: {
    'x-client-id': CLIENT_ID,
    'x-timestamp': timestamp,
    'x-signature': signature,
    Authorization: `Bearer ${ACCESS_TOKEN}`,
  },
});

console.log(await response.json());
Response · 200
{
  "status": "success",
  "data": {
    "documentTypeGroups": [
      {
        "id": "a11040f7-ecda-43ee-917d-21c83ef278c0",
        "code": "legal_and_corporate",
        "name": "Legal and Corporate",
        "description": "Entity, licenses, contracts, and legal matters",
        "isSystem": true,
        "documentTypes": [
          {
            "id": "b96cbac4-95f8-46cd-b0d7-a9ab92299ce0",
            "code": "contract",
            "name": "Contract",
            "description": "Commercial agreement with a customer, vendor, or partner",
            "isSystem": true
          }
        ]
      }
    ]
  }
}