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

FieldTypeRequiredDescription
work_record_idstringYesFrom the poll response
titlestringYesDocument title
contentstringYesMarkdown

attachDocument(work_record_id, title, content) in @assemblyline/lib-factory calls this.

Response

{ "success": true, "document_id": "Dq3nR8sLw2Ke" }

Errors

StatusCodeMeaning
400BAD_REQUESTInvalid JSON or a missing field
403FORBIDDENThe work record belongs to another org
404NOT_FOUNDNo such work record