End User Account Management

Import end user private key

Changed on

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

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

Headers

X-Wallet-Authstring 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-Keystring

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

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

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

Example request

{
  "userId": "e051beeb-7163-4527-a5b6-35e301529ff2",
  "authenticationMethods": [
    {
      "type": "email",
      "email": "user@example.com"
    },
    {
      "type": "sms",
      "phoneNumber": "+12055555555"
    },
    {
      "type": "jwt",
      "sub": "e051beeb-7163-4527-a5b6-35e301529ff2",
      "kid": "NjVBRjY5MDlCMUIwNzU4RTA2QzZFMDQ4QzQ2MDAyQjVDNjk1RTM2Qg"
    },
    {
      "type": "google",
      "sub": "115346410074741490243",
      "email": "test.user@gmail.com"
    },
    {
      "type": "telegram",
      "id": 1223456,
      "firstName": "Satoshi",
      "lastName": "Nakamoto",
      "photoUrl": "https://image.url/profile.jpg",
      "authDate": 1770681412,
      "username": "satoshinakamoto"
    },
    {
      "type": "siwe",
      "address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"
    }
  ],
  "encryptedPrivateKey": "U2FsdGVkX1+vupppZksvRf5X5YgHq4+da+Q4qf51+Q4=",
  "keyType": "evm"
}

Response

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

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

evmAccountsstring[] 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.

evmSmartAccountsstring[] 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.

solanaAccountsstring[] 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.

createdAtstring date-time required

The date and time when the end user was created, in ISO 8601 format.

Example response

{
  "userId": "e051beeb-7163-4527-a5b6-35e301529ff2",
  "authenticationMethods": [
    {
      "type": "email",
      "email": "user@example.com"
    },
    {
      "type": "sms",
      "phoneNumber": "+12055555555"
    },
    {
      "type": "jwt",
      "sub": "e051beeb-7163-4527-a5b6-35e301529ff2",
      "kid": "NjVBRjY5MDlCMUIwNzU4RTA2QzZFMDQ4QzQ2MDAyQjVDNjk1RTM2Qg"
    },
    {
      "type": "google",
      "sub": "115346410074741490243",
      "email": "test.user@gmail.com"
    },
    {
      "type": "telegram",
      "id": 1223456,
      "firstName": "Satoshi",
      "lastName": "Nakamoto",
      "photoUrl": "https://image.url/profile.jpg",
      "authDate": 1770681412,
      "username": "satoshinakamoto"
    },
    {
      "type": "siwe",
      "address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"
    }
  ],
  "mfaMethods": {
    "enrollmentPromptedAt": "2025-01-15T10:30:00Z",
    "totp": {
      "enrolledAt": "2025-01-15T10:30:00Z"
    },
    "sms": {
      "enrolledAt": "2025-01-15T10:30:00Z"
    }
  },
  "evmAccounts": [
    "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"
  ],
  "evmAccountObjects": [
    {
      "address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
      "createdAt": "2025-01-15T10:30:00Z"
    },
    {
      "address": "0x1234567890abcdef1234567890abcdef12345678",
      "createdAt": "2025-01-15T11:00:00Z"
    }
  ],
  "evmSmartAccounts": [
    "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"
  ],
  "evmSmartAccountObjects": [
    {
      "address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
      "ownerAddresses": [
        "0x1234567890abcdef1234567890abcdef12345678",
        "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd"
      ],
      "createdAt": "2025-01-15T12:00:00Z"
    }
  ],
  "solanaAccounts": [
    "HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT"
  ],
  "solanaAccountObjects": [
    {
      "address": "HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT",
      "createdAt": "2025-01-15T10:30:00Z"
    },
    {
      "address": "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin",
      "createdAt": "2025-01-15T11:30:00Z"
    }
  ],
  "createdAt": "2025-01-15T10:30:00Z"
}

