POST/containers/with-metadata-document
Operation containers.withMetadataDocument.create
Description
Creates a container and its encrypted metadata document in one transaction, optionally seeding the document's first update. Authorization and conflicts are those of POST /containers and POST /documents; a 409 document_manifest_already_exists may have rolled the new container back, so clients treat it as terminal unless they verify both artifacts.
Authentication
Requires a signed-in session: the client sends its session token as a bearer token in the Authorization header.
Request body
application/jsonContainerCreateWithMetadataDocumentRequest
Creates a container together with its encrypted metadata document.
4 fields
metadataDocumentobjectrequired8 fields
bodyany JSON valuerequired- at most 16 items
eventobject with any fieldsrequiredexpectedManifestHashstringrequired- not empty
manifestobject with any fieldsrequired- 1 to 100 items
Other fields are allowed.
systemSlotstringoptionalnullable- pattern
^sys_v1_[A-Za-z0-9_-]{43}$
- pattern
The metadata document's first queued update, committed in the same transaction.
Other fields are allowed.
Responses
200 OK
application/jsonContainerCreateWithMetadataDocumentResponse
Acknowledges a container and its metadata document.
2 fields
Other fields are allowed.
Other responses
| Status | Meaning | Body |
|---|---|---|
| 400 | Bad Request |
|
| 401 | Unauthorized |
|
| 402 | Payment Required |
|
| 403 | Forbidden |
|
| 404 | Not Found |
|
| 409 | Conflict |
|
| 500 | Internal Server Error |
|
| 503 | Service Unavailable |
|
Additional rules
The server also enforces these rules, which the schema above cannot express.
A container response keyring is null exactly for container key epoch 1.
A container create metadata seed must contain exactly one outgoing update and no container rekeys, and serialize within the document sync request limit.
inlineRekeyCommitIdmust be present exactly whencontainerRekeysis non-empty.authorizingContainerPathRefsis required whenoutgoingUpdatesis non-empty.containerRekeysmay be non-empty only whenoutgoingUpdatesis non-empty.Outgoing update ids must be unique within the request.
A request carrying
pullCursormust not contain outgoing updates, container rekeys, a content-key bundle, or authorizing paths.historyMode"raw" must not be combined with outgoing updates, container rekeys, a content-key bundle, or authorizing paths.historyMode"raw" requireslocalVersionVectorto be null so the complete retained history is requested.checkpointKind,checkpointPayloadKind, andsourceVersionVectormust be absent together or form a rotation baseline.