Documents
Resource Links
A document can be linked to one or more platform resources. Links are lightweight associations - a DocumentLink row that records which resource the document is attached to.
Supported Resource Types
The resource type is inferred from the ID prefix. No resource_type field is needed in the request body.
Link a Document to a Resource
Request body:
Idempotency:
The combination of (document_id, resource_id) has a database-level unique constraint.
Response (new link):
Remove a Link
Soft-deletes the DocumentLink row. The document itself is not affected.
List Links
List the active links for a document with optional filters.
Query parameters:
Response:
Managing Links via the Update Endpoint
Instead of using the links endpoint, you can manage resource links atomically as part of a document update using the resources field on POST /v1/documents/:id:
The resources field accepts either { add, remove } or { set } - these forms cannot be combined:
The set operation is atomic - it removes links not in the new set and adds new ones in a single transaction.
This approach is useful when you want to update metadata and links in a single request.