# Recover a deposit

Shield tokens returned to the deposit address’s vault.

```text title="Endpoint"
POST /relayer/v1/deposits/rescue
```

## Examples

**cURL**

Save the request prepared by your wallet as `rescue-deposit.json`.

```bash title="cURL"
curl -sS "https://api-testnet.veylor.cash/relayer/v1/deposits/rescue" \
  -H 'Content-Type: application/json' \
  --data-binary @rescue-deposit.json
```

**200 JSON**

```json title="HTTP 200"
{
  "transactions": [
    "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  ]
}
```

## Request body

`object` · [RescueDeposit](https://docs.veylor.cash/api-types/#rescuedeposit)

| Field | JSON type | Presence | Meaning |
| --- | --- | --- | --- |
| `chainId` | `integer` · [Uint64](https://docs.veylor.cash/api-types/#uint64) | Required | EIP-155 chain ID of the settlement network. |
| `contract` | `string` · [EthereumAddress](https://docs.veylor.cash/api-types/#ethereumaddress) | Required | Pinned Deposits contract. |
| `from` | `string` · [EthereumAddress](https://docs.veylor.cash/api-types/#ethereumaddress) | Required | Public deposit address that controls the rescue. |
| `note` | `object` · [RelayerNote](https://docs.veylor.cash/api-types/#relayernote) | Required | RAILGUN shield destination and ciphertext. |
| `fee` | `string` · [DecimalUint128](https://docs.veylor.cash/api-types/#decimaluint128) | Required | Authorized relayer fee in token base units. |
| `nonce` | `integer` · [Uint64](https://docs.veylor.cash/api-types/#uint64) | Required | Rescue nonce for the deposit address. |
| `deadline` | `integer` · [UnixSeconds](https://docs.veylor.cash/api-types/#unixseconds) | Required | Expiry of the signed authorization, in Unix seconds. |
| `signature` | `string` · [EthereumSignature](https://docs.veylor.cash/api-types/#ethereumsignature) | Required | 65-byte Ethereum authorization signature in r, s, v order. |

**Fields of note**

| Field | JSON type | Presence | Meaning |
| --- | --- | --- | --- |
| `npk` | `string` · [Hex32](https://docs.veylor.cash/api-types/#hex32) | Required | 32-byte note public key. |
| `encryptedBundle` | array of `string` · [Hex32](https://docs.veylor.cash/api-types/#hex32) (exactly 3) | Required | Three ordered 32-byte ciphertext words. |
| `shieldKey` | `string` · [Hex32](https://docs.veylor.cash/api-types/#hex32) | Required | 32-byte shield encryption public key. |

## Responses

### HTTP 200

`object` · [RelayerSent](https://docs.veylor.cash/api-types/#relayersent)

| Field | JSON type | Presence | Meaning |
| --- | --- | --- | --- |
| `transactions` | array of `string` · [Hex32](https://docs.veylor.cash/api-types/#hex32) | Required | Ethereum transaction hashes known to the relayer. Some idempotent operations can return an empty list. |

### Errors

| HTTP | Body | Meaning |
| --- | --- | --- |
| 400 | `object` · [ErrorResponse](https://docs.veylor.cash/api-types/#errorresponse) | Malformed input or a request rejected for this swap. |
| 409 | `object` · [RelayerConflict](https://docs.veylor.cash/api-types/#relayerconflict) | A conflicting or already spent authorization may have transaction hashes to reconcile. |
| 413 | `object` · [ErrorResponse](https://docs.veylor.cash/api-types/#errorresponse) | The request exceeds the service’s body limit. |
| 415 | `object` · [ErrorResponse](https://docs.veylor.cash/api-types/#errorresponse) | Use Content-Type: application/json. |
| 422 | `object` · [ErrorResponse](https://docs.veylor.cash/api-types/#errorresponse) | The JSON fields or encoded values do not match the request type. |
| 503 | `object` · [ErrorResponse](https://docs.veylor.cash/api-types/#errorresponse) | Temporarily unavailable, throttled, or waiting for a chain event. Respect Retry-After when present. `Retry-After` — Seconds to wait before retrying, when supplied. |
| Other | `object` · [ErrorResponse](https://docs.veylor.cash/api-types/#errorresponse) | Other service error. Read code and error. |

**ErrorResponse fields**

| Field | JSON type | Presence | Meaning |
| --- | --- | --- | --- |
| `code` | `string` · [ErrorCode](https://docs.veylor.cash/api-types/#errorcode) | Required | Machine-readable service error code. |
| `error` | `string` | Required | Human-readable detail. |

**RelayerConflict fields**

| Field | JSON type | Presence | Meaning |
| --- | --- | --- | --- |
| `code` | `string` · [ErrorCode](https://docs.veylor.cash/api-types/#errorcode) | Required | Machine-readable cause, such as alreadySpent or conflict. |
| `error` | `string` | Required | Human-readable detail. |
| `transactions` | array of `string` · [Hex32](https://docs.veylor.cash/api-types/#hex32) | Required | Known Ethereum transaction hashes. Can be empty. |
