Request
Path Parameters
Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
Optional UUID for retry deduplication.
Body Parameters
One of contact, company, deal, event, matter, or task.
UUID of the target entity.
Optional relationship label (e.g. signed, draft, evidence). Free-form string, max 64 characters.
Response
UUID of the newly created link
Optional relationship label
A document may be linked to multiple entities simultaneously; the same (document_id, entity_type, entity_id) triple returns the existing link rather than creating duplicates. Responses include X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and X-Request-ID.
curl -X POST \
https://data.leadlex.com/functions/v1/api-gateway/v1/documents/doc_01HY1/link \
-H "Authorization: Bearer wbk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"entity_type": "contact",
"entity_id": "123e4567-e89b-12d3-a456-426614174000",
"role": "signed"
}'
Example Response
{
"data" : {
"link_id" : "dlnk_01HY1" ,
"document_id" : "doc_01HY1" ,
"entity_type" : "deal" ,
"entity_id" : "deal_01HY1" ,
"role" : "signed" ,
"created_at" : "2026-04-17T10:55:00Z"
}
}
Errors
Status Code Description 400 validation_errorUnsupported entity_type or missing entity_id 401 invalid_keyInvalid or expired API key 403 insufficient_permissionsMissing write:documents permission 404 not_foundDocument or entity does not exist 429 rate_limitedRate limit exceeded