# Create a Document

`POST /lokta-lms/api/v1/{entityType}/{entityId}/documents`

Note: A document is created using a Multi-part form upload

Body parts

- name : name or summary of the document
- description : description of the document
- file : the file to be uploaded

Mandatory fields :

- file
- description

## Parameters
- `entityType` (path, string, required)
- `entityId` (path, integer, required)
- `Content-Length` (header, integer)

## Responses
- `200`: OK

## Response fields
- `resourceId` (integer)
- `resourceIdentifier` (string)

## Example request (cURL)
```bash
curl -X POST \
  'http://localhost:8080/lokta-lms/api/v1/{entityType}/{entityId}/documents' \
  -u '{username}:{password}' \
  -H 'Tenant-Identifier: default'
```

## Example response
```json
{
  "resourceId": 1,
  "resourceIdentifier": "string"
}
```

Interactive: https://developer.lokta.ai/reference.html#operation/createDocument
