Skip to content
Log in Request a demo

Documents

The /api/v1/documents endpoint group gives access to the Skailer document storage: folders, document metadata, and the files themselves.

Every document lives in a folder, and the folder type determines who the document belongs to:

Folder typeMeaning
organizationCompany-wide documents (policies, regulations, templates)
employeeDocuments of a specific employee (contracts, certificates, scans)

For a document in an employee folder the employee_id field holds the employee it belongs to. For an organization document employee_id is null.

GET /api/v1/documents/folders/{folder_type}

folder_type is organization or employee.

Response fields (per folder):

FieldTypeDescription
idintegerFolder ID
titlestringFolder name
typestringFolder type: organization, employee
document_countintegerNumber of documents in the folder

Permissions: for type=organization the response contains folders granted by the folder view/edit rules, or all of them with settings_document_folders=edit. For type=employee it requires settings_document_folders=edit.

Response example:

[
{
"id": 12,
"title": "Company policies",
"type": "organization",
"document_count": 8
}
]

GET /api/v1/documents/employees/{employee_id}/folders

Returns the employee type folders available for the given employee. The response fields are the same as above.

Permissions: settings_document_folders=edit, settings_roles_permissions=edit, or employee_folder_permissions=view on the folder.


POST /api/v1/documents/search

Returns a paginated list of documents.

Request parameters:

FieldTypeDescription
folder_idintegerSearch inside one specific folder
folder_typestringSearch across all accessible folders of the type: organization, employee
employee_idintegerFilter by the employee the documents belong to
titlestringFilter by document title
page_numberintegerPage number, starts at 1

Important: exactly one of folder_id or folder_type must be set. Passing both, or neither, returns 422.

Response fields (per document):

FieldTypeDescription
idintegerDocument ID
titlestringDocument title
employee_idinteger | nullEmployee the document belongs to; null for an organization document
uploaded_by_employee_idintegerEmployee who uploaded the document
folderobjectFolder: id, title, type
fileobjectFile: name, file_type, size, mime_type, uuid, url
datetime_created_atstringCreation timestamp
datetime_updated_atstringLast update timestamp

Permissions: folder type=organization requires settings_document_folders=edit or access granted by the folder view/edit rules. Folder type=employee requires employee_folder_permissions=view; searching with folder_type=employee also requires settings_document_folders=edit.

Request example:

{
"folder_id": 12,
"title": "contract",
"page_number": 1
}

Response example:

{
"items": [
{
"id": 4501,
"title": "Employment contract",
"employee_id": 123,
"uploaded_by_employee_id": 7,
"folder": {
"id": 12,
"title": "Contracts",
"type": "employee"
},
"file": {
"name": "employment_contract.pdf",
"file_type": "employee_documents",
"size": 148213,
"mime_type": "application/pdf",
"uuid": "3f1c2b90-5d1a-4c8e-9a77-0b2d61f4e8aa",
"url": null
},
"datetime_created_at": "2026-05-14 09:12:00",
"datetime_updated_at": "2026-05-14 09:12:00"
}
],
"metadata": {
"page_number": 1,
"total_pages": 1,
"items": 1,
"items_per_page": 20,
"total_items": 1
}
}

POST /api/v1/documents/upload

Uploads a file and creates a document from it in a single request. The body is multipart/form-data.

Request parameters:

FieldTypeDescription
filefileThe file to upload (required)
folder_idintegerTarget folder ID (required)
employee_idintegerEmployee the document belongs to; omit for an organization document

The document title is taken from the file name without the extension and can be changed later via PUT /api/v1/documents/{document_id}.

Permissions: folder type=organization requires settings_document_folders=edit or access granted by the folder edit rules. Folder type=employee requires employee_folder_permissions=edit.

Request example:

Terminal window
curl -X POST 'https://<api-domain>/api/v1/documents/upload' \
-H 'Authorization: Bearer <your_access_token>' \
-F 'folder_id=12' \
-F 'employee_id=123' \
-F 'file=@employment_contract.pdf'

Returns the created document in the same format as search.


GET /api/v1/documents/{document_id}

Returns the document metadata.

Permissions: folder type=organization requires settings_document_folders=edit or access granted by the folder view/edit rules. Folder type=employee requires employee_folder_permissions=view.


GET /api/v1/documents/{document_id}/download

Returns the original file as a binary response. The file name is passed in the Content-Disposition header.

Permissions: the same as for viewing the document.


PUT /api/v1/documents/{document_id}

Changes the document title. The file itself is not replaced.

Request parameters:

FieldTypeDescription
titlestringNew document title (required)

Permissions: folder type=organization requires settings_document_folders=edit or access granted by the folder edit rules. Folder type=employee requires employee_folder_permissions=edit.

Request example:

{
"title": "Employment contract 2026"
}

DELETE /api/v1/documents/{document_id}

Deletes the document. Returns {"success": true}.

Permissions: folder type=organization requires settings_document_folders=edit or access granted by the folder edit rules. Folder type=employee requires employee_folder_permissions=edit.


Goal: push signed contracts from an external document flow into an employee’s folder.

  1. Find the employee’s folder (once per employee, cache the result):

    GET /api/v1/documents/employees/{employee_id}/folders
  2. Check whether the document already exists to avoid duplicates:

    POST /api/v1/documents/search

    Pass folder_id and title.

  3. Upload the file:

    POST /api/v1/documents/upload

    Pass folder_id, employee_id, and file.

  4. Set the final title if the file name differs from the desired title:

    PUT /api/v1/documents/{document_id}

Tip: to sync in the other direction - pull documents out of Skailer - iterate over the pages of POST /api/v1/documents/search with folder_type, then fetch each file via GET /api/v1/documents/{document_id}/download.