v2

latestOpenAPI 3.0.12026-07-26334612609.5 KB
Wallets

Creates a new embedded wallet for a user given an identifier

Creates a new embedded wallet for a user given an email or userId. If an email is provided and it is not associated with an existing user this call will also create a new user.

post/environments/{environmentId}/embeddedWallets

Path parameters

environmentIdstring required
Example:95b11417-f18f-457f-8804-68e361f9164f

ID of the environment

Request body

identifierstring required

Identifier for the user. Must be either an email, phone number, user id, external user id, or username from a supported social provider

type'email' | 'id' | 'externalUserId' | 'phoneNumber' | 'socialUsername' | 'socialAccountId' required
chainsEmbeddedWalletChainEnum[]

The chains to create the wallet for

chain'EVM' | 'SOL' | 'SUI' | 'BTC' | 'TON'
socialProvider'emailOnly' | 'magicLink' | 'apple' | 'bitbucket' | 'coinbasesocial' | 'discord' | 'epicgames' | 'facebook' | 'farcaster' | 'github' | 'gitlab' | 'google' | 'instagram' | 'linkedin' | 'microsoft' | 'twitch' | 'twitter' | 'blocto' | 'banxa' | 'coinbaseOnramp' | 'cryptoDotCom' | 'dynamic' | 'alchemy' | 'zerodev' | 'telegram' | 'turnkey' | 'coinbaseWaas' | 'sms' | 'spotify' | 'tiktok' | 'line' | 'steam' | 'shopify' | 'zksync' | 'kraken' | 'blockaid' | 'passkey' | 'okta' | 'sendgrid' | 'resend'

The 'turnkey' value is deprecated and will be removed in a future version.

Example request

{
  "smsCountryCode": {
    "isoCountryCode": "US",
    "phoneCountryCode": "An example name"
  }
}

Response

Wallet already exists for the user

Example response

{
  "user": {
    "id": "95b11417-f18f-457f-8804-68e361f9164f",
    "projectEnvironmentId": "95b11417-f18f-457f-8804-68e361f9164f",
    "verifiedCredentials": [
      {
        "address": "0xbF394748301603f18d953C90F0b087CBEC0E1834",
        "refId": "95b11417-f18f-457f-8804-68e361f9164f",
        "signerRefId": "95b11417-f18f-457f-8804-68e361f9164f",
        "id": "95b11417-f18f-457f-8804-68e361f9164f",
        "wallet_properties": {
          "turnkeySubOrganizationId": "95b11417-f18f-457f-8804-68e361f9164f",
          "turnkeyPrivateKeyId": "95b11417-f18f-457f-8804-68e361f9164f",
          "turnkeyHDWalletId": "95b11417-f18f-457f-8804-68e361f9164f",
          "turnkeyUserId": "95b11417-f18f-457f-8804-68e361f9164f"
        },
        "phoneNumber": "9171113333",
        "phoneCountryCode": "1",
        "isoCountryCode": "US",
        "previous_users": [
          "95b11417-f18f-457f-8804-68e361f9164f"
        ]
      }
    ],
    "lastVerifiedCredentialId": "95b11417-f18f-457f-8804-68e361f9164f",
    "sessionId": "95b11417-f18f-457f-8804-68e361f9164f",
    "alias": "An example name",
    "country": "US",
    "firstName": "An example name",
    "jobTitle": "An example name",
    "lastName": "An example name",
    "tShirtSize": "An example name",
    "team": "An example name",
    "username": "An example name",
    "scope": "superuser marketing operations",
    "missingFields": [
      {
        "validationRules": {
          "regex": "^0x",
          "validOptions": [
            {
              "label": "small"
            },
            {
              "label": "medium"
            },
            {
              "label": "large"
            }
          ],
          "checkboxText": "Agree to the terms and conditions"
        }
      }
    ],
    "sessions": [
      {
        "id": "95b11417-f18f-457f-8804-68e361f9164f"
      }
    ],
    "wallets": [
      {
        "id": "95b11417-f18f-457f-8804-68e361f9164f",
        "name": "An example name",
        "publicKey": "0xbF394748301603f18d953C90F0b087CBEC0E1834",
        "properties": {
          "turnkeySubOrganizationId": "95b11417-f18f-457f-8804-68e361f9164f",
          "turnkeyPrivateKeyId": "95b11417-f18f-457f-8804-68e361f9164f",
          "turnkeyHDWalletId": "95b11417-f18f-457f-8804-68e361f9164f",
          "turnkeyUserId": "95b11417-f18f-457f-8804-68e361f9164f"
        }
      }
    ],
    "chainalysisChecks": [
      {
        "id": "95b11417-f18f-457f-8804-68e361f9164f",
        "walletPublicKey": "0xbF394748301603f18d953C90F0b087CBEC0E1834"
      }
    ],
    "oauthAccounts": [
      {
        "id": "95b11417-f18f-457f-8804-68e361f9164f"
      }
    ],
    "mfaDevices": [
      {
        "id": "95b11417-f18f-457f-8804-68e361f9164f"
      }
    ]
  }
}