Documents

The Documents API provides a simple interface to manage documents. You can retrieve a single document as well as a list of documents attached to the specific resource.

Properties

Attribute Description
id number readonly

Unique identifier of the document.

resource_type string readonly

Type name of the resource the document is attached to.

Possible values:

  • lead
  • contact
  • sales_account
  • deal
resource_id number readonly

Unique identifier of the resource the document is attached to.

creator_id number readonly

Unique identifier of the user who uploaded the document.

name string readonly

Filename of the document.

content_type string readonly

MIME type of the document.

size number readonly

Size of the document in bytes.

download_url string readonly

An expiring URL to download document. It will expire after 90 minutes.

created_at string readonly

Date and time of creation in UTC (ISO8601 format).

updated_at string readonly

Date and time of the last update in UTC (ISO8601 format).


Endpoints


Retrieve documents

Returns all docuements attached to the specific resource, according to the parameters provided.

Parameters

Attribute Description
resource_type string required

Name of the type of resource to search for.

Possible values:

  • lead
  • contact
  • sales_account
  • deal
e.g. ?resource_type=deal
resource_id number required

Unique identifier of the resource to search for.

e.g. ?resource_id=1
page number optional

Page number to start from. Page numbering starts at 1, and omitting the page parameter will return the first page.

e.g. ?page=2
per_page number optional

Number of records to return per page. The default limit is 25 and the maximum number that can be returned at one time is 100.

e.g. ?per_page=20
sort_by string optional

A field to sort by. Default ordering is ascending. If you want to change the sort ordering to descending, append :desc to the field e.g. sort_by=created_at:desc.

Possible values:

  • id
  • created_at
  • updated_at
e.g. ?sort_by=created_at
ids string optional

Comma-separated list of document IDs to be returned in a request.

e.g. ?ids=1,2,3
name string optional

Filename of the document.

e.g. ?name=my_document.pdf

Retrieve a single document

Returns a single document available to the user, according to the unique document ID provided. If the docuemnt ID does not exist, this request will return an error.

To download file content, use the link provided in request response:

curl -o "[data.name]" -O "[data.download_url]"

Parameters

Attribute Description
id number required

Unique identifier of the document.