Add a context document
Saves Markdown, such as a design decision, a product spec, or an accepted risk, as a context document on a repository. Use the repository’s id from GET /repos. name holds up to 200 characters and content up to 200,000. You need the member role or above.
Scans read the document, and the next threat model update folds it into the repository’s threat model. To start that update now, call POST /repositories/{id}/threat-model/sync.
Request
POST /context-documents
Send an API key with the write scope in the X-Api-Key header.
Body
A required application/json body.
| Field | Description |
|---|---|
repository_idstring (uuid), required | Id from the repository list. |
namestring, required | Document title. |
contentstring, required | Markdown content. |
Responses
200 OK
| Field | Description |
|---|---|
idstring (uuid), required | |
namestring, required | |
kindstring, required | One of threat_model, application_threat_model, or document. |
updated_atstring (date-time), required | |
readableboolean, required | Whether the content is text this API returns; PDFs open in Hacktron. |