Salesly API
API Reference

List a contact's documents

Returns documents linked to the contact. By default only documents linked directly to the contact are returned; pass `scope=all` to also include documents attached to the contact's opportunities and orders.

GET
/contacts/{identifier}/documents

Authorization

x-api-key<token>

Your tenant API key

In: header

Path Parameters

identifier
Required
string

Accepts any of the following (matched in order): numeric ID, name, email, or CIF/tax identifier. The first matching contact is returned. Use the numeric ID for unambiguous lookups.

Query Parameters

scopestring

direct returns only documents linked straight to the contact. all additionally returns documents attached to the contact's opportunities and orders.

Default: "direct"Value in: "direct" | "all"
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/contacts/string/documents?scope=direct&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
  }
}