Documents API

Documents API

List all documents

List all documents ordered by created_at descending.

SecuritybearerAuth
Request
query Parameters
filter[filename][contains]
string

Filter by string matching part of filename.

Example: filter[filename][contains]=invoice
filter[customer_reference][eq]
string

Filter documents by a customer references.

Example: filter[customer_reference][eq]=MY REF 001
filter[customer_reference][in][]
string

Filter documents by a list of customer references.

Example: filter[customer_reference][in][]=MY REF 001
filter[created_at][gt]
string

Filter by created at greater than provided value.

Example: filter[created_at][gt]=2021-04-09T22:25:27.521Z
filter[created_at][lt]
string

Filter by created at less than provided value.

Example: filter[created_at][lt]=2021-04-09T22:25:27.521Z
sort[]
string

Specifies the sort order for results. If you want to sort by a field in ascending order, include it as a sort parameter. If you want to sort in descending order, prepend a - in front of the field name.

Enum: "filename" "created_at" "updated_at"
Example: sort[]=filename
page[number]
integer >= 1
Default: 1

The page number to load

page[size]
integer [ 1 .. 250 ]
Default: 20

The size of the page

Responses
200

Successful response

Response Schema: application/json
Array of objects (DocServiceDocument)
object (PaginationMeta)
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/documents
Request samples
Response samples
application/json
{
  • "data": [
    • {
      • "created_at": "2018-02-02T22:25:27.521Z",
      • "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
      • "record_type": "document",
      • "updated_at": "2018-02-02T22:25:27.521Z",
      • "content_type": "application/pdf",
      • "customer_reference": "MY REF 001",
      • "filename": "test-document.pdf",
      • "sha256": "08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c",
      • "size": {
        • "amount": 123456,
        • "unit": "bytes"
        },
      • "status": "pending"
      }
    ],
  • "meta": {
    • "page_number": 2,
    • "page_size": 25,
    • "total_pages": 3,
    • "total_results": 55
    }
}

Upload a document

Upload a document.

Uploaded files must be linked to a service within 30 minutes or they will be automatically deleted.

SecuritybearerAuth
Request
Request Body schema:
required
One of:
customer_reference
string

Optional reference string for customer tracking.

filename
string

The filename of the document.

url
required
string

If the file is already hosted publicly, you can provide a URL and have the documents service fetch it for you.

Responses
200

Successful response

Response Schema: application/json
object (DocServiceDocument)
created_at
string

ISO 8601 formatted date-time indicating when the resource was created.

id
string <uuid>

Identifies the resource.

record_type
string

Identifies the type of the resource.

updated_at
string

ISO 8601 formatted date-time indicating when the resource was updated.

content_type
string

The document's content_type.

customer_reference
string

Optional reference string for customer tracking.

filename
string

The filename of the document.

sha256
string

The document's SHA256 hash provided for optional verification purposes.

object

Indicates the document's filesize

status
string

Indicates the current document reviewing status

Enum: "pending" "verified" "denied"
422

Unprocessable entity. Check the 'detail' field in response for details.

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
post/documents
Request samples
{}
Response samples
application/json
{
  • "data": {
    • "created_at": "2018-02-02T22:25:27.521Z",
    • "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    • "record_type": "document",
    • "updated_at": "2018-02-02T22:25:27.521Z",
    • "content_type": "application/pdf",
    • "customer_reference": "MY REF 001",
    • "filename": "test-document.pdf",
    • "sha256": "08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c",
    • "size": {
      • "amount": 123456,
      • "unit": "bytes"
      },
    • "status": "pending"
    }
}

Delete a document

Delete a document.

A document can only be deleted if it's not linked to a service. If it is linked to a service, it must be unlinked prior to deleting.

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

Identifies the resource.

Example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
Responses
200

Successful response

Response Schema: application/json
object (DocServiceDocument)
created_at
string

ISO 8601 formatted date-time indicating when the resource was created.

id
string <uuid>

Identifies the resource.

record_type
string

Identifies the type of the resource.

updated_at
string