Changes

    • warning

      added the new incompatible_event_types enum value to the response property for the response status

    • warning

      added the new incompatible_event_types enum value to the response property for the response status

    • warning

      added the new incompatible_event_types enum value to the response property for the response status

    • warning

      added the new incompatible_event_types enum value to the response property for the response status

    • warning

      added the new incompatible_event_types enum value to the response property for the response status

    • warning

      added the new incompatible_event_types enum value to the response property for the response status

    • warning

      added the new incompatible_event_types enum value to the response property for the response status

    • warning

      added the new incompatible_event_types enum value to the response property for the response status

    • warning

      added the new invalid_webhook_headers enum value to the response property for the response status

    • warning

      added the new invalid_webhook_headers enum value to the response property for the response status

    • warning

      added the new invalid_webhook_headers enum value to the response property for the response status

    • warning

      added the new invalid_webhook_headers enum value to the response property for the response status

    • warning

      added the new invalid_webhook_headers enum value to the response property for the response status

    • warning

      added the new invalid_webhook_headers enum value to the response property for the response status

    • warning

      added the new invalid_webhook_headers enum value to the response property for the response status

    • warning

      added the new invalid_webhook_headers enum value to the response property for the response status

    • warning

      added the new invalid_webhook_url enum value to the response property for the response status

    • warning

      added the new invalid_webhook_url enum value to the response property for the response status

    • warning

      added the new invalid_webhook_url enum value to the response property for the response status

    • warning

      added the new invalid_webhook_url enum value to the response property for the response status

    • warning

      added the new invalid_webhook_url enum value to the response property for the response status

    • warning

      added the new invalid_webhook_url enum value to the response property for the response status

    • warning

      added the new invalid_webhook_url enum value to the response property for the response status

    • warning

      added the new invalid_webhook_url enum value to the response property for the response status

    • warning

      added the new mandate_action_pending enum value to the response property for the response status

    • warning

      added the new mandate_action_pending enum value to the response property for the response status

    • warning

      added the new mandate_action_pending enum value to the response property for the response status

    • warning

      added the new mandate_action_pending enum value to the response property for the response status

    • warning

      added the new mandate_action_pending enum value to the response property for the response status

    • warning

      added the new mandate_action_pending enum value to the response property for the response status

    • warning

      added the new mandate_action_pending enum value to the response property for the response status

    • warning

      added the new mandate_action_pending enum value to the response property for the response status

    • warning

      added the new mandate_canceled enum value to the response property for the response status

    • warning

      added the new mandate_canceled enum value to the response property for the response status

    • warning

      added the new mandate_canceled enum value to the response property for the response status

    • warning

      added the new mandate_canceled enum value to the response property for the response status

    • warning

      added the new mandate_canceled enum value to the response property for the response status

    • warning

      added the new mandate_canceled enum value to the response property for the response status

    • warning

      added the new mandate_canceled enum value to the response property for the response status

    • warning

      added the new mandate_canceled enum value to the response property for the response status

    • warning

      added the new mandate_expired enum value to the response property for the response status

    • warning

      added the new mandate_expired enum value to the response property for the response status

    • warning

      added the new mandate_expired enum value to the response property for the response status

    • warning

      added the new mandate_expired enum value to the response property for the response status

    • warning

      added the new mandate_expired enum value to the response property for the response status

    • warning

      added the new mandate_expired enum value to the response property for the response status

    • warning

      added the new mandate_expired enum value to the response property for the response status

    • warning

      added the new mandate_expired enum value to the response property for the response status

    • warning

      added the new mandate_invalid_status enum value to the response property for the response status

    • warning

      added the new mandate_invalid_status enum value to the response property for the response status

    • warning

      added the new mandate_invalid_status enum value to the response property for the response status

    • warning

      added the new mandate_invalid_status enum value to the response property for the response status

    • warning

      added the new mandate_invalid_status enum value to the response property for the response status

    • warning

      added the new mandate_invalid_status enum value to the response property for the response status

    • warning

      added the new mandate_invalid_status enum value to the response property for the response status

    • warning

      added the new mandate_invalid_status enum value to the response property for the response status

    • warning

      added the new mandate_policy_violation enum value to the response property for the response status

    • warning

      added the new mandate_policy_violation enum value to the response property for the response status

    • warning

      added the new mandate_policy_violation enum value to the response property for the response status

    • warning

      added the new mandate_policy_violation enum value to the response property for the response status

    • warning

      added the new mandate_policy_violation enum value to the response property for the response status

    • warning

      added the new mandate_policy_violation enum value to the response property for the response status

    • warning

      added the new mandate_policy_violation enum value to the response property for the response status

    • warning

      added the new mandate_policy_violation enum value to the response property for the response status

    • warning

      added the new mandate_revoked enum value to the response property for the response status

    • warning

      added the new mandate_revoked enum value to the response property for the response status

    • warning

      added the new mandate_revoked enum value to the response property for the response status

    • warning

      added the new mandate_revoked enum value to the response property for the response status

    • warning

      added the new mandate_revoked enum value to the response property for the response status

    • warning

      added the new mandate_revoked enum value to the response property for the response status

    • warning

      added the new mandate_revoked enum value to the response property for the response status

    • warning

      added the new mandate_revoked enum value to the response property for the response status

    • warning

      added the new subscription_limit_exceeded enum value to the response property for the response status

    • warning

      added the new subscription_limit_exceeded enum value to the response property for the response status

    • warning

      added the new subscription_limit_exceeded enum value to the response property for the response status

    • warning

      added the new subscription_limit_exceeded enum value to the response property for the response status

    • warning

      added the new subscription_limit_exceeded enum value to the response property for the response status

    • warning

      added the new subscription_limit_exceeded enum value to the response property for the response status

    • warning

      added the new subscription_limit_exceeded enum value to the response property for the response status

    • warning

      added the new subscription_limit_exceeded enum value to the response property for the response status

    • warning

      added the new mfa_challenge_not_found enum value to the response property for the response status

    • warning

      added the new mfa_challenge_not_found enum value to the response property for the response status

    • warning

      added the new mfa_challenge_not_found enum value to the response property for the response status

    • warning

      added the new mfa_challenge_not_found enum value to the response property for the response status

    • warning

      added the new mfa_challenge_not_found enum value to the response property for the response status

    • warning

      added the new mfa_challenge_not_found enum value to the response property for the response status

    • warning

      added the new mfa_challenge_not_found enum value to the response property for the response status

    • warning

      added the new mfa_challenge_not_found enum value to the response property for the response status

    • warning

      added the new operation_in_progress enum value to the response property for the response status

    • warning

      added the new operation_in_progress enum value to the response property for the response status

    • warning

      added the new operation_in_progress enum value to the response property for the response status

    • warning

      added the new operation_in_progress enum value to the response property for the response status

    • warning

      added the new operation_in_progress enum value to the response property for the response status

    • warning

      added the new operation_in_progress enum value to the response property for the response status

    • warning

      added the new operation_in_progress enum value to the response property for the response status

    • warning

      added the new operation_in_progress enum value to the response property for the response status