Setup

To create user wallets that integrate directly with your JWT-based authentication system, first configure your app’s JWT-based authentication settings in the dashboard. The User Signer API uses this configuration to verify the legitimacy of user JWTs.

Create a user wallets

Once you have configured your custom JWT authentication in the dashboard, your application can create a user wallet by calling the /v1/wallets_with_recovery endpoint with your user’s JWT subject ID. This endpoint will create a wallet that can be accessed using the associated user JWT.

Request

The request to /v1/users contains the following parameters.
linked_accounts
object[]
required
wallets
array
required

Response

The response from the endpoint will contain the following fields.
linked_accounts
object[]
required
The wallet that was created, and the custom auth account linked to the user.
id
string
required
The ID of the created user.

Example

An example request to /v1/users may have the following parameters.
curl -X POST https://api.privy.io/v1/users \
  -u "<your-privy-app-id>:<your-privy-app-secret>" \
  -H "privy-app-id: <your-privy-app-id>" \
  -H "Content-Type: application/json" \
  -d '{
    "linked_accounts": [
        {
            "type": "custom_auth",
            "custom_user_id": "subject_id"
        }
    ],
    "wallets": [{
        "chain_type": "ethereum"
    }]
}'
A successful response will look like the following.
{
  "linked_accounts": [
    {
      "type": "custom_auth",
      "custom_user_id": "<custom-user-id>"
    },
    {
      "id": "<wallet-id>",
      "chain_type": "ethereum",
      "address": "<wallet-address>",
      "owner_id": "<key-quorum-containing-user-id>"
    }
  ],
  "id": "<user-id>"
}