Skip to main content
PATCH
Edit document metadata
Rename (and similar metadata). Does not re-extract and does not spend credits.

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

att_id
integer
required

Body

application/json

Editable metadata on a document (PATCH /attachments/<att_id>/).

Only safe, non-pipeline metadata is patchable here. Schema changes go through the reprocess endpoint; cell values go through the cell endpoint.

file_name
string
Required string length: 1 - 255
target_language
string
Maximum string length: 10

Response

Full projection of a ChatAttachment for the unified document view.

Extends the list item with the heavy content + extraction surface the document viewer (tabs: Extracted / Markdown / Translation / Warnings) needs in one round-trip. extraction_result + extraction_overrides are returned independently so the client can render the LLM original, the user override, or both side-by-side without a follow-up call, and extraction_status carries the quality verdict on that extraction (AD-520) so a sparse or mismatched result is not indistinguishable from a clean one.

id
integer
required
read-only
file_name
string
required
read-only
file_type
string
required
read-only
processing_status
enum<string>
required

Lynx processing pipeline status: pending → completed/failed

  • pending - Pending
  • completed - Completed
  • failed - Failed
Available options:
pending,
completed,
failed
processing_progress
integer
required
read-only

Processing completion percentage 0-100

processing_stage
string
required
read-only

Current processing stage name, or the failure reason on a FAILED attachment

page_count
integer
required
read-only

Number of pages in the original document

has_schema
boolean
required
read-only

True when a schema (StructVersion) is pinned for extraction.

extraction_struct_version_id
integer | null
required
read-only

StructVersion that produced this attachment's extraction_result. NULL for non-batch attachments or pre-versioning records.

target_language
string
required
read-only

ISO language code for translation target (e.g. 'en', 'ar')

is_from_kb
boolean
required
read-only

Whether this attachment came from Knowledge Base

kb_file_id
integer | null
required
read-only

Original Knowledge Base file ID if from KB

lynx_document_id
string | null
required
read-only

Lynx document ID after processing (extraction + chunking + indexing)

document_summary
string | null
required
read-only

Cached document summary from Lynx processing

has_extraction
boolean
required
read-only

True when schema-guided extraction produced a result.

has_translation
boolean
required
read-only

True when at least one translated version exists.

has_warnings
boolean
required
read-only

True when Lynx emitted any processing warnings.

home_chat_id
integer
required
read-only
created_at
string<date-time>
required
read-only
completed_at
string<date-time> | null
required
read-only

When Lynx processing finished (set on COMPLETED/FAILED transitions).

markdown_content
string
required
read-only
translated_versions
object
required
read-only

Translated versions keyed by language, minus internal Lynx ids.

extraction_result
any
required
extraction_status
string | null
required
read-only

Quality verdict on the extraction, independent of processing_status.

success / partial / schema_mismatch / ocr_failed, or None when no extraction has run. AD-520: processing_status answers "did the pipeline finish", this answers "is the extraction any good" — a refused verdict is processing_status="failed" with every field the engine DID recover still present in extraction_result, and the human-readable reason on processing_stage. Same vocabulary the batch grid publishes, so the two document surfaces describe one document identically.

Reads the pinned StructVersion — the detail view select_relateds it, so this costs no extra query.

extraction_overrides
object
required
read-only

The raw per-field override map (empty dict when none).

extraction_struct
object | null
required
read-only

The (slug, version, schema_url) triple for the producing StructVersion.

Returns None when the doc was processed without a schema (free transcription) or the version reference was orphaned by hard delete. Mirrors serializers.DocumentDetailSerializer.get_extraction_struct so both document surfaces emit the same schema-navigation shape.

processing_warnings
object[]
required
read-only

Per-page Lynx warnings; empty list when the doc processed cleanly.

lynx_chunk_count
integer
required
read-only