Skip to main content
POST
/
workers
/
{id}
/
documents
Upload Worker Document
curl --request POST \
  --url https://api.roostedhr.com/api/1_12/workers/{id}/documents \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "name": "<string>",
  "file": "aSDinaTvuI8gbWludGxpZnk=",
  "worker_viewable": 0
}
'
{ "id": "<string>", "name": "<string>", "file_name": "<string>", "location": "<string>", "date_added": "<string>", "type": "<string>", "deleted": "0", "date_deleted": "<string>", "worker_viewable": 0 }
Upload files using multipart/form-data encoding. The maximum file size is 50 MB.

Authorizations

X-API-KEY
string
header
required

Path Parameters

id
string
required

Worker ID

Body

application/json
name
string
required

Display name for the document.

file
string<byte>
required

Base64-encoded file content. Supported types: JPEG, PNG, GIF, BMP, WebP, PDF.

worker_viewable
enum<integer>

Whether the worker can view this document. = viewable, = hidden. Defaults to .

Available options:
0,
1

Response

Created

A document uploaded to a worker's profile.

id
string

Document identifier.

name
string

Display name of the document.

file_name
string

Original file name.

location
string

URL to the hosted file.

date_added
string

Formatted date the document was uploaded (e.g. "Feb 23rd").

type
string

File type (e.g. "image", "pdf").

deleted
enum<string>

Soft-delete flag. "0" = active, "1" = deleted.

Available options:
0,
1
date_deleted
string | null

Date the document was soft-deleted. null if not deleted.

worker_viewable
enum<integer>

Whether the worker can view this document. 1 = viewable, 0 = hidden.

Available options:
0,
1