EVM Accounts

Import EVM account

Changed on

Import an existing EVM account into the developer's CDP Project. This API should be called from the CDP SDK to ensure that the associated private key is properly encrypted.

post/v2/evm/accounts/import

Request

  • Base URL
    https://api.cdp.coinbase.com/platform
  • Auth
    HTTP bearer

Headers

X-Wallet-Auth, string required

A JWT signed using your Wallet Secret, encoded in base64. Refer to the Generate Wallet Token section of our Authentication docs for more details on how to generate your Wallet Token.

X-Idempotency-Key, string

An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our Idempotency docs for more information on using idempotency keys.

Request body

object required
encryptedPrivateKey, string required

The base64-encoded, encrypted private key of the EVM account. The private key must be encrypted using the CDP SDK's encryption scheme.

name, string

An optional name for the account. Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. Account names must be unique across all EVM accounts in the developer's CDP Project.

accountPolicy, string

The ID of the account-level policy to apply to the account.

Example request

{
  "encryptedPrivateKey": "U2FsdGVkX1+vupppZksvRf5X5YgHq4+da+Q4qf51+Q4=",
  "name": "my-wallet",
  "accountPolicy": "123e4567-e89b-12d3-a456-426614174000"
}

Response

Successfully imported EVM account.

EvmAccount required
address, string required

The 0x-prefixed, checksum EVM address.

name, string

An optional name for the account. Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. Account names are guaranteed to be unique across all EVM accounts in the developer's CDP Project.

policies, string[]

The list of policy IDs that apply to the account. This will include both the project-level policy and the account-level policy, if one exists.

createdAt, string date-time

The UTC ISO 8601 timestamp at which the account was created.

updatedAt, string date-time

The UTC ISO 8601 timestamp at which the account was last updated.

Example response

{
  "address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
  "name": "my-account",
  "policies": [
    "123e4567-e89b-12d3-a456-426614174000"
  ],
  "createdAt": "2025-03-25T12:00:00Z",
  "updatedAt": "2025-03-26T12:00:00Z"
}

Changes

    • warning

      added the new policy_not_applicable enum value to the errorType response property for the response status

    • warning

      added the new policy_not_applicable enum value to the errorType response property for the response status

    • warning

      added the new policy_not_applicable enum value to the errorType response property for the response status

    5 more changes in this revision