create
user.document.create
Creates a new document in the caller’s private vault. The data payload is
validated against the referenced schema (schemaRef OR embedded
documentSchema) before encryption.
Auth
Bearer JWT + unsealed vault.
Input
Info
schemaRef and documentSchema are mutually exclusive. Provide exactly one.
If uniquePerVault: true, the database enforces a single document per vault
per schema — creating a second one will fail.
Use schemaRef to target one of the 24 built-in schemas.
Use documentSchema to pass an inline JSON Schema (Draft 2020-12) — see
Embedded schemas for the
supported features, $ref composition, and gotchas (schema is immutable after
create).
GraphQL
Response
Returns DocumentMetadata (no content echo). The fresh ID is id, version
starts at 1.
curl
Errors
Validation errors against the JSON Schema come back as GraphQL errors under
the errors array. Consider calling
validate first if you want structured field-level
feedback without mutating state.