---
title: "Import end user private key"
method: POST
path: "/v2/end-users/import"
tags: ["End User Account Management"]
---

# Import end user private key

`POST /v2/end-users/import`

## Request

- Base URL: `https://api.cdp.coinbase.com/platform`
- URL: `https://api.cdp.coinbase.com/platform/v2/end-users/import`
- Auth: HTTP bearer

Imports an existing private key for an end user into the developer's CDP Project. The private key must be encrypted using the CDP SDK's encryption scheme before being sent to this endpoint. This API should be called from the [CDP SDK](https://github.com/coinbase/cdp-sdk) to ensure that the associated private key is properly encrypted.

This endpoint allows developers to import existing keys for their end users, supporting both EVM and Solana key types. The end user must have at least one authentication method configured.

## Headers

- `X-Wallet-Auth` string, required
- `X-Idempotency-Key` string

## Request body

- object
  - `userId` string, required: A stable, unique identifier for the end user. The `userId` must be unique across all end users in the developer's CDP Project. It must be between 1 and 100 characters long and can only contain alphanumeric characters and hyphens.
  - `authenticationMethods` AuthenticationMethod[], required: The list of valid authentication methods linked to the end user.
    - union: Information about how the end user is authenticated.
      - EmailAuthentication: Information about an end user who authenticates using a one-time password sent to their email address.
        - `type` 'email', required: The type of authentication information.
        - `email` string, email, required: The email address of the end user.
      - SmsAuthentication: Information about an end user who authenticates using a one-time password sent to their phone number via SMS.
        - `type` 'sms', required: The type of authentication information.
        - `phoneNumber` string, required: Phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format.
      - DeveloperJWTAuthentication: Information about an end user who authenticates using a JWT issued by the developer.
        - `type` 'jwt', required: The type of authentication information.
        - `kid` string, required: The key ID of the JWK used to sign the JWT.
        - `sub` string, required: The unique identifier for the end user that is captured in the `sub` claim of the JWT.
      - OAuth2Authentication: Information about an end user who authenticates using a third-party provider.
        - `type` 'google' | 'apple' | 'x' | 'telegram' | 'github', required: The type of OAuth2 provider.
        - `sub` string, required: The unique identifier for the end user that is captured in the `sub` claim of the JWT.
        - `email` string: The email address of the end user contained within the user's ID token, if available from third-party OAuth2 provider's token exchange.
        - `name` string: The full name of the end user if available from third-party OAuth2 provider's token exchange.
        - `username` string: The username of the end user if available from third-party OAuth2 provider's token exchange.
      - TelegramAuthentication: Information about an end user who authenticates using Telegram.
        - `type` 'google' | 'apple' | 'x' | 'telegram' | 'github', required: The type of OAuth2 provider.
        - `id` integer, required: The Telegram ID for the end user.
        - `firstName` string: The Telegram user's first name.
        - `lastName` string: The Telegram user's last name.
        - `photoUrl` string: The Telegram user's profile picture.
        - `authDate` integer, required: The Telegram user's last login as a Unix timestamp.
        - `username` string: The Telegram user's username.
      - SiweAuthentication: Information about an end user who authenticates using Sign In With Ethereum (EIP-4361).
        - `type` 'siwe', required: The type of authentication information.
        - `address` string, required: The ERC-55 checksummed Ethereum address of the end user.
  - `encryptedPrivateKey` string, required: The base64-encoded, encrypted private key to import. The private key must be encrypted using the CDP SDK's encryption scheme. This is a 32-byte raw private key.
  - `keyType` 'evm' | 'solana', required: The type of key being imported. Determines what type of account will be associated for the end user.

## Response `201`

Successfully imported key and created end user with the associated account.

- EndUser: Information about the end user.
  - `userId` string, required: A stable, unique identifier for the end user. The `userId` must be unique across all end users in the developer's CDP Project. It must be between 1 and 100 characters long and can only contain alphanumeric characters and hyphens.
  - `authenticationMethods` AuthenticationMethod[], required: The list of valid authentication methods linked to the end user.
    - union: Information about how the end user is authenticated.
      - EmailAuthentication: Information about an end user who authenticates using a one-time password sent to their email address.
        - `type` 'email', required: The type of authentication information.
        - `email` string, email, required: The email address of the end user.
      - SmsAuthentication: Information about an end user who authenticates using a one-time password sent to their phone number via SMS.
        - `type` 'sms', required: The type of authentication information.
        - `phoneNumber` string, required: Phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format.
      - DeveloperJWTAuthentication: Information about an end user who authenticates using a JWT issued by the developer.
        - `type` 'jwt', required: The type of authentication information.
        - `kid` string, required: The key ID of the JWK used to sign the JWT.
        - `sub` string, required: The unique identifier for the end user that is captured in the `sub` claim of the JWT.
      - OAuth2Authentication: Information about an end user who authenticates using a third-party provider.
        - `type` 'google' | 'apple' | 'x' | 'telegram' | 'github', required: The type of OAuth2 provider.
        - `sub` string, required: The unique identifier for the end user that is captured in the `sub` claim of the JWT.
        - `email` string: The email address of the end user contained within the user's ID token, if available from third-party OAuth2 provider's token exchange.
        - `name` string: The full name of the end user if available from third-party OAuth2 provider's token exchange.
        - `username` string: The username of the end user if available from third-party OAuth2 provider's token exchange.
      - TelegramAuthentication: Information about an end user who authenticates using Telegram.
        - `type` 'google' | 'apple' | 'x' | 'telegram' | 'github', required: The type of OAuth2 provider.
        - `id` integer, required: The Telegram ID for the end user.
        - `firstName` string: The Telegram user's first name.
        - `lastName` string: The Telegram user's last name.
        - `photoUrl` string: The Telegram user's profile picture.
        - `authDate` integer, required: The Telegram user's last login as a Unix timestamp.
        - `username` string: The Telegram user's username.
      - SiweAuthentication: Information about an end user who authenticates using Sign In With Ethereum (EIP-4361).
        - `type` 'siwe', required: The type of authentication information.
        - `address` string, required: The ERC-55 checksummed Ethereum address of the end user.
  - `mfaMethods` MFAMethods: Information about the end user's MFA enrollments.
    - `enrollmentPromptedAt` string, date-time: The date and time when the end user was prompted for MFA enrollment, in ISO 8601 format. If the this field exists, and the user has no other enrolled MFA methods, then the user skipped MFA enrollment.
    - `totp` object: An object containing information about the end user's TOTP enrollment.
      - `enrolledAt` string, date-time, required: The date and time when the method was enrolled, in ISO 8601 format.
    - `sms` object: An object containing information about the end user's SMS MFA enrollment.
      - `enrolledAt` string, date-time, required: The date and time when the method was enrolled, in ISO 8601 format.
  - `evmAccounts` string[], required: **DEPRECATED**: Use `evmAccountObjects` instead for richer account information. The list of EVM account addresses associated with the end user. End users can have up to 10 EVM accounts.
  - `evmAccountObjects` EndUserEvmAccount[], required: The list of EVM accounts associated with the end user. End users can have up to 10 EVM accounts.
    - `address` string, required: The address of the EVM account.
    - `createdAt` string, date-time, required: The date and time when the account was created, in ISO 8601 format.
    - `exportedAt` string, date-time, nullable: The date and time when the account's private key was first exported, in ISO 8601 format. This is set on the first export and preserved on subsequent exports; it is not updated on re-export.
    - `ejectedAt` string, date-time, nullable: The date and time when the account's key was ejected (marked for deletion), in ISO 8601 format. Populated when the account has been ejected. The account record remains queryable after this timestamp is set; it reflects when ejection was requested, not when the key material is purged.
  - `evmSmartAccounts` string[], required: **DEPRECATED**: Use `evmSmartAccountObjects` instead for richer account information including owner relationships. The list of EVM smart account addresses associated with the end user. Each EVM EOA can own one smart account.
  - `evmSmartAccountObjects` EndUserEvmSmartAccount[], required: The list of EVM smart accounts associated with the end user. Each EVM EOA can own one smart account.
    - `address` string, required: The address of the EVM smart account.
    - `ownerAddresses` string[], required: The addresses of the EVM EOA accounts that own this smart account. Smart accounts can have multiple owners, such as when spend permissions are enabled.
    - `createdAt` string, date-time, required: The date and time when the account was created, in ISO 8601 format.
  - `solanaAccounts` string[], required: **DEPRECATED**: Use `solanaAccountObjects` instead for richer account information. The list of Solana account addresses associated with the end user. End users can have up to 10 Solana accounts.
  - `solanaAccountObjects` EndUserSolanaAccount[], required: The list of Solana accounts associated with the end user. End users can have up to 10 Solana accounts.
    - `address` string, required: The base58 encoded address of the Solana account.
    - `createdAt` string, date-time, required: The date and time when the account was created, in ISO 8601 format.
    - `exportedAt` string, date-time, nullable: The date and time when the account's private key was first exported, in ISO 8601 format. This is set on the first export and preserved on subsequent exports; it is not updated on re-export.
    - `ejectedAt` string, date-time, nullable: The date and time when the account's key was ejected (marked for deletion), in ISO 8601 format. Populated when the account has been ejected. The account record remains queryable after this timestamp is set; it reflects when ejection was requested, not when the key material is purged.
  - `createdAt` string, date-time, required: The date and time when the end user was created, in ISO 8601 format.

## Other responses

- `400`: Invalid request.
- `401`: Unauthorized.
- `402`: A payment method is required to complete this operation.
- `409`: Resource already exists.
- `422`: Idempotency key conflict.
- `500`: Internal server error.
- `502`: Bad gateway.
- `503`: Service unavailable.

## Changes

- **2026-12-01** `06cb41a4fb57`: 8 warning
  - added the new `policy_not_applicable` enum value to the `errorType` response property for the response status `400`
  - added the new `policy_not_applicable` enum value to the `errorType` response property for the response status `401`
  - added the new `policy_not_applicable` enum value to the `errorType` response property for the response status `402`
  - added the new `policy_not_applicable` enum value to the `errorType` response property for the response status `409`
  - …4 more
- **2026-10-16** `ff3c1fdef902`: 8 warning
  - added the new `entity_not_configured_for_top_up` enum value to the `errorType` response property for the response status `400`
  - added the new `entity_not_configured_for_top_up` enum value to the `errorType` response property for the response status `401`
  - added the new `entity_not_configured_for_top_up` enum value to the `errorType` response property for the response status `402`
  - added the new `entity_not_configured_for_top_up` enum value to the `errorType` response property for the response status `409`
  - …4 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/coinbase/apis/coinbase-developer-platform-apis/changes/v2/end-users/import/post.md)

---

[API](https://skmtc.dev/coinbase/apis/coinbase-developer-platform-apis.md) - [All operations](https://skmtc.dev/coinbase/apis/coinbase-developer-platform-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/coinbase/apis/coinbase-developer-platform-apis/revisions/06cb41a4fb57?raw)
