> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://www.openfort.io/api/mcp` to find what you need.
>
> **Have feedback?** Use `submit_feedback` on the same MCP server.

# Accounts

Blockchain accounts (wallets) attached to your users: create, recover, and manage EVM and Solana accounts.

## List user accounts

`GET /v2/accounts`

Returns a list of accounts for the given user.

An account is an onchain address (externally owned, smart, or delegated) that belongs to a user's wallet.
Backend wallets your server controls are accounts too and appear here with `custody: Developer`.

The accounts are returned sorted by creation date, with the most recently created accounts appearing first.

### Query parameters

- `limit` `integer <int32>`: Maximum number of records to return per page. Defaults to 10.
- `skip` `integer <int32>`: Number of records to skip before the first one returned. Defaults to 0. Combine with `limit` to page through results.
- `order` `string`: Sort direction by creation date: `asc` (oldest first) or `desc`. Defaults to `desc` (newest first).
- `chainId` `integer <int32>`: The chain ID. Must be a [supported chain](https://www.openfort.io/docs/configuration/chains).
- `user` `string`: ID of the user whose accounts to list (starts with `usr_`). A wallet ID (starts with `pla_`) is also accepted.
- `chainType` `string`: Filter by chain family: `EVM` or `SVM`.
- `accountType` `string`: Filter by kind of account: `Externally Owned Account`, `Smart Account` or `Delegated Account`.
- `custody` `string`: Filter by who holds the account's key: `User` (the user's own signer) or `Developer` (backend wallets).
- `address` `string`: Filter by onchain address.

### Responses

#### `200`: A page of accounts.

Body (`application/json`):

- `object` `string` _(required)_: The type of object. Always `list`.
- `url` `string` _(required)_: Path of the endpoint that produced this page.
- `data` `object[]` _(required)_: The items on this page.
  - `id` `string` _(required)_: The account ID (starts with `acc_`).
  - `wallet` `string` _(required)_: ID of the wallet this account belongs to (starts with `pla_`). A user's wallet groups all of their accounts.
  - `accountType` `string` _(required)_: The kind of account: `Externally Owned Account`, `Smart Account` or `Delegated Account`.
  - `address` `string` _(required)_: The onchain address of the account.
  - `ownerAddress` `string`: Address of the key that controls a smart account. Absent for externally owned and delegated accounts, whose address is the key itself.
  - `chainType` `string` _(required)_: The chain family: `EVM` or `SVM`.
  - `chainId` `integer <int32>`: Chain ID the account was created on, when known.
  - `createdAt` `integer <int32>` _(required)_: When the account was created, as Unix epoch seconds.
  - `updatedAt` `integer <int32>` _(required)_: When the account was last updated, as Unix epoch seconds.
  - `smartAccount` `object`: Smart account details. Only present for smart and delegated accounts.
    - `implementationType` `string` _(required)_: The smart account implementation, for example `UpgradeableV6`, `UpgradeableV5`, `Calibur`, `CaliburV9`, `ManagedV5` or `Simple`.
    - `factoryAddress` `string`: Address of the factory contract that deploys the account. Absent for delegated accounts, whose address already exists.
    - `implementationAddress` `string` _(required)_: Address of the implementation contract the account delegates to.
    - `salt` `string`: Salt used to derive the counterfactual account address. Absent for delegated accounts, which are not counterfactually deployed.
    - `deployedTx` `string`: Hash of the transaction that deployed the account onchain. Absent until the account is deployed.
    - `deployedAt` `integer <int32>`: When the account was deployed onchain, as Unix epoch seconds. Absent until the account is deployed.
    - `active` `boolean` _(required)_: Whether this smart account configuration is the one currently in use for the account.
    - `ownerAddress` `string`: Address of the key that controls the smart account, when available.
    - `chainId` `integer <int32>`: Chain ID the smart account lives on, when available.
  - `recoveryMethod` `string`: How the user recovers their share of the signer, for example `password`, `passkey` or `automatic`. Only present for user-custody accounts.
  - `recoveryMethodDetails` `object`: Details of the recovery method. Only present when it is a passkey.
    - `passkeyId` `string`: Identifier of the passkey that protects the recovery share.
    - `passkeyEnv` `object`: Environment the passkey was registered in, as reported by the client.
      - `name` `string`: Name of the client (browser or app) that registered the passkey.
      - `os` `string`: Operating system of the device that registered the passkey.
      - `osVersion` `string`: Version of that operating system.
      - `device` `string`: Device that registered the passkey.
  - `custody` `string` _(required)_: Indicates key custody: "Developer" for TEE managed keys, "User" for user-managed keys.
