---
title: "Create document template"
method: POST
path: "/crm/v1/documents/templates"
tags: ["documents"]
---

# Create document template

`POST /crm/v1/documents/templates`

## Request

- Base URL: `https://{domain}.uspacy.ua`
- URL: `https://{domain}.uspacy.ua/crm/v1/documents/templates`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/uspacy/apis/crm-service-2/docs/crm/v1/documents/templates/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new document template by uploading a DOCX file with template variables.
Use `multipart/form-data` to send the file along with template configuration.

## Request body `multipart/form-data`

- CreateDocumentTemplate
  - `name` string
  - `is_active` boolean
  - `file` string, binary
  - `binding_entities` object[]
    - `entity_id` number
    - `funnels` number[]
  - `access` object
    - `departments` integer[]
    - `users` integer[]
  - `numerator_id` integer

## Response `201`

Created

- DocumentTemplate
  - `name` string
  - `is_active` boolean
  - `code` string
  - `id` number
  - `disabled` boolean
  - `file` object
    - `name` string
    - `size` string
    - `extension` string
    - `download_link` string
  - `binding_entities` object[]
    - `entity_id` number
    - `funnels` number[]
  - `access` object
    - `departments` integer[]
    - `users` integer[]
  - `numerator_id` integer
  - `created_at` string
  - `updated_at` string
  - `created_by` integer: User who created
  - `updated_by` integer: User who updated

## Other responses

- `401`: Access token is missing or invalid
- `422`: Validation error response

---

[API](https://skmtc.dev/uspacy/apis/crm-service-2.md) - [All operations](https://skmtc.dev/uspacy/apis/crm-service-2/llms.txt) - [OpenAPI document](https://skmtc.dev/uspacy/apis/crm-service-2/revisions/f80578d43845?raw)
