---
title: "Create Document"
method: POST
path: "/Document"
tags: ["Document"]
---

# Create Document

`POST /Document`

Create a new 'Document' record.

## Headers

- `X-Skip-Duplicate-Check` 'true' | 'false'
- `X-Duplicate-Source-Id` string

## Request body

- DocumentCreate
  - `id` string — An ID.
  - `name` string — A one-line string.
  - `fileId` string — An ID of the record of the Attachment type.
  - `fileName` string, nullable — A foreign record name.
  - `status` 'Draft' | 'Active' | 'Canceled' | 'Expired'
  - `type` 'Contract' | 'NDA' | 'EULA' | 'License Agreement', nullable
  - `publishDate` string, date — A date.
  - `expirationDate` string, date, nullable — A date.
  - `description` string, nullable — A multi-line text.
  - `createdAt` string, nullable — A timestamp in UTC.
  - `modifiedAt` string, nullable — A timestamp in UTC.
  - `createdById` string, nullable — An ID of the record of the User type.
  - `createdByName` string, nullable — A foreign record name.
  - `modifiedById` string, nullable — An ID of the record of the User type.
  - `modifiedByName` string, nullable — A foreign record name.
  - `assignedUserId` string, nullable — An ID of the record of the User type.
  - `assignedUserName` string, nullable — A foreign record name.
  - `teamsIds` string[], nullable — IDs of records of the Team type.
  - `teamsNames` object, nullable — An {ID => record name} map.
  - `accountsIds` string[], nullable — IDs of records of the Account type.
  - `accountsNames` object, nullable — An {ID => record name} map.
  - `folderId` string, nullable — An ID of the record of the DocumentFolder type.
  - `folderName` string, nullable — A foreign record name.

## Response `200`

Success.

- Document
  - `id` string — An ID.
  - `name` string — A one-line string.
  - `fileId` string — An ID of the record of the Attachment type.
  - `fileName` string, nullable — A foreign record name.
  - `status` 'Draft' | 'Active' | 'Canceled' | 'Expired'
  - `type` 'Contract' | 'NDA' | 'EULA' | 'License Agreement', nullable
  - `publishDate` string, date — A date.
  - `expirationDate` string, date, nullable — A date.
  - `description` string, nullable — A multi-line text.
  - `createdAt` string, nullable — A timestamp in UTC.
  - `modifiedAt` string, nullable — A timestamp in UTC.
  - `createdById` string, nullable — An ID of the record of the User type.
  - `createdByName` string, nullable — A foreign record name.
  - `modifiedById` string, nullable — An ID of the record of the User type.
  - `modifiedByName` string, nullable — A foreign record name.
  - `assignedUserId` string, nullable — An ID of the record of the User type.
  - `assignedUserName` string, nullable — A foreign record name.
  - `teamsIds` string[], nullable — IDs of records of the Team type.
  - `teamsNames` object, nullable — An {ID => record name} map.
  - `accountsIds` string[], nullable — IDs of records of the Account type.
  - `accountsNames` object, nullable — An {ID => record name} map.
  - `folderId` string, nullable — An ID of the record of the DocumentFolder type.
  - `folderName` string, nullable — A foreign record name.

## Other responses

- `400` — Bad request. Might be a validation error. Check logs for details.
- `403` — Forbidden. Might be an access control error. Check logs for details.
- `409` — Conflict. May be a possible duplicate. Use X-Skip-Duplicate-Check to skip check.

---

[API](https://skmtc.net/espocrm/apis/espocrm-api.md) · [All operations](https://skmtc.net/espocrm/apis/espocrm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/espocrm/espocrm-api/versions/6622dabfccd3/schema)
