Skip to content

User Documents

List of valid attributes:

AttributeDescriptionSpecifics
created_atTimestamp of document creationCannot be set
extensionFile extension, e.g. pdfRequired field, Must be either pdf or doc, Cannot be updated
nameName for a documentRequired field. Maximum length is 250 code points
sensitiveWhether document is sensitive or notRequired, can be true or false
upload_statusFile upload statusCannot be set, either uploading, success or error
visible_to_userWhether user has access to this documentRequired, can be true or false

Meta data: Upload/Download URL

ParameterAllowed valuesDescription
download_urltrue/falseWhen passing true on GET endpoints, it generates a temporary URL to use for downloading the document
upload_urltrue/falseWhen passing true on CREATE endpoint, it generates a temporary URL to use for uploading the document

Note: upload_url returns a presigned POST S3 object, which contains url and fields keys, which can be used for HTML form. Maximum file size for upload is 100MB.

Example request:

{
"data": {
"type": "document",
"data": {
"attributes": {
"extension": "pdf",
"name": "Document Name",
"sensitive": true,
"visible_to_user": true
}
}
}
}

Example response:

{
"data": {
"id": "52370ab1-7d08-4a03-b0ac-4ba63c8f209d",
"type": "document",
"attributes": {
...
}
}
}

On success, this endpoint creates a new document with upload_status = "uploading". Also generates a presigned URL for uploading the document, if upload_url meta is passed.

POST /api/v1/users/:user_id/documents

ParameterDescription
user_idThe ID of the user for whom to create a document for

Example request:

{
"data": {
"type": "document",
"data": {
"attributes": {
"name": "Document Name",
"visible_to_user": true,
"upload_status": "success"
}
}
}
}

Example response:

{
"data": {
"id": "52370ab1-7d08-4a03-b0ac-4ba63c8f209d",
"type": "document",
"attributes": {
...
}
}
}

On success, this endpoint updates the document with the given ID and returns it.

PUT /api/v1/users/:user_id/documents/:document_id

ParameterDescription
user_idThe ID of the user of the document
document_idThe ID of the document to update

Example response:

{
"data": [
{
"id": "0a7cd22a-ceab-4b38-a6a2-1ea9e550ca53",
"type": "document",
"attributes": {
...
}
},
{
...
}
]
}

This endpoint returns all of a user’s documents to which he has access.

GET /api/v1/users/:user_id/documents

ParameterDescription
user_idThe ID of the user for whom to list the documents for

Example response:

{
"data": {
"id": "3aab0a84-8ed3-4ddf-8572-f1799bb60e0a",
"type": "document",
"attributes": {
...
}
}
}

This endpoint returns a document.

GET /api/v1/users/:user_id/documents/:document_id

ParameterDescription
user_idThe ID of the user
document_idThe ID of the document to return

Example response:

{
"data": {
"id": "bfcde02e-7e9e-4706-9504-ae0cecd5019c",
"type": "document",
"attributes": {
...
}
}
}

This endpoint deletes a document with the given ID.

DELETE /api/v1/users/:user_id/documents/:document_id

ParameterDescription
user_idThe ID of the user of the document
document_idThe ID of the document to delete