---
title: "Create a document"
method: POST
path: "/documents"
tags: ["documents"]
---

# Create a document

`POST /documents`

## Request

- Base URL: `https://api.hoorayhr.io`
- URL: `https://api.hoorayhr.io/documents`
- Auth: API key in header `authorization`

Create a new document. See the schema for more information on the uploaded file requirements.

## Request body

- DocumentUpload
  - `userId` integer, nullable: ID of the user this document belongs to. Null for company-wide documents.
  - `categoryId` integer: ID of the document category
  - `fileName` string: The name of the document. Must be a valid filename with extension. Supported extensions: doc, docx, txt, rtf, xls, xlsx, jpg, jpeg, png, pdf
  - `displayName` string, nullable: Display name of the document shown to users. If not provided, the fileName will be used as the display name.
  - `note` string, nullable: Optional note attached to the document
  - `status` 'INTERNAL' | 'PUBLISHED': Status of the document. INTERNAL = "Not yet visible to the user", PUBLISHED = "Visible to the user"
  - `fileData` string: The file to upload (in base64 format)
  - `labelId` number, nullable: ID of the label to attach to the document. Omit or provide `null` to not attach a label.
  - `expirationDate` string, date, nullable: Expiration date of the document
  - `reminder` object, nullable: Reminder settings for the document based on the expiration date
    - `days_0` boolean: Send reminder 0 days before expiration
    - `days_7` boolean: Send reminder 7 days before expiration
    - `days_14` boolean: Send reminder 14 days before expiration
    - `days_21` boolean: Send reminder 21 days before expiration
    - `month_1` boolean: Send reminder 1 month before expiration
    - `month_2` boolean: Send reminder 2 months before expiration
    - `month_3` boolean: Send reminder 3 months before expiration
    - `month_4` boolean: Send reminder 4 months before expiration

## Response `201`

Created

- object
  - `id` integer: ID of the created document

---

[API](https://skmtc.dev/hoorayhr/apis/hoorayhr-api-documentation.md) · [All operations](https://skmtc.dev/hoorayhr/apis/hoorayhr-api-documentation/llms.txt) · [OpenAPI document](https://skmtc.dev/hoorayhr/apis/hoorayhr-api-documentation/revisions/3adcd47cd827?raw)
