Documents

Link a document

Links the document to one target of this kind. Linking the same target again has no effect. Set replace to change an existing link of this kind.

put/documents/{documentId}/links/{kind}

Request

  • Base URL: https://next-api.saturation.io/v1
  • URL: https://next-api.saturation.io/v1/documents/{documentId}/links/{kind}
  • Auth: HTTP bearer

Request body

targetIdstring required

A stable resource ID, such as prj_…, txn_…, or doc_….

phaseIdstring

A stable resource ID, such as prj_…, txn_…, or doc_….

replaceboolean

Replace the existing link of this kind.

Example request

{
  "targetId": "txn_8f2a1c9e",
  "phaseId": "txn_8f2a1c9e"
}

Response

The document with updated links.

idstring required

A stable resource ID, such as prj_…, txn_…, or doc_….

namestring required

The document's display name.

mimeTypestring required

The file's MIME type.

sizeinteger required

The file size in bytes.

status'pending' | 'processing' | 'ready' | 'failed' required

The document's extraction status. ready means extracted data is available.

workspaceIdstring required

A stable resource ID, such as prj_…, txn_…, or doc_….

pageCountinteger nullable

The number of pages, or null until extraction finishes.

classificationstring nullable

The document classification, such as invoice or receipt.

coarseType'financial' | 'tax' | 'legal' | 'insurance' | 'production' | 'other'

The document category found during extraction.

hasSensitiveInfoboolean nullable

Whether the document may contain sensitive information.

descriptionstring nullable

The document description.

sourcestring nullable

How the document was added, such as api, agent, or upload.

folderIdstring

A stable resource ID, such as prj_…, txn_…, or doc_….

projectIdstring

A stable resource ID, such as prj_…, txn_…, or doc_….

contentHashstring nullable

A hash of the file contents.

createdAtstring date-time required

When the document was created.

updatedAtstring date-time required

When the document was last updated.

Example response

{
  "id": "doc_4b1f0a7c",
  "name": "vendor-invoice-0425.pdf",
  "mimeType": "application/pdf",
  "size": 184320,
  "status": "ready",
  "workspaceId": "ws_71aa",
  "pageCount": 2,
  "classification": "invoice",
  "coarseType": "financial",
  "folderId": "fld_9c2d",
  "projectId": "prj_71aa",
  "links": [
    {
      "kind": "transaction",
      "id": "txn_8f2a1c9e"
    }
  ],
  "createdAt": "2026-05-28T14:03:11Z",
  "updatedAt": "2026-05-28T14:03:40Z"
}

Changes

No recorded changes to this operation across all 4 revisions of this API.