Skip to content

Creating Documents

Upload documents to a job in your workspace.

The create documents endpoint allows you to upload new documents to a user's job in your workspace.

Endpoint

MethodUrl
POST/v1.0/documents
Note
  • Request's Content-Type must be multipart/form-data.
  • The maximum file size for uploads is 500MB.

Request Parameters

job_id
•
string
required

The job's ID.

title
•
string
deprecated

The document's title.

The document's title is deprecated in favor of the file name, and is no longer used.

file
•
string
required

The document's content.

description
•
string
deprecated

The document's description.

The document's description is deprecated and is no longer used.

document_type_id
•
string

An ID for the type of document being uploaded. You can query for the list of supported Document Types.

Sample Request

bash
Copied
1curl -X POST 'https://api.worklayer.com/v1.0/documents' \
2-H 'Authorization: Bearer {token}' \
3-F 'file=@{filepath}' \
4-F 'job_id=a439ddfa-6ba4-4b38-8cf0-5d09db1a0af4' \
5-F 'document_type_id=PRIOR_YEAR_RETURN'

Sample Response

json
Copied
1{
2 "id": "95e6f305-913e-40ad-9c80-ede263670878",
3 "title": "document.txt",
4 "create_time": "2022-04-11T15:18:00.701Z",
5 "update_time": "2022-04-11T15:18:00.701Z",
6 "document_type": {
7 "id": "PRIOR_YEAR_RETURN",
8 "name": "Prior year return"
9 }
10}

Errors

  1. Forbidden: API Client cannot create members.
  2. Unauthorized: API Client does not have valid credentials.
  3. BadRequest: Either required properties are missing, or there was a malformed request.
Last updated on October 12, 2022