Store sealed Memory Crystal envelope (2 MiB max; ChaCha20-Poly1305 / AES-256-GCM)

post/crystals

Request

  • Base URL: https://api.whitemagic.dev
  • URL: https://api.whitemagic.dev/crystals
  • Auth: one of:
    • HTTP bearer
    • API key in header X-WM-Key
    • API key in header X-PAYMENT

Request body

specstring

Crystal envelope specification version

crystal_idstring required

Content address: sha256:<64 hex> of the decoded ciphertext bytes

parent_crystal_idstring nullable

Optional parent crystal content address in lineage DAG

tenant_hashstring required

Authenticated owner locator returned by GET /crystals/owner-locator

cipher'chacha20-poly1305' | 'aes-256-gcm' required

AEAD cipher suite used to seal the crystal

noncestring required

base64url-encoded 12-byte AEAD nonce

ciphertextstring required

base64url-encoded sealed ciphertext including authentication tag

size_bytesinteger

Decoded byte length of ciphertext (must equal len(decoded ciphertext))

created_atstring required

RFC 3339 creation timestamp bound in AEAD AAD

metadata_publicobject

Optional non-sensitive public metadata

kek_versioninteger

Optional client Key Encryption Key (KEK) version wrapping wrapped_dek (I1/I2)

id_kek_versioninteger

Optional initial KEK version bound into crystal_id = sha256(id_kek_version_be32 || nonce || ciphertext)

wrapped_dekstring

Optional base64url-encoded 60-byte AEAD-wrapped per-crystal DEK (12B nonce + 32B DEK + 16B tag)

Response

crystal stored

storedboolean required
crystal_idstring required
parent_crystal_idstring nullable
tenant_hashstring required
size_bytesinteger required
servicestring required

Changes

No recorded changes to this operation across all 1 revision of this API.