Create a new employee document
Creates a new employee document and returns its ID and details.
Helpful resources
Required Scopes
- employee-documents.read-write
Request
- application/json
Body
items object[]required
Id of the worker to attach documents to.
documents object[]required
Id of a FileUploadTracker in ACTIVE status whose file should become a document on the hire
Document name. Defaults to the uploaded file name when omitted.
Signature date in YYYY-MM-DD format.
Optional destination folder for documents. Accepts either: (1) an ObjectId string for custom folders, or (2) a default folder identifier ('root', 'confidential_documents', 'notices', 'work_authorization'). When omitted, documents land at the root of the worker's profile (current default behavior). When supplied, the folder must exist, be in an active state, be provisioned for the target worker, and the caller must have UPLOAD permission on it — otherwise behavior is governed by on_invalid_folder.
Fallback behavior when folder_id is supplied but inaccessible. 'fail' (default) rejects each affected document with FOLDER_ACCESS_ERROR. 'fallback_to_root' uploads to the worker's root profile instead and attaches a FOLDER_ACCESS_FALLBACK warning to each result. Ignored when folder_id is omitted.
Responses
- 200
- application/json
- Schema
- Example (from schema)
Schema
Identifier field
Record creation date
Record update date
items object[]required
Id of the worker to attach documents to.
documents object[]required
Id of a FileUploadTracker in ACTIVE status whose file should become a document on the hire
Document name. Defaults to the uploaded file name when omitted.
Signature date in YYYY-MM-DD format.
Optional destination folder for documents. Accepts either: (1) an ObjectId string for custom folders, or (2) a default folder identifier ('root', 'confidential_documents', 'notices', 'work_authorization'). When omitted, documents land at the root of the worker's profile (current default behavior). When supplied, the folder must exist, be in an active state, be provisioned for the target worker, and the caller must have UPLOAD permission on it — otherwise behavior is governed by on_invalid_folder.
Fallback behavior when folder_id is supplied but inaccessible. 'fail' (default) rejects each affected document with FOLDER_ACCESS_ERROR. 'fallback_to_root' uploads to the worker's root profile instead and attaches a FOLDER_ACCESS_FALLBACK warning to each result. Ignored when folder_id is omitted.
{
"id": "string",
"created_at": "string",
"updated_at": "string",
"items": [
{
"worker_id": "string",
"documents": [
{
"file_id": "string",
"name": "string",
"signature_date": "string"
}
],
"folder_id": "string",
"on_invalid_folder": "fail"
}
]
}