- `start` `integer <int32>` _(required)_: Zero-based offset of the first item on this page (the `skip` you passed, default 0).
- `end` `integer <int32>` _(required)_: Offset just past the last item on this page (`start` plus the page size).
- `total` `integer <int32>` _(required)_: Total number of items matching the query across all pages.

#### `401`: Missing or invalid credentials.

### Example request

```bash
curl 'https://api.openfort.io/v2/accounts?limit=10&skip=0&order=desc&chainId=80002&user=usr_6f6c9067-89fa-4fc8-ac72-c242a268c584&chainType=EVM&accountType=Smart Account&custody=User&address=0xf7b4c54cca21cccf42796502bf94e2838fbd44c4'
```

```ts
fetch('https://api.openfort.io/v2/accounts?limit=10&skip=0&order=desc&chainId=80002&user=usr_6f6c9067-89fa-4fc8-ac72-c242a268c584&chainType=EVM&accountType=Smart Account&custody=User&address=0xf7b4c54cca21cccf42796502bf94e2838fbd44c4')
```

## Create user account

`POST /v2/accounts`

Creates a new blockchain account for a user.

The user's own signer controls the account (`custody: User`). For an account your server controls, create a backend wallet instead.

Account creation does not consume any gas. The account can be used to interact with the blockchain.

### Request body (required) (`application/json`)

