{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs/api-reference/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["api-container","api-content","endpoint","api-examples","code-group","tabs","tab"]},"redocly_category":"API Reference","searchWeight":120,"type":"markdown"},"seo":{"title":"Append a superseded value","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":"append-a-superseded-value","__idx":0},"children":["Append a superseded value"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Keeps one sealed value that a merge discarded, such as the name that lost a rename on another device, so the person can still recover it. It is allowed on a deleted record too, since a merge can lose a value to a delete."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Idempotent on the body's ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["idempotency_key"]},"."]}," Appending the same key to the same record again answers the stored entry with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200 OK"]}," and stores nothing. The answer is the entry without its sealed content; the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/list-superseded"},"children":["list read"]}," carries it."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Entries are kept 30 days, at most 200 per record and 2,000 per store, each at most 64 KiB decoded. When either log is full the append is refused with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["422 SEALED_SUPERSEDED_LIMIT_REACHED"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details.scope"]}," says which); nothing is dropped to make room, because every entry is a value the person may still want back."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Also requires an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Idempotency-Key"]}," header, like every write: re-sending the same header answers the first call's exact response (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Idempotent-Replayed: true"]},")."]},{"$$mdtype":"Tag","name":"ApiContainer","attributes":{},"children":[{"$$mdtype":"Tag","name":"ApiContent","attributes":{},"children":[{"$$mdtype":"Tag","name":"Endpoint","attributes":{"method":"POST","path":"https://api.aitronos.com/v1/sealed-stores/{store}/records/{record_id}/superseded"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"path-parameters","__idx":1},"children":["Path Parameters"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["store"]}]}," string ",{"$$mdtype":"Tag","name":"em","attributes":{"style":{"color":"#ef4444 !important","fontWeight":"600 !important","fontStyle":"normal !important"}},"children":["required"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The store: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["aitronos-browser"]},". Up to 64 characters; an unknown store is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["404 SEALED_STORE_NOT_FOUND"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["record_id"]}]}," string ",{"$$mdtype":"Tag","name":"em","attributes":{"style":{"color":"#ef4444 !important","fontWeight":"600 !important","fontStyle":"normal !important"}},"children":["required"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The record's id, as the client minted it: 16 to 128 characters of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["A-Z a-z 0-9 _ -"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"headers","__idx":2},"children":["Headers"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization"]}]}," string ",{"$$mdtype":"Tag","name":"em","attributes":{"style":{"color":"#ef4444 !important","fontWeight":"600 !important","fontStyle":"normal !important"}},"children":["required"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Bearer <access token>"]}," from the person's own sign-in. API keys and service accounts are refused with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["403 SEALED_STORE_PERSONAL_SESSION_REQUIRED"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Idempotency-Key"]}]}," string ",{"$$mdtype":"Tag","name":"em","attributes":{"style":{"color":"#ef4444 !important","fontWeight":"600 !important","fontStyle":"normal !important"}},"children":["required"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A random id minted once for this change and sent again on every retry of it: 16 to 128 printable ASCII characters, no spaces (a UUID works). The first accepted answer is remembered for 30 days; see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/introduction#idempotency-key"},"children":["Idempotency-Key"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"body-parameters","__idx":3},"children":["Body Parameters"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["idempotency_key"]}]}," string ",{"$$mdtype":"Tag","name":"em","attributes":{"style":{"color":"#ef4444 !important","fontWeight":"600 !important","fontStyle":"normal !important"}},"children":["required"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An opaque key the client computes for the value, for example a keyed digest of it: 16 to 128 printable ASCII characters, no spaces. The same value gives the same key even though its ciphertext differs every time it is sealed."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["schema_version"]}]}," integer ",{"$$mdtype":"Tag","name":"em","attributes":{"style":{"color":"#ef4444 !important","fontWeight":"600 !important","fontStyle":"normal !important"}},"children":["required"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The client's schema and sealing version for this value, 1 to 2,147,483,647. Stored and returned as sent; the server never interprets it."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["device_id"]}]}," string ",{"$$mdtype":"Tag","name":"em","attributes":{"style":{"color":"#ef4444 !important","fontWeight":"600 !important","fontStyle":"normal !important"}},"children":["required"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The writing device's id: the device id this device signed in with. 16 to 255 characters of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["A-Z a-z 0-9 . _ : @ -"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["wrapped_dek"]}]}," object or null ",{"$$mdtype":"Tag","name":"em","attributes":{"style":{"color":"#9ca3af !important","fontWeight":"500 !important","fontStyle":"normal !important"}},"children":["optional"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The entry's own wrapped data key (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["v"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["aead"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nonce"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ct"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["epk"]},", the same shape as a record's), or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]}," when the entry is sealed under its record's data key. Defaults to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payload"]}]}," string ",{"$$mdtype":"Tag","name":"em","attributes":{"style":{"color":"#ef4444 !important","fontWeight":"600 !important","fontStyle":"normal !important"}},"children":["required"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The sealed value, standard padded base64. At least 28 bytes and at most 64 KiB (65,536 bytes) decoded."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"returns","__idx":4},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["201 Created"]}," with the new entry, or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200 OK"]}," with the entry already kept under this ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["idempotency_key"]},". Neither carries the sealed content; ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/list-superseded"},"children":["List superseded values"]}," does."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]}]}," string — ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sealed_superseded_envelope"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}]}," string — the entry's id (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sealsup_"]}," and 32 hex characters)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["record_id"]}]}," string — the record it belongs to."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["idempotency_key"]}]}," string — as sent."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["schema_version"]}]}," integer — as sent."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["device_id"]}]}," string — the device that appended it."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["created_at"]}]}," string — when it was kept (ISO 8601 UTC)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payload_bytes"]}]}," integer — the decoded size of its payload."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every answer carries the header ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Idempotent-Replayed"]}]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," on the first answer, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," when this is the remembered answer to an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Idempotency-Key"]}," sent before."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"errors","__idx":5},"children":["Errors"]},{"$$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":"When"},"children":["When"]}]}]},{"$$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":["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":["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 this ",{"$$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":["413"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEALED_PAYLOAD_TOO_LARGE"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payload"]}," is over 64 KiB decoded (",{"$$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_IDEMPOTENCY_KEY_REQUIRED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No ",{"$$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":["SEALED_PAYLOAD_INVALID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payload"]}," 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_SUPERSEDED_LIMIT_REACHED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The record already holds 200 entries, or the store 2,000, within the last 30 days (",{"$$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":["VALIDATION_ERROR"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A body field is missing, of the wrong type or out of range, for example an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["idempotency_key"]}," that does not match its pattern."]}]}]}]}]}]},{"$$mdtype":"Tag","name":"ApiExamples","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeGroup","attributes":{"mode":"dropdown"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","data-title":"cURL","header":{"title":"cURL","controls":{"copy":{}}},"source":"curl -X POST \"https://api.aitronos.com/v1/sealed-stores/aitronos-browser/records/vSWmWbg9sDur336pnYgYzQ/superseded\" \\\n  -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n  -H \"Idempotency-Key: d20c67e1-5a91-473d-be6d-0b5d0527a5b8\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"idempotency_key\": \"_L-GAnevXC-zPLB0ZuEDXbvnEAUx-Xu3qqUsPYEptYo\",\n  \"schema_version\": 1,\n  \"device_id\": \"1aee2c02-ccac-4ede-b017-1334be895e2e\",\n  \"wrapped_dek\": null,\n  \"payload\": \"kwzYjhH7rTGITjOzIhiW8zdwJbbx/yp8+Sb5pCJ3FLqWaw66/CGT5Q==\"\n}'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","data-title":"Python","header":{"title":"Python","controls":{"copy":{}}},"source":"import os\nimport uuid\n\nimport requests\n\nidempotency_key = str(uuid.uuid4())  # once per change; reuse it on every retry\n\n# The body's idempotency_key identifies the VALUE (for example a keyed digest\n# of it), so the same lost value is kept once however often it is appended.\n# The Idempotency-Key header identifies this CALL, like on every write.\nentry = {\n    \"idempotency_key\": \"_L-GAnevXC-zPLB0ZuEDXbvnEAUx-Xu3qqUsPYEptYo\",\n    \"schema_version\": 1,\n    \"device_id\": \"1aee2c02-ccac-4ede-b017-1334be895e2e\",\n    \"wrapped_dek\": None,\n    \"payload\": \"kwzYjhH7rTGITjOzIhiW8zdwJbbx/yp8+Sb5pCJ3FLqWaw66/CGT5Q==\"\n}\n\nresponse = requests.post(\n    \"https://api.aitronos.com/v1/sealed-stores/aitronos-browser/records/vSWmWbg9sDur336pnYgYzQ/superseded\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['AITRONOS_TOKEN']}\",\n        \"Idempotency-Key\": idempotency_key,\n    },\n    json=entry,\n    timeout=30,\n)\nbody = response.json()\nif response.status_code in (200, 201):\n    # 201: kept. 200: this idempotency_key was already kept; nothing new was stored.\n    print(\"entry\", body[\"id\"], \"kept at\", body[\"created_at\"])\nelse:\n    print(response.status_code, body[\"error\"][\"code\"], body[\"error\"][\"details\"])\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","data-title":"JavaScript","header":{"title":"JavaScript","controls":{"copy":{}}},"source":"const idempotencyKey = crypto.randomUUID(); // once per change; reuse it on every retry\n// The body's idempotency_key identifies the VALUE; the header identifies this CALL.\nconst entry = {\n  \"idempotency_key\": \"_L-GAnevXC-zPLB0ZuEDXbvnEAUx-Xu3qqUsPYEptYo\",\n  \"schema_version\": 1,\n  \"device_id\": \"1aee2c02-ccac-4ede-b017-1334be895e2e\",\n  \"wrapped_dek\": null,\n  \"payload\": \"kwzYjhH7rTGITjOzIhiW8zdwJbbx/yp8+Sb5pCJ3FLqWaw66/CGT5Q==\"\n};\n\nconst response = await fetch(\"https://api.aitronos.com/v1/sealed-stores/aitronos-browser/records/vSWmWbg9sDur336pnYgYzQ/superseded\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.AITRONOS_TOKEN}`,\n    \"Content-Type\": \"application/json\",\n    \"Idempotency-Key\": idempotencyKey,\n  },\n  body: JSON.stringify(entry),\n});\nconst body = await response.json();\nif (response.ok) {\n  console.log(\"entry\", body.id, \"kept at\", body.created_at);\n} else {\n  console.log(response.status, body.error.code, body.error.details);\n}\n","lang":"javascript"},"children":[]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Response:"]}]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"label":"201 Created","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"object\": \"sealed_superseded_envelope\",\n  \"id\": \"sealsup_3f3a0c50a8b1db8814d48a98ada6a0d1\",\n  \"record_id\": \"vSWmWbg9sDur336pnYgYzQ\",\n  \"idempotency_key\": \"_L-GAnevXC-zPLB0ZuEDXbvnEAUx-Xu3qqUsPYEptYo\",\n  \"schema_version\": 1,\n  \"device_id\": \"1aee2c02-ccac-4ede-b017-1334be895e2e\",\n  \"created_at\": \"2026-10-10T09:02:45.120774Z\",\n  \"payload_bytes\": 40\n}\n","lang":"json"},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"label":"422 Log full","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"SEALED_SUPERSEDED_LIMIT_REACHED\",\n    \"message\": \"This item has kept as many replaced values as it can.\",\n    \"system_message\": \"the record holds 200 superseded entries, the most allowed\",\n    \"type\": \"validation_error\",\n    \"status\": 422,\n    \"details\": {\n      \"limit\": 200,\n      \"scope\": \"record\"\n    },\n    \"trace_id\": \"73b044e1-8cd8-47da-91a9-84588b15b361\",\n    \"timestamp\": \"2026-10-10T09:06:31.927350Z\"\n  }\n}\n","lang":"json"},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"label":"404 Not found","disable":false},"children":[{"$$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\": \"8072201e-2670-4016-b6f6-2fd0e7a359ef\",\n    \"timestamp\": \"2026-10-10T09:07:02.394118Z\"\n  }\n}\n","lang":"json"},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"related-resources","__idx":6},"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/introduction"},"children":["Sealed stores"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/list-superseded"},"children":["List superseded values"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/update-record"},"children":["Update a sealed record"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/get-record"},"children":["Get a sealed record"]}]}]}]},"headings":[{"value":"Append a superseded value","id":"append-a-superseded-value","depth":1},{"value":"Path Parameters","id":"path-parameters","depth":4},{"value":"Headers","id":"headers","depth":4},{"value":"Body Parameters","id":"body-parameters","depth":4},{"value":"Returns","id":"returns","depth":2},{"value":"Errors","id":"errors","depth":2},{"value":"Related Resources","id":"related-resources","depth":2}],"frontmatter":{"title":"Append a superseded value","keywords":["sealed store","superseded","merge","recovery","idempotency"],"seo":{"title":"Append a superseded value"}},"lastModified":"2026-10-26T18:32:31.650Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/api-reference/sealed-stores/append-superseded","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}