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

# Document types

> Where type_id comes from and which type is meant for API creation

`type_id` is required when creating a document, and you cannot invent it: it comes
from your tenant's type catalog. Types are grouped into categories and define which
template a document is generated from and who it is about.

Reading the catalog is covered by the `documents:read` scope.

## Listing types

```bash theme={null}
curl -H "X-API-Key: $DOODOCS_API_KEY" \
  "https://app.doodocs.kz/api/developer/v1/document_types?limit=100"
```

```json theme={null}
{
  "document_types": [
    {
      "id": "5c9e1f04-…",
      "title": "Employment order",
      "status": "ACTIVE",
      "template_id": "tpl_7c1a…",
      "category_id": "cat_2b8f…",
      "subject_type": "HR",
      "confidential": false,
      "allow_upload": true,
      "allow_api": true
    }
  ],
  "next_page_token": ""
}
```

| Field          | What it means                                                                |
| -------------- | ---------------------------------------------------------------------------- |
| `template_id`  | The template the document is generated from. Empty when the type has none    |
| `category_id`  | The grouping category; the list filters by it                                |
| `subject_type` | Who the document concerns: `HR` for an employee, `INTERNAL` for internal use |
| `confidential` | Documents of this type have restricted visibility                            |
| `allow_upload` | The type is meant to be created from an uploaded file                        |
| `allow_api`    | The type is meant to be created through the Developer API                    |

<Warning>
  `allow_api` and `allow_upload` are the administrator's notes about a type's intended
  use. The server does not check them when a document is created, so honour them
  yourself: creating a document of a type marked `allow_api: false` goes around an
  agreement made inside your company.
</Warning>

## Filtering by category

```bash theme={null}
curl -H "X-API-Key: $DOODOCS_API_KEY" \
  "https://app.doodocs.kz/api/developer/v1/document_types?category_id=cat_2b8f…"
```

`GET /document_type_categories` returns the categories:

```json theme={null}
{
  "categories": [
    {
      "id": "cat_2b8f…",
      "title": "HR orders",
      "status": "ACTIVE",
      "icon": "file-lines",
      "sort_order": 10
    }
  ],
  "next_page_token": ""
}
```

`sort_order` mirrors the order shown in the app — use it when you present the catalog
to a user.

## Choosing a type

<Steps>
  <Step title="Find the category">
    Export `GET /document_type_categories` once and store it. The list rarely changes.
  </Step>

  <Step title="Find the type inside it">
    `GET /document_types?category_id=…`. Match on `title` and keep the `id`.
  </Step>

  <Step title="Take the type's template">
    Pass the type's `template_id` to `GET /document_templates/{template_id}` and read
    `variable_schema` — see [Templates](/en/guides/documents/templates).
  </Step>

  <Step title="Create the document">
    Send `type_id`, `template_id`, `template_version`, and `template_values` to
    `POST /documents`. Then continue with [Signing](/en/guides/documents/signing).
  </Step>
</Steps>

<Tip>
  Do not match types by name on every run, because names get edited. Store the type and
  template `id` in your integration's configuration.
</Tip>

Both lists follow the shared [pagination](/en/api-reference/pagination) rules: `limit`
defaults to `100`, caps at `1000`, and continues through `page_token`.
