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
required

The document's title.

file
string
required

The document's content.

description
string

The document's description.

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

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

Sample Response

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

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