Documents
Upload a new revision of a stored document (multipart field file)
POST
https://backend.immut.io/api/v1/documents/{id}/versionRequired scope: documents:write
Parameters
| Name | In | Required | Description |
|---|---|---|---|
id | path | yes | id of the target record |
Request body
Content type: multipart/form-data (required)
| Field | Type | Required | Description |
|---|---|---|---|
file | file | yes | multipart file field (required). The new revision of the document. |
agentClassification | string | no | OPTIONAL, agent keys only. Same JSON blob as POST /documents, describing THESE bytes. A contract moving draft -> executed is the ordinary case, so send the classification you reached for this revision rather than repeating the last one. If you omit it the revision inherits the LATEST revision's classification (not the root's), so a revision is never blank. That inheritance is a floor against an empty record, not permission to skip the field. Include runId or this revision will not appear in GET /agent/runs/{id}. |
Responses
| Status | Meaning |
|---|---|
201 | Created. The new revision, with its own proof and its own timestamp. |
400 | BadRequest |
401 | Unauthorized |
403 | Forbidden |
429 | RateLimited |
Example
curl -X POST "https://backend.immut.io/api/v1/documents/<id>/version" \
-H "Authorization: Bearer $IMMUT_API_KEY" \
-F "file=@/path/to/file" \
-F "agentClassification=<agentClassification>"
Generated from the immut API contract, version 1.9.0. Machine-readable: this page as markdown · everything in one file · OpenAPI