- `accountType` `string` _(required)_: The type of smart account that will be created. "Externally Owned Account", "Smart Account" or "Delegated Account".
- `chainType` `string` _(required)_: The chain type. "EVM" or "SVM".
- `address` `string`: Address of an existing externally owned account. Required for `Externally Owned Account`. For `Delegated Account`, provide either `address` or `account`, not both. Not accepted for `Smart Account`.
- `implementationType` `string`: The type of smart account that will be created (e.g. UpgradeableV6, UpgradeableV5, Calibur). Defaults to UpgradeableV6 in mainnets.
- `chainId` `integer <int32>`: The chain ID. Must be a [supported chain](https://www.openfort.io/docs/configuration/chains).
- `user` `string` _(required)_: ID of the user this account belongs to (starts with `usr_`). Also might take wallet ID (starts with `pla_`)
- `account` `string`: ID of the account (starts with `acc_`) to be linked with. Required for accountType "Smart Account".

### Responses

#### `200`: The created account.

Body (`application/json`):

- `id` `string` _(required)_: The account ID (starts with `acc_`).
- `wallet` `string` _(required)_: ID of the wallet this account belongs to (starts with `pla_`). A user's wallet groups all of their accounts.
- `accountType` `string` _(required)_: The kind of account: `Externally Owned Account`, `Smart Account` or `Delegated Account`.
- `address` `string` _(required)_: The onchain address of the account.
- `ownerAddress` `string`: Address of the key that controls a smart account. Absent for externally owned and delegated accounts, whose address is the key itself.
- `chainType` `string` _(required)_: The chain family: `EVM` or `SVM`.
- `chainId` `integer <int32>`: Chain ID the account was created on, when known.
- `createdAt` `integer <int32>` _(required)_: When the account was created, as Unix epoch seconds.
- `updatedAt` `integer <int32>` _(required)_: When the account was last updated, as Unix epoch seconds.
- `smartAccount` `object`: Smart account details. Only present for smart and delegated accounts.
  - `implementationType` `string` _(required)_: The smart account implementation, for example `UpgradeableV6`, `UpgradeableV5`, `Calibur`, `CaliburV9`, `ManagedV5` or `Simple`.
  - `factoryAddress` `string`: Address of the factory contract that deploys the account. Absent for delegated accounts, whose address already exists.
  - `implementationAddress` `string` _(required)_: Address of the implementation contract the account delegates to.
  - `salt` `string`: Salt used to derive the counterfactual account address. Absent for delegated accounts, which are not counterfactually deployed.
  - `deployedTx` `string`: Hash of the transaction that deployed the account onchain. Absent until the account is deployed.
  - `deployedAt` `integer <int32>`: When the account was deployed onchain, as Unix epoch seconds. Absent until the account is deployed.
  - `active` `boolean` _(required)_: Whether this smart account configuration is the one currently in use for the account.
  - `ownerAddress` `string`: Address of the key that controls the smart account, when available.
  - `chainId` `integer <int32>`: Chain ID the smart account lives on, when available.
- `recoveryMethod` `string`: How the user recovers their share of the signer, for example `password`, `passkey` or `automatic`. Only present for user-custody accounts.
- `recoveryMethodDetails` `object`: Details of the recovery method. Only present when it is a passkey.
  - `passkeyId` `string`: Identifier of the passkey that protects the recovery share.
  - `passkeyEnv` `object`: Environment the passkey was registered in, as reported by the client.
    - `name` `string`: Name of the client (browser or app) that registered the passkey.
    - `os` `string`: Operating system of the device that registered the passkey.
    - `osVersion` `string`: Version of that operating system.
    - `device` `string`: Device that registered the passkey.
- `custody` `string` _(required)_: Indicates key custody: "Developer" for TEE managed keys, "User" for user-managed keys.

#### `401`: Missing or invalid credentials.

### Example request

```bash
curl https://api.openfort.io/v2/accounts \
  --request POST \
  --header 'Content-Type: application/json' \
  --data '{
  "accountType": "Externally Owned Account",
  "chainType": "EVM",
  "address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
  "implementationType": "UpgradeableV6",
  "chainId": 80002,
  "user": "usr_e0b84653-1741-4a3d-9e91-2b0fd2942f60",
  "account": "acc_e0b84653-1741-4a3d-9e91-2b0fd2942f60"
}'
```

```ts
fetch('https://api.openfort.io/v2/accounts', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    accountType: 'Externally Owned Account',
    chainType: 'EVM',
    address: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
    implementationType: 'UpgradeableV6',
    chainId: 80002,
    user: 'usr_e0b84653-1741-4a3d-9e91-2b0fd2942f60',
    account: 'acc_e0b84653-1741-4a3d-9e91-2b0fd2942f60'
  })
})
```

## Get signer ID by address

`GET /v2/accounts/signer`

Retrieves the signer ID associated with a given blockchain address.

### Query parameters

- `address` `string` _(required)_: The blockchain address to look up the signer ID for.

### Responses

#### `200`: The signer ID for the address.

Body (`application/json`):

- `id` `string` _(required)_: The signer ID (starts with `sig_`).

#### `401`: Missing or invalid credentials.

### Example request

```bash
curl 'https://api.openfort.io/v2/accounts/signer?address=0x742e6e61d760164d56f44801054bcf40fa821d97'
```

```ts
fetch('https://api.openfort.io/v2/accounts/signer?address=0x742e6e61d760164d56f44801054bcf40fa821d97')
```

## Get user account

`GET /v2/accounts/{id}`

Retrieves the details of an existing account.

Supply the unique account ID and Openfort will return the corresponding account information.

### Path parameters

- `id` `string` _(required)_: The account ID (starts with acc_).

### Responses

#### `200`: The account.

Body (`application/json`):

- `id` `string` _(required)_: The account ID (starts with `acc_`).
- `wallet` `string` _(required)_: ID of the wallet this account belongs to (starts with `pla_`). A user's wallet groups all of their accounts.
- `accountType` `string` _(required)_: The kind of account: `Externally Owned Account`, `Smart Account` or `Delegated Account`.
- `address` `string` _(required)_: The onchain address of the account.
- `ownerAddress` `string`: Address of the key that controls a smart account. Absent for externally owned and delegated accounts, whose address is the key itself.
- `chainType` `string` _(required)_: The chain family: `EVM` or `SVM`.
- `chainId` `integer <int32>`: Chain ID the account was created on, when known.
- `createdAt` `integer <int32>` _(required)_: When the account was created, as Unix epoch seconds.
- `updatedAt` `integer <int32>` _(required)_: When the account was last updated, as Unix epoch seconds.
- `smartAccount` `object`: Smart account details. Only present for smart and delegated accounts.
  - `implementationType` `string` _(required)_: The smart account implementation, for example `UpgradeableV6`, `UpgradeableV5`, `Calibur`, `CaliburV9`, `ManagedV5` or `Simple`.
  - `factoryAddress` `string`: Address of the factory contract that deploys the account. Absent for delegated accounts, whose address already exists.
  - `implementationAddress` `string` _(required)_: Address of the implementation contract the account delegates to.
  - `salt` `string`: Salt used to derive the counterfactual account address. Absent for delegated accounts, which are not counterfactually deployed.
  - `deployedTx` `string`: Hash of the transaction that deployed the account onchain. Absent until the account is deployed.
  - `deployedAt` `integer <int32>`: When the account was deployed onchain, as Unix epoch seconds. Absent until the account is deployed.
  - `active` `boolean` _(required)_: Whether this smart account configuration is the one currently in use for the account.
  - `ownerAddress` `string`: Address of the key that controls the smart account, when available.
  - `chainId` `integer <int32>`: Chain ID the smart account lives on, when available.
- `recoveryMethod` `string`: How the user recovers their share of the signer, for example `password`, `passkey` or `automatic`. Only present for user-custody accounts.
- `recoveryMethodDetails` `object`: Details of the recovery method. Only present when it is a passkey.
  - `passkeyId` `string`: Identifier of the passkey that protects the recovery share.
  - `passkeyEnv` `object`: Environment the passkey was registered in, as reported by the client.
    - `name` `string`: Name of the client (browser or app) that registered the passkey.
    - `os` `string`: Operating system of the device that registered the passkey.
    - `osVersion` `string`: Version of that operating system.
    - `device` `string`: Device that registered the passkey.
- `custody` `string` _(required)_: Indicates key custody: "Developer" for TEE managed keys, "User" for user-managed keys.

#### `401`: Missing or invalid credentials.

### Example request

```bash
curl https://api.openfort.io/v2/accounts/acc_e1b24353-1741-4a3d-9e91-2b0fd2942f60
```

```ts
fetch('https://api.openfort.io/v2/accounts/acc_e1b24353-1741-4a3d-9e91-2b0fd2942f60')
```

## Delete user account

`DELETE /v2/accounts/{id}`

Removes an account from a project.

### Path parameters

- `id` `string` _(required)_: The account ID (starts with acc_).

### Responses

#### `200`: The deleted account.

Body (`application/json`):

- `id` `string` _(required)_: Identifier of the deleted object.
- `object` `string` _(required)_: The type of the deleted object.
- `deleted` `boolean` _(required)_: Always `true`: the object was deleted.

#### `401`: Missing or invalid credentials.

#### `404`: Account not found.

### Example request

```bash
curl https://api.openfort.io/v2/accounts/acc_e1b24353-1741-4a3d-9e91-2b0fd2942f60 \
  --request DELETE
```

```ts
fetch('https://api.openfort.io/v2/accounts/acc_e1b24353-1741-4a3d-9e91-2b0fd2942f60', {
  method: 'DELETE'
})
```

## Switch user account chain

`POST /v2/accounts/switch-chain`

Switches the blockchain network for an existing account.

This allows moving an account between different blockchain networks while maintaining the same account identity.

### Request body (required) (`application/json`)

- `account` `string` _(required)_: The account ID (starts with acc_)
- `chainId` `integer <int32>` _(required)_: The target chain ID. Must be a [supported chain](https://www.openfort.io/docs/configuration/chains).

### Responses

#### `200`: The account on the new chain.

Body (`application/json`):

- `id` `string` _(required)_: The account ID (starts with `acc_`).
- `wallet` `string` _(required)_: ID of the wallet this account belongs to (starts with `pla_`). A user's wallet groups all of their accounts.
- `accountType` `string` _(required)_: The kind of account: `Externally Owned Account`, `Smart Account` or `Delegated Account`.
- `address` `string` _(required)_: The onchain address of the account.
- `ownerAddress` `string`: Address of the key that controls a smart account. Absent for externally owned and delegated accounts, whose address is the key itself.
- `chainType` `string` _(required)_: The chain family: `EVM` or `SVM`.
- `chainId` `integer <int32>`: Chain ID the account was created on, when known.
- `createdAt` `integer <int32>` _(required)_: When the account was created, as Unix epoch seconds.
- `updatedAt` `integer <int32>` _(required)_: When the account was last updated, as Unix epoch seconds.
- `smartAccount` `object`: Smart account details. Only present for smart and delegated accounts.
  - `implementationType` `string` _(required)_: The smart account implementation, for example `UpgradeableV6`, `UpgradeableV5`, `Calibur`, `CaliburV9`, `ManagedV5` or `Simple`.
  - `factoryAddress` `string`: Address of the factory contract that deploys the account. Absent for delegated accounts, whose address already exists.
  - `implementationAddress` `string` _(required)_: Address of the implementation contract the account delegates to.
  - `salt` `string`: Salt used to derive the counterfactual account address. Absent for delegated accounts, which are not counterfactually deployed.
  - `deployedTx` `string`: Hash of the transaction that deployed the account onchain. Absent until the account is deployed.
  - `deployedAt` `integer <int32>`: When the account was deployed onchain, as Unix epoch seconds. Absent until the account is deployed.
  - `active` `boolean` _(required)_: Whether this smart account configuration is the one currently in use for the account.
  - `ownerAddress` `string`: Address of the key that controls the smart account, when available.
  - `chainId` `integer <int32>`: Chain ID the smart account lives on, when available.
- `recoveryMethod` `string`: How the user recovers their share of the signer, for example `password`, `passkey` or `automatic`. Only present for user-custody accounts.
- `recoveryMethodDetails` `object`: Details of the recovery method. Only present when it is a passkey.
  - `passkeyId` `string`: Identifier of the passkey that protects the recovery share.
  - `passkeyEnv` `object`: Environment the passkey was registered in, as reported by the client.
    - `name` `string`: Name of the client (browser or app) that registered the passkey.
    - `os` `string`: Operating system of the device that registered the passkey.
    - `osVersion` `string`: Version of that operating system.
    - `device` `string`: Device that registered the passkey.
- `custody` `string` _(required)_: Indicates key custody: "Developer" for TEE managed keys, "User" for user-managed keys.

#### `401`: Missing or invalid credentials.

### Example request

```bash
curl https://api.openfort.io/v2/accounts/switch-chain \
  --request POST \
  --header 'Content-Type: application/json' \
  --data '{
  "account": "string",
  "chainId": 80002
}'
```

```ts
fetch('https://api.openfort.io/v2/accounts/switch-chain', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    account: 'string',
    chainId: 80002
  })
})
```

## Export user account share

`POST /v2/accounts/{accountUuid}/export-share`

Exports the primary share for an account, including all data needed to import it on another instance.

### Path parameters

- `accountUuid` `string` _(required)_

### Responses

#### `200`: The account with its exported share.

Body (`application/json`):

- `id` `string` _(required)_: The account ID (starts with `acc_`).
- `wallet` `string` _(required)_: ID of the wallet this account belongs to (starts with `pla_`). A user's wallet groups all of their accounts.
- `accountType` `string` _(required)_: The kind of account: `Externally Owned Account`, `Smart Account` or `Delegated Account`.
- `address` `string` _(required)_: The onchain address of the account.
- `ownerAddress` `string`: Address of the key that controls a smart account. Absent for externally owned and delegated accounts, whose address is the key itself.
- `chainType` `string` _(required)_: The chain family: `EVM` or `SVM`.
- `chainId` `integer <int32>`: Chain ID the account was created on, when known.
- `createdAt` `integer <int32>` _(required)_: When the account was created, as Unix epoch seconds.
- `updatedAt` `integer <int32>` _(required)_: When the account was last updated, as Unix epoch seconds.
- `smartAccount` `object`: Smart account details. Only present for smart and delegated accounts.
  - `implementationType` `string` _(required)_: The smart account implementation, for example `UpgradeableV6`, `UpgradeableV5`, `Calibur`, `CaliburV9`, `ManagedV5` or `Simple`.
  - `factoryAddress` `string`: Address of the factory contract that deploys the account. Absent for delegated accounts, whose address already exists.
  - `implementationAddress` `string` _(required)_: Address of the implementation contract the account delegates to.
  - `salt` `string`: Salt used to derive the counterfactual account address. Absent for delegated accounts, which are not counterfactually deployed.
  - `deployedTx` `string`: Hash of the transaction that deployed the account onchain. Absent until the account is deployed.
  - `deployedAt` `integer <int32>`: When the account was deployed onchain, as Unix epoch seconds. Absent until the account is deployed.
  - `active` `boolean` _(required)_: Whether this smart account configuration is the one currently in use for the account.
  - `ownerAddress` `string`: Address of the key that controls the smart account, when available.
  - `chainId` `integer <int32>`: Chain ID the smart account lives on, when available.
- `recoveryMethod` `string`: How the user recovers their share of the signer, for example `password`, `passkey` or `automatic`. Only present for user-custody accounts.
- `recoveryMethodDetails` `object`: Details of the recovery method. Only present when it is a passkey.
  - `passkeyId` `string`: Identifier of the passkey that protects the recovery share.
  - `passkeyEnv` `object`: Environment the passkey was registered in, as reported by the client.
    - `name` `string`: Name of the client (browser or app) that registered the passkey.
    - `os` `string`: Operating system of the device that registered the passkey.
    - `osVersion` `string`: Version of that operating system.
    - `device` `string`: Device that registered the passkey.
- `custody` `string` _(required)_: Indicates key custody: "Developer" for TEE managed keys, "User" for user-managed keys.
- `share` `string` _(required)_: The exported key share of the signer that controls this account. Handle it as a secret.
- `signerId` `string` _(required)_: The signer ID backing this account (starts with `sig_`).
- `userId` `string`: ID of the user who owns the account (starts with `usr_`). Absent when the wallet is not linked to an auth user.

#### `401`: Missing or invalid credentials.

#### `404`: Account not found.

### Example request

```bash
curl https://api.openfort.io/v2/accounts/acc_e1b24353-1741-4a3d-9e91-2b0fd2942f60/export-share \
  --request POST
```

```ts
fetch('https://api.openfort.io/v2/accounts/acc_e1b24353-1741-4a3d-9e91-2b0fd2942f60/export-share', {
  method: 'POST'
})
```
