Skip to main content
POST
Link existing document(s) into a chat
References a document you can already see — no clone, no re-extraction. A foreign id is 404, not 403.

Authorizations

Authorization
string
header
required

Organisation API key from Settings → API / /api/keys/. The secret is shown once. Send Authorization: Bearer sk-abacus-…. One active key per organisation. Ingest (/api/v2/ingest/*) refuses API keys — that surface is Auth0-only with ingest:read / ingest:write scopes.

Path Parameters

thread_id
string
required

Body

application/json

Body for POST /api/v2/chats/<thread_id>/attachments/link/.

Links existing documents into the chat (Decision 8: LINK, not CLONE — the doc's markdown / extraction / ES chunks are reused as-is, edits propagate). Sources may be given as raw ChatAttachment PKs and/or BatchDocument PKs (a batch row's underlying attachment). At least one list must be non-empty.

source_attachment_ids
integer[]

ChatAttachment PKs to link into the chat.

Required range: x >= 1
source_batch_document_ids
integer[]

BatchDocument PKs whose underlying ChatAttachment is linked into the chat.

Required range: x >= 1

Response

201 response for the link endpoint — the created/existing link rows.