---
title: "POST /recover-account"
method: POST
path: "/recover-account"
tags: ["Gateway"]
---

# POST /recover-account

`POST /recover-account`

## Request

- Base URL: `https://gateway.id-infra.worldcoin.dev` (the document declares no server; this is the origin it was published from)
- URL: `https://gateway.id-infra.worldcoin.dev/recover-account`
- Auth: none declared
- TypeScript: <https://skmtc.dev/worldcoin/apis/world-id-gateway/docs/recover-account/post.ts> (a function with typed inputs; its response is checked against the schema)

## Request body

- RecoverAccountRequest: The request to recover an account. Numeric string fields in this request accept decimal or `0x`/`0X`-prefixed hex.
  - `leaf_index` string, hex, required: The account index.
  - `new_authenticator_address` string, hex, required: The new authenticator address.
  - `new_authenticator_pubkey` string, hex, nullable: The new authenticator pubkey.
  - `new_offchain_signer_commitment` string, hex, required: The new offchain signer commitment.
  - `nonce` string, hex, required: The nonce.
  - `old_offchain_signer_commitment` string, hex, required: The old offchain signer commitment.
  - `signature` string, hex, required: The signature.

## Response `202`

TODO

- GatewayStatusResponse: Response returned by the registry gateway for state-changing requests.
  - `kind` 'create_account' | 'update_authenticator' | 'insert_authenticator' | 'remove_authenticator' | 'update_recovery_agent' | 'cancel_recovery_agent_update' | 'execute_recovery_agent_update' | 'recover_account', required: Kind of request tracked by the registry gateway.
  - `request_id` string, required: Strongly-typed identifier for a gateway request. Returned by gateway mutation endpoints (create-account, insert/update/remove authenticator, etc.) and used to poll the status of the request.
  - `status` union, required: Tracking state for a registry gateway request.
    - object: Request queued but not yet batched.
      - `state` 'queued', required
    - object: Request currently being batched.
      - `state` 'batching', required
    - object: Request submitted on-chain, hash available.
      - `state` 'submitted', required
      - `tx_hash` string, required: Transaction hash emitted when the request was submitted.
    - object: Request finalized on-chain.
      - `state` 'finalized', required
      - `tx_hash` string, required: Transaction hash emitted when the request was finalized.
    - object: Request failed during processing.
      - `error` string, required: Error message returned by the gateway.
      - `error_code` 'internal_server_error' | 'not_found' | 'bad_request' | 'batcher_unavailable' | 'authenticator_already_exists' | 'authenticator_does_not_exist' | 'mismatched_signature_nonce' | 'pubkey_id_in_use' | 'pubkey_id_out_of_bounds' | 'authenticator_does_not_belong_to_account' | 'transaction_reverted' | 'confirmation_error' | 'duplicate_request_in_flight' | 'rate_limit_exceeded' | 'request_timeout' | 'method_not_available': Gateway error codes.
      - `state` 'failed', required

## Other responses

- `500`: TODO

---

[API](https://skmtc.dev/worldcoin/apis/world-id-gateway.md) - [All operations](https://skmtc.dev/worldcoin/apis/world-id-gateway/llms.txt) - [OpenAPI document](https://skmtc.dev/worldcoin/apis/world-id-gateway/revisions/64f5c213771f?raw)
