Salesly API
API Reference

Link an existing document to a contact

A document carries at most one contact link. Linking a document that already belongs to a different contact returns 409 rather than moving it — unlink it from the current contact first. Idempotent: linking a document already linked to this contact succeeds and changes nothing.

PUT
/contacts/{identifier}/documents/{document}

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.

document
Required
integer

Numeric document ID

curl -X PUT "https://rest.salesly.app/api/v1/developers/contacts/string/documents/0" \
  -H "x-api-key: <token>"

Document linked

{
  "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"
  }
}