> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rebelfi.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Verify Wallet

> POST /v1/wallets/:walletId/verify — Prove control of a registered wallet with a signed challenge

> [!NOTE]
>
> **Endpoint:** `POST https://api.rebelfi.io/v1/wallets/:walletId/verify`

Prove that your organization controls a registered wallet's address. A `WATCH_ONLY` or `LEGACY` wallet becomes
`CONTROLLED`. Use it for wallets registered without a `proof`, and for any wallet whose operations fail with
`WALLET_NOT_VERIFIED`.

First [request a challenge](https://docs.rebelfi.io/docs/api-reference/wallets/challenge.md) for the wallet's address and sign its `message` with the
wallet.

### Path Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `walletId` | `number` | Yes | Wallet ID |

### Request Body

| Field | Type | Required | Description |
| - | - | - | - |
| `challengeId` | `number` | Yes | From [Request Ownership Challenge](https://docs.rebelfi.io/docs/api-reference/wallets/challenge.md) |
| `signature` | `string` | Yes | The wallet's signature of the challenge `message`. Solana: base58. EVM: 0x hex |

### Example Request

```bash cURL theme={null}
curl -X POST "https://api.rebelfi.io/v1/wallets/42/verify" \
  -H "x-api-key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "challengeId": 917,
    "signature": "3vZk...9xQ"
  }'
```

```typescript SDK theme={null}
const { challengeId, message } = await client.wallets.challenge({
  walletAddress: 'So11...abc',
  blockchain: 'solana'
});
const signature = await signWithWallet(message); // see "Signing the Message"
const { outcome, wallet } = await client.wallets.verify(42, { challengeId, signature });
```

### Example Response

```json theme={null}
{
  "outcome": "CONTROLLED",
  "wallet": {
    "walletId": 42,
    "walletAddress": "So11...abc",
    "blockchain": "solana",
    "createdAt": "2024-01-15T10:30:00.000Z",
    "control": {
      "status": "CONTROLLED",
      "method": "SIGNED_CHALLENGE",
      "provenAt": "2024-01-16T08:00:00.000Z"
    }
  }
}
```

### Response Fields

| Field | Type | Description |
| - | - | - |
| `outcome` | `string` | `CONTROLLED`: your organization now controls the address. `UNCHANGED`: it already did. `DISPUTED`: another organization holds the address without proof; the wallet stays `WATCH_ONLY` while RebelFi reviews the dispute |
| `wallet` | `object` | The wallet, as in [Get Wallet](https://docs.rebelfi.io/docs/api-reference/wallets/get.md), including `control` |

> [!NOTE]
>
> A legacy wallet keeps its history when verified. A watch-only wallet's balance is booked from the moment it is
> verified: RebelFi reads the address's current balance and starts your organization's books there.

### Errors

| Code | HTTP | Description |
| - | - | - |
| `WALLET_NOT_FOUND` | 404 | No such wallet for this API key's organization and wallet profile |
| `CHALLENGE_EXPIRED` | 410 | The challenge expired; request a new one |
| `CHALLENGE_USED` | 409 | The challenge was already used |
| `CHALLENGE_MISMATCH` | 400 | Unknown challenge, or issued for another address or chain |
| `INVALID_SIGNATURE` | 400 | Not the address's signature of the challenge message; the challenge is used up |
| `ADDRESS_NOT_CLAIMABLE` | 409 | Another organization has proven control of the address. Contact support if you believe you control it |

If the signature or the balances can't be checked with the chain right now, the response is `503`. Nothing changed
and the challenge stays usable: retry with the same request.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.