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

# Account By Address

> Resolve a wallet address to its accountId. Works for both master addresses and agent wallet addresses, reporting which one you supplied.

The `accountByAddress` query resolves a wallet address to its `accountId`, using the on-chain account registry as the authority. It accepts both kinds of address:

* A **master address** resolves to its own `accountId`.
* An **agent (API wallet) address** resolves to the `accountId` of the master it is bound to, with `isAgent` set to `true`.

Use it to discover your `accountId` after registration, or to confirm which master an agent wallet signs for before trusting it.

## Request

```json theme={null}
{"type": "accountByAddress", "address": "0xabc...123"}
```

<ParamField body="type" type="string" required>
  Must be `"accountByAddress"`.
</ParamField>

<ParamField body="address" type="string" required>
  The address to resolve — `"0x"` followed by 40 hex characters. Case-insensitive.
</ParamField>

## Response

```json theme={null}
{
  "type": "accountByAddress",
  "address": "0xabc...123",
  "accountId": "1",
  "isAgent": false,
  "masterId": "0"
}
```

<ResponseField name="address" type="string">
  The queried address, echoed back in lowercase.
</ResponseField>

<ResponseField name="accountId" type="string">
  The resolved account ID. **`"0"` means the address is not registered** or has no valid binding — treat it as "not found", not as account zero.
</ResponseField>

<ResponseField name="isAgent" type="boolean">
  `true` when the queried address is an agent wallet, in which case `accountId` is the master it is bound to. `false` when the address is a master account itself.
</ResponseField>

<ResponseField name="masterId" type="string">
  When `isAgent` is `true`, the master account's ID — identical to `accountId`. Otherwise `"0"`.
</ResponseField>

## Interpreting the result

| Address supplied | `accountId`           | `isAgent` | `masterId`          |
| ---------------- | --------------------- | --------- | ------------------- |
| Master account   | Its own ID            | `false`   | `"0"`               |
| Agent wallet     | The bound master's ID | `true`    | Same as `accountId` |
| Unregistered     | `"0"`                 | `false`   | `"0"`               |

<Note>
  Because an agent resolves to its master, actions signed by an approved agent execute under the master account. See [Agent Wallets](/agents/api-wallets) for the delegation model.
</Note>