ISO 8601 formatted date-time indicating when the resource was updated.

content_type
string

The document's content_type.

customer_reference
string

Optional reference string for customer tracking.

filename
string

The filename of the document.

sha256
string

The document's SHA256 hash provided for optional verification purposes.

object

Indicates the document's filesize

status
string

Indicates the current document reviewing status

Enum: "pending" "verified" "denied"
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
delete/documents/{id}
Request samples
Response samples
application/json
{
  • "data": {
    • "created_at": "2018-02-02T22:25:27.521Z",
    • "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    • "record_type": "document",
    • "updated_at": "2018-02-02T22:25:27.521Z",
    • "content_type": "application/pdf",
    • "customer_reference": "MY REF 001",
    • "filename": "test-document.pdf",
    • "sha256": "08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c",
    • "size": {
      • "amount": 123456,
      • "unit": "bytes"
      },
    • "status": "pending"
    }
}

Retrieve a document

Retrieve a document.

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

Identifies the resource.

Example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
Responses
200

Successful response

Response Schema: application/json
object (DocServiceDocument)
created_at
string

ISO 8601 formatted date-time indicating when the resource was created.

id
string <uuid>

Identifies the resource.

record_type
string

Identifies the type of the resource.

updated_at
string

ISO 8601 formatted date-time indicating when the resource was updated.

content_type
string

The document's content_type.

customer_reference
string

Optional reference string for customer tracking.

filename
string

The filename of the document.

sha256
string

The document's SHA256 hash provided for optional verification purposes.

object

Indicates the document's filesize

status
string

Indicates the current document reviewing status

Enum: "pending" "verified" "denied"
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/documents/{id}
Request samples
Response samples
application/json
{
  • "data": {
    • "created_at": "2018-02-02T22:25:27.521Z",
    • "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    • "record_type": "document",
    • "updated_at": "2018-02-02T22:25:27.521Z",
    • "content_type": "application/pdf",
    • "customer_reference": "MY REF 001",
    • "filename": "test-document.pdf",
    • "sha256": "08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c",
    • "size": {
      • "amount": 123456,
      • "unit": "bytes"
      },
    • "status": "pending"
    }
}

Update a document

Update a document.

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

Identifies the resource.

Example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
Request Body schema: application/json
required
customer_reference
string

Optional reference string for customer tracking.

filename
string

The filename of the document.

Responses
200

Successful response

Response Schema: application/json
object (DocServiceDocument)
created_at
string

ISO 8601 formatted date-time indicating when the resource was created.

id
string <uuid>

Identifies the resource.

record_type
string

Identifies the type of the resource.

updated_at
string

ISO 8601 formatted date-time indicating when the resource was updated.

content_type
string

The document's content_type.

customer_reference
string

Optional reference string for customer tracking.

filename
string

The filename of the document.

sha256
string

The document's SHA256 hash provided for optional verification purposes.

object

Indicates the document's filesize

status
string

Indicates the current document reviewing status

Enum: "pending" "verified" "denied"
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
patch/documents/{id}
Request samples
application/json
{
  • "customer_reference": "MY REF 001",
  • "filename": "test-document.pdf"
}
Response samples
application/json
{
  • "data": {
    • "created_at": "2018-02-02T22:25:27.521Z",
    • "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    • "record_type": "document",
    • "updated_at": "2018-02-02T22:25:27.521Z",
    • "content_type": "application/pdf",
    • "customer_reference": "MY REF 001",
    • "filename": "test-document.pdf",
    • "sha256": "08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c",
    • "size": {
      • "amount": 123456,
      • "unit": "bytes"
      },
    • "status": "pending"
    }
}

Download a document

Download a document.

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

Identifies the resource.

Example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
Responses
200

Successful response

Response Schema: *
string <binary>
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/documents/{id}/download
Request samples
Response samples
application/json
{
  • "errors": [
    • {
      • "code": "string",
      • "detail": "string",
      • "meta": { },
      • "source": {
        • "parameter": "string",
        • "pointer": "/json/pointer"
        },
      • "title": "string"
      }
    ]
}