Salesly API
API Reference

List documents

All documents in the workspace, including those not linked to any contact or opportunity.

GET
/documents

Authorization

x-api-key<token>

Your tenant API key

In: header

Query Parameters

contact_idinteger

Only documents linked to this contact

opportunity_idinteger

Only documents attached to this opportunity

category_idinteger

Only documents in this category

qstring

Partial match on the document name

includestring

Pass metadata to populate mime_type and size_bytes for documents that predate metadata capture. This costs one storage lookup per row, so list responses are slower.

Value in: "metadata"
per_pageinteger

Items per page (1-100, default 15)

Default: 15Minimum: 1Maximum: 100
pageinteger

Page number

Default: 1Minimum: 1
curl -X GET "https://rest.salesly.app/api/v1/developers/documents?contact_id=0&opportunity_id=0&category_id=0&q=string&include=metadata&per_page=15&page=1" \
  -H "x-api-key: <token>"

Paginated documents

{
  "data": [
    {
      "id": 12,
      "name": "Signed contract",
      "filename": "6f1c8e2a-6b1e-4c8a-9f2d-0b7a1c3d5e9f_contract.pdf",
      "extension": "PDF",
      "mime_type": "application/pdf",
      "size_bytes": 184320,
      "contact_id": 42,
      "category_id": 1,
      "opportunity_ids": [
        0
      ],
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "pagination": {
    "total": 0,
    "per_page": 0,
    "current_page": 0,
    "last_page": 0,
    "has_more": true
  }
}