Skip to main content
To import existing users, Privy allows you to create users with their linked accounts (wallet, email, etc.) in batches via REST API to simplify the migration process. To create users, pass in an array of user objects which each represent a new user. You can also create wallets with wallet pregeneration. Once a user has been created, all of their accounts (wallet, email, etc.) will be included in their user object when they log in. If the user has an embedded wallet, that wallet will be available to the user upon sign in.
Make a POST request to:
In the body of the request, include a users field with an array of up to 20 user objects.Below is a sample cURL command for creating multiple new users:

Parameters

LinkedAccount[]
required
An array including all of the user’s linked accounts. These objects are in the same shape as the linked accounts returned by getUser. For each linked account, you must specify the type and must not include a verifiedAt timestamp.
(See Discord docs)
(See Farcaster docs. Note that the Privy import interface differs slightly from the Farcaster public interface in order to maintain consistency with other Privy LinkedAccount types.)
(See GitHub docs)
(See Instagram docs)
(See Linkedin docs)
While number is accepted as input, phoneNumber is returned in the response.
(See Spotify docs)
(See Telegram docs)
(See Twitter docs)
WalletCreateRequestType[]
(Optional) An array of wallets to create for the user.

Response Format

A successful response will include a list of results along with details about which succeeded and which failed:
Each result in the response includes:
string
The action taken (“create”).
number
The index of the user in the request array.
boolean
Whether the user creation succeeded.
string
The Privy DID of the user (if successful).
number
Error code (if unsuccessful).
string
Error message (if unsuccessful).
string
The conflicting DID (if there was an account conflict).
User creation endpoints have a rate limit of 240 users per minute. If you are being rate limited, responses will have status code 429. We suggest you set up exponential back-offs starting at 1 second to seamlessly recover.