# Find the Account of an Address

The reverse lookup: the account — and your reference for its customer — of each of your tenant's wallets at an address.

## Overview

- `matches`: every active wallet of your tenant at the address, one per chain and network it is registered on, each with `accountId`, that account's `customerRefId`, and `isDefault` — `true` when the wallet is in no account you made, and so in its user's default account (whose `customerRefId` is `null` until you set one). `address` in a match is as the wallet stores it; the top-level `address` is as you asked.
- An EVM address (`0x` and 40 hex digits) is compared without regard to case; a Solana address (base58) exactly. Anything else: `400` `ACCOUNT_ADDRESS_INVALID` (`Not an EVM (0x and 40 hex digits) or Solana (base58) address.`). No wallet of your tenant there: `404` `ACCOUNT_ADDRESS_UNKNOWN` (`No wallet of the tenant at this address.`).
- `chain` (a slug, or a testnet's id) and `isTestnet` narrow it: an EVM chain matches the address's wallets on every EVM chain, any other chain its own.
- Same readers as [List Accounts](https://docs.aureahub.com/docs/accounts-list.md). The address goes in the query: keep it out of your own logs if they are shared.

## Endpoint

### `GET /v1/accounts/lookup`

Authentication: bearer token required.

The account of each of the tenant's wallets at an address.

**Query parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `address` | string | yes | An EVM or Solana address |
| `chain` | string | no | Only the wallets serving this chain — for an EVM chain, the address's wallets on every EVM chain |
| `isTestnet` | boolean | no | Only that network's wallets |

**Responses**

`200` Found

```json
{
  "address": "0x52908400098527886e0f7030069857d2e4169ee7",
  "matches": [
    {
      "accountId": "3b8f2c6e-1d4a-4e9b-8f7c-2a5d6e9b1c40",
      "customerRefId": "cust-00042",
      "isDefault": false,
      "walletId": "7c1e9b24-3f5a-4d8e-9b6c-1a2f3e4d5c6b",
      "chain": "evm",
      "isTestnet": false,
      "address": "0x52908400098527886E0F7030069857D2E4169EE7"
    }
  ]
}
```

`404` Unknown

```json
{
  "statusCode": 404,
  "error": "NotFoundError",
  "message": "No wallet of the tenant at this address.",
  "details": { "code": "ACCOUNT_ADDRESS_UNKNOWN" }
}
```

**Example request**

```bash
curl "https://api.aureahub.com/v1/accounts/lookup?address=0x52908400098527886e0f7030069857d2e4169ee7&chain=base" \
  -H "Authorization: Bearer $TENANT_ADMIN_TOKEN"
```

---

Web version: https://docs.aureahub.com/#account-lookup
