> **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.

This object represents a user's account, which is a blockchain smart account that can be used to interact with the blockchain.

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

### Query parameters

- `limit` `integer <int32>`: Specifies the maximum number of records to return.
- `skip` `integer <int32>`: Specifies the offset for the first records to return.
- `order` `string`: Specifies the order in which to sort the results.
- `chainId` `integer <int32>`: The chain ID. Must be a [supported chain](https://www.openfort.io/docs/configuration/chains).
- `user` `string`: Specifies the unique user ID (starts with pla_)
- `chainType` `string`: The chain type. Must be either "EVM" or "SVM".
- `accountType` `string`: Specifies the type of account. Must be either "Smart Account" or "Externally Owned Account".
- `custody` `string`: Specifies the key custody of the account. Must be either "Developer" or "User".
- `address` `string`: Specifies the account address

### Responses

#### `200`: Successful response.

Body (`application/json`):

- `object` `string` _(required)_
- `url` `string` _(required)_
- `data` `object[]` _(required)_
  - `id` `string` _(required)_
  - `wallet` `string` _(required)_
  - `accountType` `string` _(required)_
  - `address` `string` _(required)_
  - `ownerAddress` `string`
  - `chainType` `string` _(required)_
  - `chainId` `number <double>`
  - `createdAt` `number <double>` _(required)_
  - `updatedAt` `number <double>` _(required)_
  - `smartAccount` `object`
    - `implementationType` `string` _(required)_
    - `factoryAddress` `string`
    - `implementationAddress` `string` _(required)_
    - `salt` `string`
    - `deployedTx` `string`
    - `deployedAt` `number <double>`
    - `active` `boolean` _(required)_
    - `ownerAddress` `string`
    - `chainId` `number <double>`
  - `recoveryMethod` `string`
  - `recoveryMethodDetails` `object`
    - `passkeyId` `string`
    - `passkeyEnv` `object`
      - `name` `string`
      - `os` `string`
      - `osVersion` `string`
      - `device` `string`
  - `custody` `string` _(required)_: Indicates key custody: "Developer" for TEE managed keys, "User" for user-managed keys.
- `start` `integer <int32>` _(required)_
- `end` `integer <int32>` _(required)_
- `total` `integer <int32>` _(required)_

#### `401`: Error response.

### Example request

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

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

## Create new account

`POST /v2/accounts`

Creates a new blockchain account for a user.

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`
- `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`: Successful response.

Body (`application/json`):

- `id` `string` _(required)_
- `wallet` `string` _(required)_
- `accountType` `string` _(required)_
- `address` `string` _(required)_
- `ownerAddress` `string`
- `chainType` `string` _(required)_
- `chainId` `number <double>`
- `createdAt` `number <double>` _(required)_
- `updatedAt` `number <double>` _(required)_
- `smartAccount` `object`
  - `implementationType` `string` _(required)_
  - `factoryAddress` `string`
  - `implementationAddress` `string` _(required)_
  - `salt` `string`
  - `deployedTx` `string`
  - `deployedAt` `number <double>`
  - `active` `boolean` _(required)_
  - `ownerAddress` `string`
  - `chainId` `number <double>`
- `recoveryMethod` `string`
- `recoveryMethodDetails` `object`
  - `passkeyId` `string`
  - `passkeyEnv` `object`
    - `name` `string`
    - `os` `string`
    - `osVersion` `string`
    - `device` `string`
- `custody` `string` _(required)_: Indicates key custody: "Developer" for TEE managed keys, "User" for user-managed keys.

#### `401`: Error response.

### 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": "string",
  "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: 'string',
    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)_

### Responses

#### `200`: Successful response.

Body (`application/json`):

- `id` `string` _(required)_

#### `401`: Error response.

### 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 existing 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)_

### Responses

#### `200`: Successful response.

Body (`application/json`):

- `id` `string` _(required)_
- `wallet` `string` _(required)_
- `accountType` `string` _(required)_
- `address` `string` _(required)_
- `ownerAddress` `string`
- `chainType` `string` _(required)_
- `chainId` `number <double>`
- `createdAt` `number <double>` _(required)_
- `updatedAt` `number <double>` _(required)_
- `smartAccount` `object`
  - `implementationType` `string` _(required)_
  - `factoryAddress` `string`
  - `implementationAddress` `string` _(required)_
  - `salt` `string`
  - `deployedTx` `string`
  - `deployedAt` `number <double>`
  - `active` `boolean` _(required)_
  - `ownerAddress` `string`
  - `chainId` `number <double>`
- `recoveryMethod` `string`
- `recoveryMethodDetails` `object`
  - `passkeyId` `string`
  - `passkeyEnv` `object`
    - `name` `string`
    - `os` `string`
    - `osVersion` `string`
    - `device` `string`
- `custody` `string` _(required)_: Indicates key custody: "Developer" for TEE managed keys, "User" for user-managed keys.

#### `401`: Error response.

### 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 account

`DELETE /v2/accounts/{id}`

Removes an account from a project.

### Path parameters

- `id` `string` _(required)_

### Responses

#### `200`: Successful response.

Body (`application/json`):

- `id` `string` _(required)_
- `object` `string` _(required)_
- `deleted` `boolean` _(required)_

#### `401`: Unauthorized.

#### `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 account blockchain

`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`: Successful response.

Body (`application/json`):

- `id` `string` _(required)_
- `wallet` `string` _(required)_
- `accountType` `string` _(required)_
- `address` `string` _(required)_
- `ownerAddress` `string`
- `chainType` `string` _(required)_
- `chainId` `number <double>`
- `createdAt` `number <double>` _(required)_
- `updatedAt` `number <double>` _(required)_
- `smartAccount` `object`
  - `implementationType` `string` _(required)_
  - `factoryAddress` `string`
  - `implementationAddress` `string` _(required)_
  - `salt` `string`
  - `deployedTx` `string`
  - `deployedAt` `number <double>`
  - `active` `boolean` _(required)_
  - `ownerAddress` `string`
  - `chainId` `number <double>`
- `recoveryMethod` `string`
- `recoveryMethodDetails` `object`
  - `passkeyId` `string`
  - `passkeyEnv` `object`
    - `name` `string`
    - `os` `string`
    - `osVersion` `string`
    - `device` `string`
- `custody` `string` _(required)_: Indicates key custody: "Developer" for TEE managed keys, "User" for user-managed keys.

#### `401`: Error response.

### 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 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`: Successful response.

Body (`application/json`):

- `id` `string` _(required)_
- `wallet` `string` _(required)_
- `accountType` `string` _(required)_
- `address` `string` _(required)_
- `ownerAddress` `string`
- `chainType` `string` _(required)_
- `chainId` `number <double>`
- `createdAt` `number <double>` _(required)_
- `updatedAt` `number <double>` _(required)_
- `smartAccount` `object`
  - `implementationType` `string` _(required)_
  - `factoryAddress` `string`
  - `implementationAddress` `string` _(required)_
  - `salt` `string`
  - `deployedTx` `string`
  - `deployedAt` `number <double>`
  - `active` `boolean` _(required)_
  - `ownerAddress` `string`
  - `chainId` `number <double>`
- `recoveryMethod` `string`
- `recoveryMethodDetails` `object`
  - `passkeyId` `string`
  - `passkeyEnv` `object`
    - `name` `string`
    - `os` `string`
    - `osVersion` `string`
    - `device` `string`
- `custody` `string` _(required)_: Indicates key custody: "Developer" for TEE managed keys, "User" for user-managed keys.
- `share` `string` _(required)_
- `signerId` `string` _(required)_
- `userId` `string`

#### `401`: Unauthorized.

#### `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'
})
```
