Import a user
Privy allows you to import a single user into your Privy app. To import a user, pass their linked accounts (wallet, email, etc.) as part of the import request. You can also create a wallet during import with wallet pregeneration.
When an imported user logs in, all of their imported accounts will be included in their user object. If the imported user has a pregenerated embedded wallet, that wallet will be available to the user upon sign in.
Use the PrivyClient
’s importUser
method to import a single user into your Privy app.
Parameters
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.
Whether to pregenerate an embedded Ethereum wallet for the imported user. Defaults to false
.
Whether to pregenerate an embedded Solana wallet for the imported user. Defaults to false
.
Whether to pregenerate an embedded Smart wallet for the imported user. Defaults to false
. If
createEthereumSmartWallet
is true
, you must also explicitly set createEthereumWallet
to
true as well.
An object containing any custom metadata you want to associate with the user. This metadata will be returned in the user object when the user logs in.
Use the PrivyClient
’s importUser
method to import a single user into your Privy app.
Parameters
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.
Whether to pregenerate an embedded Ethereum wallet for the imported user. Defaults to false
.
Whether to pregenerate an embedded Solana wallet for the imported user. Defaults to false
.
Whether to pregenerate an embedded Smart wallet for the imported user. Defaults to false
. If
createEthereumSmartWallet
is true
, you must also explicitly set createEthereumWallet
to
true as well.
An object containing any custom metadata you want to associate with the user. This metadata will be returned in the user object when the user logs in.
Make a POST
request to:
Below is a sample cURL command for importing a new user into Privy:
Parameters
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.
Whether to pregenerate an embedded Ethereum wallet for the imported user. Defaults to false
.
Whether to pregenerate an embedded Solana wallet for the imported user. Defaults to false
.
Whether to pregenerate an embedded Smart wallet for the imported user. Defaults to false
. If
createEthereumSmartWallet
is true
, you must also explicitly set createEthereumWallet
to
true as well.
An object containing any custom metadata you want to associate with the user. This metadata will be returned in the user object when the user logs in.
A successful response will include the new user object along with their DID:
User import endpoints have a rate limit of 240 users in total 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.