{"openapi":"3.1.0","info":{"title":"ReClaw Backup API","version":"0.1.0","summary":"API for zero-knowledge OpenClaw backup and restore operations.","description":"The ReClaw API lets authenticated users bootstrap an encrypted backup account, create backup upload slots, finalize encrypted archives, list backup records, download ciphertext, rotate wrapping keys, and delete backups. Readable archive contents and passphrases are never sent to the API.","contact":{"name":"ReClaw Support","email":"support@reclaw.io","url":"https://reclaw.io/contact"},"license":{"name":"Proprietary"}},"externalDocs":{"description":"Developer documentation","url":"https://reclaw.io/developers"},"servers":[{"url":"https://reclaw.io","description":"Production"}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"tags":[{"name":"Backup account","description":"Vault bootstrap, passphrase rotation, and account state."},{"name":"Backups","description":"Backup lifecycle, encrypted archive upload, and restore download."}],"paths":{"/api/backup-account":{"get":{"operationId":"getBackupAccount","tags":["Backup account"],"summary":"Get encrypted backup account state","description":"Returns whether the caller has initialized a ReClaw backup vault and the wrapped master key material required by the CLI.","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Backup account state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackupAccount"}}}},"401":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateBackupAccountCadence","tags":["Backup account"],"summary":"Reserved cadence update endpoint","description":"Backup cadence is controlled by billing plan. This endpoint returns 405 with a structured JSON error.","responses":{"401":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/backup-account/bootstrap":{"post":{"operationId":"bootstrapBackupAccount","tags":["Backup account"],"summary":"Initialize backup encryption for the caller","description":"Stores key-derivation parameters and a wrapped master key. The raw passphrase and unwrapped master key are never sent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackupAccountEnvelope"}}}},"responses":{"200":{"description":"Initialized backup account.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BackupAccount"},{"type":"object","properties":{"created":{"type":"boolean"}},"required":["created"]}]}}}},"400":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/backup-account/rotate":{"post":{"operationId":"rotateBackupAccountPassphrase","tags":["Backup account"],"summary":"Rotate wrapped master key material","description":"Updates the stored key-derivation parameters and wrapped master key after the CLI rewraps the vault locally.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackupAccountEnvelope"}}}},"responses":{"200":{"description":"Rotated backup account.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BackupAccount"},{"type":"object","properties":{"rotated":{"type":"boolean"}},"required":["rotated"]}]}}}},"400":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/backup-account/reset":{"post":{"operationId":"resetBackupAccount","tags":["Backup account"],"summary":"Reset backup account state","description":"Deletes backup account wrapping material. Existing backups require deleteBackups=true because reset is destructive when archives remain.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"deleteBackups":{"type":"boolean","default":false,"description":"When true, delete remaining visible backups before resetting the account."}}}}}},"responses":{"200":{"description":"Reset result.","content":{"application/json":{"schema":{"type":"object","properties":{"reset":{"type":"boolean"},"accountDeleted":{"type":"boolean"},"deletedBackups":{"type":"integer","minimum":0}},"required":["reset","accountDeleted","deletedBackups"]}}}},"400":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/backups":{"get":{"operationId":"listBackups","tags":["Backups"],"summary":"List visible backups","description":"Returns non-deleted backups for the caller, newest first. Expired records may be pruned before the response.","responses":{"200":{"description":"Backup list.","content":{"application/json":{"schema":{"type":"object","properties":{"backups":{"type":"array","items":{"$ref":"#/components/schemas/BackupRecord"}}},"required":["backups"]}}}},"401":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createBackupUpload","tags":["Backups"],"summary":"Create a backup upload slot","description":"Creates a pending upload record and returns the upload instructions the CLI should use for encrypted archive ciphertext.","responses":{"201":{"description":"Pending backup upload.","headers":{"X-RateLimit-Policy":{"description":"Backup cadence is determined by the caller's plan: Free daily, Plus every 4 hours, Pro every 30 minutes.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBackupResponse"}}}},"401":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/backups/upload":{"post":{"operationId":"uploadBackupCiphertext","tags":["Backups"],"summary":"Upload encrypted backup ciphertext","description":"Uploads an encrypted archive up to 50 MB either directly in local storage mode or through Vercel Blob client upload negotiation in production.","parameters":[{"name":"backupId","in":"query","required":false,"description":"Required for direct local uploads. Production client uploads provide the target pathname in the Vercel Blob request body.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary","description":"Encrypted archive bytes."}},"application/json":{"schema":{"type":"object","description":"Vercel Blob client upload request body generated by @vercel/blob/client.","additionalProperties":true}}}},"responses":{"200":{"description":"Vercel Blob client upload response.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"201":{"description":"Direct local upload response.","content":{"application/json":{"schema":{"type":"object","properties":{"pathname":{"type":"string"},"size":{"type":"integer","minimum":0}},"required":["pathname","size"]}}}},"400":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/backups/{id}":{"get":{"operationId":"getBackup","tags":["Backups"],"summary":"Get backup detail","parameters":[{"$ref":"#/components/parameters/BackupId"}],"responses":{"200":{"description":"Backup detail with encrypted metadata envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackupDetail"}}}},"401":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteBackup","tags":["Backups"],"summary":"Delete a backup","description":"Deletes the encrypted archive and marks the record deleted. This is destructive.","parameters":[{"$ref":"#/components/parameters/BackupId"}],"responses":{"200":{"description":"Deleted backup state.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"$ref":"#/components/schemas/BackupStatus"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","status","deletedAt"]}}}},"401":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/backups/{id}/finalize":{"post":{"operationId":"finalizeBackup","tags":["Backups"],"summary":"Finalize encrypted backup metadata","description":"Marks an uploaded archive restore-ready after the CLI sends encrypted metadata and size information.","parameters":[{"$ref":"#/components/parameters/BackupId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackupFinalizeRequest"}}}},"responses":{"200":{"description":"Finalized backup detail.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackupDetail"}}}},"400":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/backups/{id}/content":{"get":{"operationId":"downloadBackupCiphertext","tags":["Backups"],"summary":"Download encrypted backup archive","description":"Streams the encrypted archive ciphertext. Requires restore permission.","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"$ref":"#/components/parameters/BackupId"}],"responses":{"200":{"description":"Encrypted archive bytes.","headers":{"Content-Disposition":{"schema":{"type":"string"},"description":"Attachment filename using the backup id."},"Content-Length":{"schema":{"type":"integer","minimum":0}}},"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/backups/{id}/events":{"get":{"operationId":"streamBackupStatusEvents","tags":["Backups"],"summary":"Stream backup status progress events","description":"Returns a Server-Sent Events stream for agents that need progress updates during long-running backup upload and finalize workflows. The stream emits backup.status events every few seconds until the backup reaches a terminal state or the stream times out.","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"$ref":"#/components/parameters/BackupId"}],"responses":{"200":{"description":"SSE stream of backup status progress events.","headers":{"Cache-Control":{"schema":{"type":"string"},"description":"Always no-store, no-transform."}},"content":{"text/event-stream":{"schema":{"type":"string","description":"SSE frames. Event names include backup.status, backup.stream.closed, and backup.stream.error. backup.status data matches BackupStatusEvent."},"examples":{"status":{"summary":"Status event","value":"event: backup.status\ndata: {\"backupId\":\"00000000-0000-4000-8000-000000000000\",\"status\":\"UPLOADED\",\"observedAt\":\"2026-04-30T12:00:00.000Z\"}\n\n"}}}}},"401":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Structured JSON error response.","headers":{"Retry-After":{"description":"Seconds until retry is recommended. Present on cadence-limited responses when available.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"Pass a ReClaw API key in the Authorization header: Authorization: Bearer rcl_..."},"apiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"Alternative API-key header accepted by the backup API."}},"parameters":{"BackupId":{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Backup id."}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","description":"Stable machine-readable error code."},"message":{"type":"string","description":"Human-readable error message. Mirrors error."},"resolution":{"type":"string","description":"Agent-readable hint for the next corrective action."},"details":{"type":"object","additionalProperties":true}},"required":["error","code","message","resolution"]},"BackupStatusEvent":{"type":"object","properties":{"backupId":{"type":"string","format":"uuid"},"status":{"$ref":"#/components/schemas/BackupStatus"},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"ciphertextSizeBytes":{"type":["integer","null"],"minimum":0},"plaintextSizeBytes":{"type":["integer","null"],"minimum":0},"clientVersion":{"type":["string","null"]},"openclawVersion":{"type":["string","null"]},"observedAt":{"type":"string","format":"date-time"}},"required":["backupId","status","createdAt","expiresAt","ciphertextSizeBytes","plaintextSizeBytes","clientVersion","openclawVersion","observedAt"]},"BackupStatus":{"type":"string","enum":["PENDING_UPLOAD","UPLOADED","READY","FAILED","DELETING","DELETED"]},"BackupKdf":{"type":"object","properties":{"salt":{"type":"string"},"opslimit":{"type":"integer","minimum":1},"memlimit":{"type":"integer","minimum":1}},"required":["salt","opslimit","memlimit"]},"BackupAccountEnvelope":{"type":"object","properties":{"cryptoVersion":{"type":"string","const":"v1"},"kdf":{"$ref":"#/components/schemas/BackupKdf"},"wrappedMasterKey":{"type":"string"},"wrappedMasterKeyNonce":{"type":"string"}},"required":["cryptoVersion","kdf","wrappedMasterKey","wrappedMasterKeyNonce"]},"BackupAccount":{"type":"object","properties":{"initialized":{"type":"boolean"},"backupInterval":{"type":"string","enum":["30m","4h","1d"]},"cryptoVersion":{"type":["string","null"]},"kdf":{"anyOf":[{"$ref":"#/components/schemas/BackupKdf"},{"type":"null"}]},"wrappedMasterKey":{"type":["string","null"]},"wrappedMasterKeyNonce":{"type":["string","null"]}},"required":["initialized","backupInterval","cryptoVersion","kdf","wrappedMasterKey","wrappedMasterKeyNonce"]},"BackupRecord":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"$ref":"#/components/schemas/BackupStatus"},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"ciphertextSizeBytes":{"type":["integer","null"],"minimum":0},"plaintextSizeBytes":{"type":["integer","null"],"minimum":0},"clientVersion":{"type":["string","null"]},"openclawVersion":{"type":["string","null"]}},"required":["id","status","createdAt","expiresAt","ciphertextSizeBytes","plaintextSizeBytes","clientVersion","openclawVersion"]},"BackupDetail":{"allOf":[{"$ref":"#/components/schemas/BackupRecord"},{"type":"object","properties":{"cryptoVersion":{"type":"string","const":"v1"},"wrappedDek":{"type":["string","null"]},"wrappedDekNonce":{"type":["string","null"]},"encryptedMetadata":{"type":["string","null"]},"encryptedMetadataNonce":{"type":["string","null"]}},"required":["cryptoVersion","wrappedDek","wrappedDekNonce","encryptedMetadata","encryptedMetadataNonce"]}]},"BackupFinalizeRequest":{"type":"object","properties":{"cryptoVersion":{"type":"string","const":"v1"},"wrappedDek":{"type":"string"},"wrappedDekNonce":{"type":"string"},"encryptedMetadata":{"type":"string"},"encryptedMetadataNonce":{"type":"string"},"ciphertextSizeBytes":{"type":"integer","minimum":0},"plaintextSizeBytes":{"type":"integer","minimum":0},"clientVersion":{"type":"string"},"openclawVersion":{"type":"string"}},"required":["cryptoVersion","wrappedDek","wrappedDekNonce","encryptedMetadata","encryptedMetadataNonce","ciphertextSizeBytes","plaintextSizeBytes"]},"CreateBackupResponse":{"type":"object","properties":{"backupId":{"type":"string","format":"uuid"},"blobPath":{"type":"string"},"status":{"$ref":"#/components/schemas/BackupStatus"},"expiresAt":{"type":"string","format":"date-time"},"upload":{"oneOf":[{"type":"object","properties":{"method":{"type":"string","const":"POST"},"protocol":{"type":"string","const":"direct"},"uploadUrl":{"type":"string"},"contentType":{"type":"string","const":"application/octet-stream"}},"required":["method","protocol","uploadUrl","contentType"]},{"type":"object","properties":{"method":{"type":"string","const":"POST"},"protocol":{"type":"string","const":"vercel-client"},"handleUploadUrl":{"type":"string"},"contentType":{"type":"string","const":"application/octet-stream"}},"required":["method","protocol","handleUploadUrl","contentType"]}]}},"required":["backupId","blobPath","status","expiresAt","upload"]}}}}