Documents

Upload a new revision of a stored document (multipart field file)

POSThttps://backend.immut.io/api/v1/documents/{id}/version

Required scope: documents:write

Parameters

NameInRequiredDescription
idpathyesid of the target record

Request body

Content type: multipart/form-data (required)

FieldTypeRequiredDescription
filefileyesmultipart file field (required). The new revision of the document.
agentClassificationstringnoOPTIONAL, 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

StatusMeaning
201Created. The new revision, with its own proof and its own timestamp.
400BadRequest
401Unauthorized
403Forbidden
429RateLimited

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