{"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":"Delete a sealed record","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":"delete-a-sealed-record","__idx":0},"children":["Delete a sealed record"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Soft-deletes a record. It becomes an envelope-only ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["tombstone"]},": it appears in the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/list-changes"},"children":["change feed"]}," and the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/list-deleted"},"children":["deleted list"]},", 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. Its content is kept until then, so an undelete restores it."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A store keeps its newest 500 tombstones. A delete past that removes the store's oldest tombstone at once, before its 30 days are up, and feed cursors from before that removal are then refused with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["410 SEALED_CURSOR_EXPIRED"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The delete names the revision it was read at in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["revision"]}," query parameter. A stale one is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["409 SEALED_RECORD_REVISION_CONFLICT"]},", and an already deleted record ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["409 SEALED_RECORD_DELETED"]},"; both carry the record as it is now in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error.details.current"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Requires an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Idempotency-Key"]}," header: re-sending the same key answers the first call's exact response (header ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Idempotent-Replayed: true"]},") and changes nothing; a refused call is not remembered, so it may be retried with the same key."]},{"$$mdtype":"Tag","name":"ApiContainer","attributes":{},"children":[{"$$mdtype":"Tag","name":"ApiContent","attributes":{},"children":[{"$$mdtype":"Tag","name":"Endpoint","attributes":{"method":"DELETE","path":"https://api.aitronos.com/v1/sealed-stores/{store}/records/{record_id}"},"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":"query-parameters","__idx":2},"children":["Query Parameters"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["revision"]}]}," 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 revision this delete was based on. At least 1."]},{"$$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 deleting device's id: the device id it signed in with. 16 to 255 characters of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["A-Z a-z 0-9 . _ : @ -"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"headers","__idx":3},"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":"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":["200 OK"]}," with the tombstone's envelope: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["deleted"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["deleted_at"]}," is set, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payload_bytes"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["device_id"]}," is the deleting device."]},{"$$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_record_envelope"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}]}," string — the client's record id."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["kind"]}]}," string — ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["session"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["favourites"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["schema_version"]}]}," integer — as the last accepted write sent it."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["revision"]}]}," integer — server-assigned; rises by 1 on every accepted write."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["created_at"]}]}," string — when the record was created (ISO 8601 UTC)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["last_touched_at"]}]}," string — set by the server on every accepted write. Sort by it, ties by ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["deleted"]}]}," boolean — whether the record is a tombstone."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["deleted_at"]}]}," string or null — when it was deleted."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["device_id"]}]}," string — the device of the last accepted write."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payload_bytes"]}]}," integer or null — the decoded payload size; ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]}," for a tombstone."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["There is no copy of the sealed 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 it."]},{"$$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":["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 already deleted. This wins over a stale revision. ",{"$$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_REVISION_CONFLICT"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["revision"]}," is not the record's current revision. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details.current"]}," is the record as it is now."]}]},{"$$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":["VALIDATION_ERROR"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["revision"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["device_id"]}," is missing or invalid, or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["record_id"]}," 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 DELETE \"https://api.aitronos.com/v1/sealed-stores/aitronos-browser/records/vSWmWbg9sDur336pnYgYzQ?revision=2&device_id=1f783def-2aa1-4b44-9c73-3c6b9102c06b\" \\\n  -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n  -H \"Idempotency-Key: 604d9e35-d800-493f-bec6-37cceeeb0245\"\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\nresponse = requests.delete(\n    \"https://api.aitronos.com/v1/sealed-stores/aitronos-browser/records/vSWmWbg9sDur336pnYgYzQ\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['AITRONOS_TOKEN']}\",\n        \"Idempotency-Key\": idempotency_key,\n    },\n    params={\"revision\": 2, \"device_id\": \"1f783def-2aa1-4b44-9c73-3c6b9102c06b\"},\n    timeout=30,\n)\nbody = response.json()\nif response.status_code == 200:\n    print(\"deleted at\", body[\"deleted_at\"], \"- tombstone revision\", body[\"revision\"])\nelif body[\"error\"][\"code\"] in (\"SEALED_RECORD_REVISION_CONFLICT\", \"SEALED_RECORD_DELETED\"):\n    current = body[\"error\"][\"details\"][\"current\"]\n    print(\"record is at revision\", current[\"revision\"], \"deleted:\", current[\"deleted\"])\nelse:\n    print(response.status_code, body[\"error\"][\"code\"])\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\nconst params = new URLSearchParams({ revision: \"2\", device_id: \"1f783def-2aa1-4b44-9c73-3c6b9102c06b\" });\nconst response = await fetch(`https://api.aitronos.com/v1/sealed-stores/aitronos-browser/records/vSWmWbg9sDur336pnYgYzQ?${params}`, {\n  method: \"DELETE\",\n  headers: {\n    Authorization: `Bearer ${process.env.AITRONOS_TOKEN}`,\n    \"Idempotency-Key\": idempotencyKey,\n  },\n});\nconst body = await response.json();\nif (response.ok) {\n  console.log(\"deleted at\", body.deleted_at, \"- tombstone revision\", body.revision);\n} else {\n  console.log(response.status, body.error.code, body.error.details.current?.revision);\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":"200 OK","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"object\": \"sealed_record_envelope\",\n  \"id\": \"vSWmWbg9sDur336pnYgYzQ\",\n  \"kind\": \"session\",\n  \"schema_version\": 1,\n  \"revision\": 3,\n  \"created_at\": \"2026-10-10T08:41:17.204913Z\",\n  \"last_touched_at\": \"2026-10-10T09:30:05.551390Z\",\n  \"deleted\": true,\n  \"deleted_at\": \"2026-10-10T09:30:05.551390Z\",\n  \"device_id\": \"1f783def-2aa1-4b44-9c73-3c6b9102c06b\",\n  \"payload_bytes\": null\n}\n","lang":"json"},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"label":"409 Already deleted","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"SEALED_RECORD_DELETED\",\n    \"message\": \"This item was deleted on another device.\",\n    \"system_message\": \"the record is a tombstone; undelete it before writing\",\n    \"type\": \"client_error\",\n    \"status\": 409,\n    \"details\": {\n      \"current\": {\n        \"object\": \"sealed_record\",\n        \"id\": \"vSWmWbg9sDur336pnYgYzQ\",\n        \"kind\": \"session\",\n        \"schema_version\": 1,\n        \"revision\": 3,\n        \"created_at\": \"2026-10-10T08:41:17.204913Z\",\n        \"last_touched_at\": \"2026-10-10T09:30:05.551390Z\",\n        \"deleted\": true,\n        \"deleted_at\": \"2026-10-10T09:30:05.551390Z\",\n        \"device_id\": \"1f783def-2aa1-4b44-9c73-3c6b9102c06b\",\n        \"wrapped_dek\": null,\n        \"payload\": null,\n        \"payload_bytes\": null\n      }\n    },\n    \"trace_id\": \"aee5ef40-67ef-4a9a-aea6-43616371dcf4\",\n    \"timestamp\": \"2026-10-10T09:30:41.906224Z\"\n  }\n}\n","lang":"json"},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"label":"409 Stale revision","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"SEALED_RECORD_REVISION_CONFLICT\",\n    \"message\": \"This item changed on another device. Merge and save again.\",\n    \"system_message\": \"revision 1 is stale; the record is at revision 2\",\n    \"type\": \"client_error\",\n    \"status\": 409,\n    \"details\": {\n      \"current\": {\n        \"object\": \"sealed_record\",\n        \"id\": \"vSWmWbg9sDur336pnYgYzQ\",\n        \"kind\": \"session\",\n        \"schema_version\": 1,\n        \"revision\": 2,\n        \"created_at\": \"2026-10-10T08:41:17.204913Z\",\n        \"last_touched_at\": \"2026-10-10T09:02:44.918207Z\",\n        \"deleted\": false,\n        \"deleted_at\": null,\n        \"device_id\": \"1aee2c02-ccac-4ede-b017-1334be895e2e\",\n        \"wrapped_dek\": {\n          \"v\": 1,\n          \"aead\": \"aes-256-gcm\",\n          \"nonce\": \"oxwDDz+SyxUEkitE\",\n          \"ct\": \"UvORUdzuxuE3FMncUQgc4qOEz2QT8a5LarNYrATM0A4Zi1J0aJj9Yu+5ySIKPQHY\",\n          \"epk\": \"fRXpvCBVDmU9kJ+PSkoqi7NU2Po3FQMK9SbJiz1gOGs=\"\n        },\n        \"payload\": \"hWbThAu7J8u8jIcvARYROTja+vbbV4hlntXsIctvvcVdqWGMyTjVt2LgISSfrFORn+gjkJcDsT9l8dsHXoFFCaDLzP06FHLuixGaBMY3WOfWFex4l7SU0G5IKY7DABr74o0l20asWcd9gADrlQl4Zg==\",\n        \"payload_bytes\": 112\n      }\n    },\n    \"trace_id\": \"73433f8c-a40d-41a7-92d2-c0177676ddb9\",\n    \"timestamp\": \"2026-10-10T09:29:58.163390Z\"\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/undelete-record"},"children":["Undelete a sealed record"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/list-deleted"},"children":["List deleted sealed records"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference/sealed-stores/get-record"},"children":["Get 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"]}]}]}]},"headings":[{"value":"Delete a sealed record","id":"delete-a-sealed-record","depth":1},{"value":"Path Parameters","id":"path-parameters","depth":4},{"value":"Query Parameters","id":"query-parameters","depth":4},{"value":"Headers","id":"headers","depth":4},{"value":"Returns","id":"returns","depth":2},{"value":"Errors","id":"errors","depth":2},{"value":"Related Resources","id":"related-resources","depth":2}],"frontmatter":{"title":"Delete a sealed record","keywords":["sealed store","sealed record","delete","tombstone","soft delete"],"seo":{"title":"Delete a sealed record"}},"lastModified":"2026-10-26T18:32:31.650Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/api-reference/sealed-stores/delete-record","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}