{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs/api-reference/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"API Reference","searchWeight":120,"type":"markdown"},"seo":{"title":"Sealed stores","description":"Complete API reference and documentation for Freddy AI-powered backend system by Aitronos","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"sealed-stores","__idx":0},"children":["Sealed stores"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["sealed store"]}," keeps a person's records in sync across their devices without Aitronos being able to read them. The client encrypts every record before it leaves the device. The server stores the ciphertext, orders the changes, arbitrates conflicting writes between devices, keeps a short history, and removes what has expired. It never holds a key that opens a record, and it never interprets what is inside one."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every path starts with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.aitronos.com/v1/sealed-stores/{store}"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"stores-and-record-kinds","__idx":1},"children":["Stores and record kinds"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["One store is available today:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Store"},"children":["Store"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Kind"},"children":["Kind"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Live records per person"},"children":["Live records per person"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["aitronos-browser"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["session"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["500"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["aitronos-browser"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["favourites"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Any other store name answers ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["404 SEALED_STORE_NOT_FOUND"]},", and any other kind answers ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["422 SEALED_KIND_INVALID"]},". Only live records count towards a cap; deleted records do not. ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/get-store"},"children":["Get a sealed store's limits"]}," returns the caps, every other limit on this page, and how many live records of each kind the caller holds, so a client can check a save before it starts."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"who-can-call","__idx":2},"children":["Who can call"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Sealed stores are reached only with ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["a person's own sign-in session"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization: Bearer <access token>"]},", where the token comes from that person signing in. API keys of any kind and service accounts are refused with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["403 SEALED_STORE_PERSONAL_SESSION_REQUIRED"]},", because nothing but the person may act on their encrypted data. A missing or invalid token is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["401"]},". As on every signed-in route, the person must belong to an organization, or the call is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["403 NO_ORGANIZATION_MEMBERSHIP"]},"; the store itself belongs to the person, not to an organization, so it is the same store whichever organization is active."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each person's store is their own. A record id that belongs to somebody else answers ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["404 SEALED_RECORD_NOT_FOUND"]},", exactly like an id that was never created."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"records-envelope-and-payload","__idx":3},"children":["Records: envelope and payload"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every record is two parts."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["The envelope"]}," is what the server needs to do its job, and it is readable:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Set by"},"children":["Set by"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Meaning"},"children":["Meaning"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["client"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The record's id, minted randomly by the client: 16 to 128 characters of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["A-Z a-z 0-9 _ -"]},". Never derive it from the content."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["kind"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["client"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["session"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["favourites"]},". Fixed at create."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["schema_version"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["client"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The client's own schema and sealing version for this value, 1 to 2,147,483,647. Stored and returned as sent."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["device_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["client"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The device of the last accepted write: the device id the device signed in with, 16 to 255 characters of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["A-Z a-z 0-9 . _ : @ -"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["revision"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["server"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1 at create, plus 1 on every accepted write, delete and undelete included."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["created_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["server"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["When the record was created."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["last_touched_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["server"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Set on every accepted write. Sort by it, ties by ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["deleted"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["deleted_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["server"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Whether the record is a tombstone, and since when."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payload_bytes"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["server"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The decoded size of the payload; ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]}," for a tombstone."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Values the server owns are ignored if a client sends them."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["The sealed content"]}," is opaque to the server:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payload"]}]}," — the encrypted bytes, standard padded base64. At least 28 bytes decoded (a 12-byte nonce plus a 16-byte tag) and at most 512 KiB (524,288 bytes) decoded."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["wrapped_dek"]}]}," — the record's data key, wrapped to the account's identity public key with an ephemeral X25519 key agreement and an AEAD:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\"v\": 1, \"aead\": \"aes-256-gcm\", \"nonce\": \"<base64 12 bytes>\", \"ct\": \"<base64 48 bytes>\", \"epk\": \"<base64 32 bytes>\"}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["v"]}," is accepted as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"1\""]}," and always returned as the integer ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]},". ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["aead"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["aes-256-gcm"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["chacha20-poly1305"]},". ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ct"]}," is the wrapped key plus its tag. A wrapped key of the wrong shape is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["422 SEALED_WRAPPED_KEY_INVALID"]},"; an unknown field inside it is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["422 VALIDATION_ERROR"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["The payload ceiling counts the payload alone."]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["wrapped_dek"]}," is a small fixed-size key wrap and is not counted. A payload over the ceiling is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["413 SEALED_PAYLOAD_TOO_LARGE"]},"; one that is not standard padded base64, or is shorter than 28 bytes, is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["422 SEALED_PAYLOAD_INVALID"]},". These are the only checks the server makes on sealed content: that it decodes and that its size is in bounds."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A deleted record (a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["tombstone"]},") is envelope-only: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["deleted"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["wrapped_dek"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payload"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payload_bytes"]}," are ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All byte values are standard padded base64. All times are ISO 8601 UTC with a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Z"]},", to the microsecond."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"idempotency-key","__idx":4},"children":["Idempotency-Key"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DELETE"]}," requires an ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Idempotency-Key"]}]}," header: a random id the client mints once per change and sends again on every retry of that change. It is 16 to 128 printable ASCII characters with no spaces; a UUID works. A missing key is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["422 SEALED_IDEMPOTENCY_KEY_REQUIRED"]}," and a malformed one ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["422 SEALED_IDEMPOTENCY_KEY_INVALID"]},"."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["A replay answers the first answer."]}," The first accepted answer to a key is kept for 30 days, up to the newest 50,000 keys per store. Sending the same key with the same call again answers the exact same status and bytes, with the header ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Idempotent-Replayed: true"]},", and changes nothing, even if the record has changed since. A first answer carries ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Idempotent-Replayed: false"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["A refused call is not remembered."]}," A ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["409"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["413"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["422"]}," stores nothing, so after merging, the client may retry with the same key."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["One key, one call."]}," The same key sent for a different call (another endpoint, another record, or another body) is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["422 SEALED_IDEMPOTENCY_KEY_REUSED"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Keys are scoped to the person and the store."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every write is also idempotent by its own rules, so a retry whose remembered answer has aged out never makes a duplicate: a create with the same ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}," answers the record that id names (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200"]},"), an update or delete naming an old ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["revision"]}," answers ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["409"]}," with the current record, and a superseded append with the same ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["idempotency_key"]}," answers the stored entry (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200"]},")."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"writes-to-one-store-are-serial","__idx":5},"children":["Writes to one store are serial"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The server takes one lock per person and store for every write, so revisions, the change sequence and the caps can never race each other. Writes sent at the same time therefore wait for each other. A write that waits more than 2 seconds for that lock is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["503 SERVICE_TEMPORARILY_UNAVAILABLE"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["retry_after"]},", and nothing was written: send it again with the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["same ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Idempotency-Key"]}," and the same body"]},". Sending one store's writes one at a time, or a few at once, keeps the wait short."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"writes-answer-the-envelope","__idx":6},"children":["Writes answer the envelope"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An accepted create, update, delete or undelete answers the record's ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["envelope"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object: \"sealed_record_envelope\""]},"), with its new ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["revision"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["last_touched_at"]}," and without a copy of the sealed content. The writer already holds what it sent. To read the content, ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/get-record"},"children":["get the record"]}," or read the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/list-changes"},"children":["change feed"]},", for example after an undelete."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"conflicts","__idx":7},"children":["Conflicts"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A write names the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["revision"]}," it was based on. When the record has moved on, or is in the wrong state for the write, the answer is a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["409"]}," that carries ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["the full record as the server holds it now"]}," in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error.details.current"]},": the envelope and the payload, or the tombstone. The client merges and writes again without another read."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Code"},"children":["Code"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"When"},"children":["When"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_RECORD_REVISION_CONFLICT"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["revision"]}," sent is not the record's current revision."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_RECORD_DELETED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The record is a tombstone. Undelete it before writing. This wins over a stale revision."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_RECORD_NOT_DELETED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Undelete of a record that is live."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_RECORD_ID_CONFLICT"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create with an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}," that already names a record of another kind."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_RECORD_SINGLETON_EXISTS"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create (or undelete) of a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["favourites"]}," record when the person already holds the live one. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["current"]}," is that record: adopt it."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"reading-changes","__idx":8},"children":["Reading changes"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/list-changes"},"children":["List changes"]}," is the sync read."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Full read."]}," Without ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["since"]},", it returns every record in the store, live and tombstoned, in change order."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Delta read."]}," With ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["since"]},", it returns every record created, updated, deleted or undeleted after that cursor, each once, in its current state. A deleted record arrives as its tombstone."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Follow ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["next_cursor"]}," while ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["has_more"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},", then keep the last ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["next_cursor"]}," for the next sync. Cursors are opaque: store them and send them back, never parse or build one."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A cursor issued more than 30 days ago, or one from before a tombstone that has since been removed, is refused with ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["410 SEALED_CURSOR_EXPIRED"]}]},". It means the delta can no longer be complete: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["do a full read and reconcile"]}," the device's records against it. A cursor this store did not issue is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["422 SEALED_CURSOR_INVALID"]},"; treat it the same way."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"deleting-recovery-and-history","__idx":9},"children":["Deleting, recovery and history"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Tombstones."]}," A delete turns the record into a tombstone. It appears in the feed and in ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/list-deleted"},"children":["List deleted records"]},", and it can be ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/undelete-record"},"children":["undeleted"]}," for 30 days, after which it is removed for good. A store keeps at most its newest 500 tombstones: a delete past that removes the oldest tombstone at once, before its 30 days are up."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Revision history."]}," Every create, update and undelete keeps a copy of the content for 30 days, at most the newest 100 per record and 1,000 across the store (past that, the store's oldest revisions go first, whichever record they belong to). A delete keeps no content. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/list-revisions"},"children":["List a record's revisions"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Superseded values."]}," A value a client-side merge discarded, such as the name that lost a rename on another device, can be ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/append-superseded"},"children":["kept on the record"]}," so the person can recover it. Kept 30 days, at most 200 per record and 2,000 per store, each at most 64 KiB (65,536 bytes) decoded. A full log refuses new entries rather than dropping old ones."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Account key blob."]}," Each store holds one account-scoped opaque blob, at most 2 KiB (2,048 bytes) decoded, that every one of the person's signed-in devices can read. The ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/create-account-key"},"children":["first create wins"]}," and it is never replaced."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"limits","__idx":10},"children":["Limits"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Limit"},"children":["Limit"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Value"},"children":["Value"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Live ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["session"]}," records per person"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["500"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Live ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["favourites"]}," records per person"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Sealed payload per record"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["512 KiB (524,288 bytes) decoded, counting ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payload"]}," alone, not ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["wrapped_dek"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Smallest sealed value"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["28 bytes decoded"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Superseded entry payload"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["64 KiB (65,536 bytes) decoded"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Superseded entries"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["200 per record and 2,000 per store, within 30 days"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Account key blob"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2 KiB (2,048 bytes) decoded"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Revision history"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100 per record and 1,000 per store, within 30 days"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Tombstones"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["500 per store, each for 30 days"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Remembered ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Idempotency-Key"]}," answers"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The newest 50,000 per store, each for 30 days"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Retention"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["30 days, for tombstones, history, superseded entries, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Idempotency-Key"]}," answers and feed cursors"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Feed page"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["limit"]}," 1 to 500 (default 100); a page also stops early once it carries 8 MiB of payload, never below one record"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Deleted and superseded list pages"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["limit"]}," 1 to 500 (default 100)"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"errors","__idx":11},"children":["Errors"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every error uses the standard error format:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"SEALED_RECORD_NOT_FOUND\",\n    \"message\": \"That item isn't synced.\",\n    \"system_message\": \"no record with this id in this store\",\n    \"type\": \"client_error\",\n    \"status\": 404,\n    \"details\": {},\n    \"trace_id\": \"9d63d4ed-24bb-4579-81cf-a78ff1e78c0c\",\n    \"timestamp\": \"2026-10-10T09:12:40.318552Z\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["message"]}," is written for the person using the app; ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["system_message"]}," is for the developer."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Status"},"children":["Status"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Code"},"children":["Code"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Meaning"},"children":["Meaning"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["401"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AUTHENTICATION_REQUIRED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No access token, or one that is not valid."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["403"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_STORE_PERSONAL_SESSION_REQUIRED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The call used an API key or a service account. Only a person's own sign-in session reaches a sealed store."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["403"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NO_ORGANIZATION_MEMBERSHIP"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The signed-in person belongs to no organization."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["404"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_STORE_NOT_FOUND"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No store with that name (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details.store"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["404"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_RECORD_NOT_FOUND"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No record with that id in the caller's store, or its tombstone has passed the 30-day retention."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["404"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_REVISION_NOT_FOUND"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["That revision is a delete (it has no content) or is no longer in the kept history (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details.revision"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["404"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_ACCOUNT_KEY_NOT_FOUND"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No device has created the store's account key blob yet."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["409"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_RECORD_REVISION_CONFLICT"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["revision"]}," sent is stale. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details.current"]}," is the record now."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["409"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_RECORD_DELETED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The record is a tombstone. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details.current"]}," is the tombstone."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["409"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_RECORD_NOT_DELETED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Undelete of a live record. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details.current"]}," is the record."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["409"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_RECORD_ID_CONFLICT"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}," already names a record of another kind. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details.current"]}," is that record."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["409"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_RECORD_SINGLETON_EXISTS"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The one live ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["favourites"]}," record already exists. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details.current"]}," is that record."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["409"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_OPERATION_IN_PROGRESS"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["An earlier call with the same ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Idempotency-Key"]}," has not finished. Retry in a moment."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["410"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_CURSOR_EXPIRED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The feed cursor is too old to be complete (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details.retention_days"]},"). Do a full read and reconcile."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["413"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_PAYLOAD_TOO_LARGE"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A sealed value is over its ceiling (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details.field"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details.max_bytes"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details.payload_bytes"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["422"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_PAYLOAD_INVALID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A sealed value is not standard padded base64, or decodes to fewer than 28 bytes (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details.field"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["422"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_WRAPPED_KEY_INVALID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["wrapped_dek"]}," is not a wrapped key of the documented shape (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details.field"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["422"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_KIND_INVALID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The store does not hold that kind (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details.kind"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details.allowed"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["422"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_RECORD_LIMIT_REACHED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The person already holds the most live records of that kind (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details.kind"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details.limit"]},"). Delete one to add another."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["422"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_SUPERSEDED_LIMIT_REACHED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The record or the store already holds the most superseded entries (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details.limit"]},"; ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details.scope"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["record"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["store"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["422"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_CURSOR_INVALID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The cursor was not issued by this store. Do a full read."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["422"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_IDEMPOTENCY_KEY_REQUIRED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A write without an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Idempotency-Key"]}," header."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["422"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_IDEMPOTENCY_KEY_INVALID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Idempotency-Key"]}," is not 16 to 128 printable ASCII characters without spaces."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["422"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_IDEMPOTENCY_KEY_REUSED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Idempotency-Key"]}," was already used for a different call. Mint a new one for a new change."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["422"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["VALIDATION_ERROR"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A parameter or body field is missing, of the wrong type or out of range (for example an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}," that does not match its pattern, a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["revision"]}," above 9,223,372,036,854,775,807, or an unknown field in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["wrapped_dek"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["503"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SERVICE_TEMPORARILY_UNAVAILABLE"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The write waited too long for the store's lock (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#writes-to-one-store-are-serial"},"children":["Writes to one store are serial"]},"). Nothing was written; retry with the same ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Idempotency-Key"]}," after ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["retry_after"]}," seconds."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"endpoints","__idx":12},"children":["Endpoints"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Method"},"children":["Method"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Path"},"children":["Path"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Page"},"children":["Page"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["GET"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/v1/sealed-stores/{store}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/get-store"},"children":["Get a sealed store's limits"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["POST"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/v1/sealed-stores/{store}/records"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/create-record"},"children":["Create a sealed record"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["GET"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/v1/sealed-stores/{store}/records/{record_id}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/get-record"},"children":["Get a sealed record"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["PUT"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/v1/sealed-stores/{store}/records/{record_id}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/update-record"},"children":["Update a sealed record"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["DELETE"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/v1/sealed-stores/{store}/records/{record_id}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/delete-record"},"children":["Delete a sealed record"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["POST"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/v1/sealed-stores/{store}/records/{record_id}/undelete"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/undelete-record"},"children":["Undelete a sealed record"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["GET"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/v1/sealed-stores/{store}/changes"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/list-changes"},"children":["List sealed store changes"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["GET"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/v1/sealed-stores/{store}/deleted"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/list-deleted"},"children":["List deleted sealed records"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["GET"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/v1/sealed-stores/{store}/records/{record_id}/revisions"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/list-revisions"},"children":["List a sealed record's revisions"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["GET"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/v1/sealed-stores/{store}/records/{record_id}/revisions/{revision}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/get-revision"},"children":["Get a sealed record revision"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["POST"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/v1/sealed-stores/{store}/records/{record_id}/superseded"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/append-superseded"},"children":["Append a superseded value"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["GET"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/v1/sealed-stores/{store}/records/{record_id}/superseded"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/list-superseded"},"children":["List superseded values"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["POST"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/v1/sealed-stores/{store}/account-key"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/create-account-key"},"children":["Create the account key blob"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["GET"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/v1/sealed-stores/{store}/account-key"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/get-account-key"},"children":["Get the account key blob"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"related-resources","__idx":13},"children":["Related Resources"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/get-store"},"children":["Get a sealed store's limits"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/create-record"},"children":["Create a sealed record"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/list-changes"},"children":["List sealed store changes"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/undelete-record"},"children":["Undelete a sealed record"]}]}]}]},"headings":[{"value":"Sealed stores","id":"sealed-stores","depth":1},{"value":"Stores and record kinds","id":"stores-and-record-kinds","depth":2},{"value":"Who can call","id":"who-can-call","depth":2},{"value":"Records: envelope and payload","id":"records-envelope-and-payload","depth":2},{"value":"Idempotency-Key","id":"idempotency-key","depth":2},{"value":"Writes to one store are serial","id":"writes-to-one-store-are-serial","depth":2},{"value":"Writes answer the envelope","id":"writes-answer-the-envelope","depth":2},{"value":"Conflicts","id":"conflicts","depth":2},{"value":"Reading changes","id":"reading-changes","depth":2},{"value":"Deleting, recovery and history","id":"deleting-recovery-and-history","depth":2},{"value":"Limits","id":"limits","depth":2},{"value":"Errors","id":"errors","depth":2},{"value":"Endpoints","id":"endpoints","depth":2},{"value":"Related Resources","id":"related-resources","depth":2}],"frontmatter":{"title":"Sealed stores","keywords":["sealed store","end-to-end encryption","client-side encryption","sync","records","idempotency","delta feed"],"seo":{"title":"Sealed stores"}},"lastModified":"2026-10-26T18:32:31.651Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/api-reference/sealed-stores/introduction","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}