Attach Document
POST /api/factory/attach-document
Adds a markdown document to the work record, shown on its Documents tab. Use it for the evidence behind a decision: the checks a station ran, an extraction, a comparison.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
work_record_id | string | Yes | From the poll response |
title | string | Yes | Document title |
content | string | Yes | Markdown |
attachDocument(work_record_id, title, content) in @assemblyline/lib-factory
calls this.
Response
{ "success": true, "document_id": "Dq3nR8sLw2Ke" }
Errors
| Status | Code | Meaning |
|---|---|---|
400 | BAD_REQUEST | Invalid JSON or a missing field |
403 | FORBIDDEN | The work record belongs to another org |
404 | NOT_FOUND | No such work record |