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
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 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

Create

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.

HTTP Request

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

URL Parameters

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

Update

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.

HTTP Request

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

URL Parameters

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

List

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.

HTTP Request

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

URL Parameters

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

Show

Example response:

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

This endpoint returns a document.

HTTP Request

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

URL Parameters

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

Delete

Example response:

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

This endpoint deletes a document with the given ID.

HTTP Request

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

URL Parameters

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