documents

Create a document

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

post/documents

Request

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

Request body

userIdinteger nullable

ID of the user this document belongs to. Null for company-wide documents.

categoryIdinteger

ID of the document category

fileNamestring

The name of the document. Must be a valid filename with extension.

Supported extensions: doc, docx, txt, rtf, xls, xlsx, jpg, jpeg, png, pdf

displayNamestring nullable

Display name of the document shown to users. If not provided, the fileName will be used as the display name.

notestring 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"

fileDatastring

The file to upload (in base64 format)

labelIdnumber nullable

ID of the label to attach to the document. Omit or provide null to not attach a label.

expirationDatestring date nullable

Expiration date of the document

Example request

{
  "userId": 42,
  "categoryId": 1,
  "fileName": "contract-2024.pdf",
  "displayName": "Employment Contract 2024",
  "note": "Signed by both parties",
  "status": "PUBLISHED",
  "fileData": "data:application/pdf;base64,JVBERi0...==",
  "labelId": 1,
  "expirationDate": "2025-12-31"
}

Response

Created

idinteger

ID of the created document

Example response

{
  "id": 1
}

Changes

No recorded changes to this operation across all 1 revision of this API.