Create wallets with recovery
curl --request POST \
--url https://api.privy.io/v1/wallets_with_recovery \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '
{
"wallets": [
{
"chain_type": "ethereum",
"policy_ids": []
},
{
"chain_type": "solana",
"policy_ids": []
}
],
"primary_signer": {
"subject_id": "cm7oxq1el000e11o8iwp7d0d0"
},
"recovery_user": {
"linked_accounts": [
{
"type": "email",
"address": "[email protected]"
}
]
}
}
'HttpResponse<String> response = Unirest.post("https://api.privy.io/v1/wallets_with_recovery")
.header("privy-app-id", "<privy-app-id>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"wallets\": [\n {\n \"chain_type\": \"ethereum\",\n \"policy_ids\": []\n },\n {\n \"chain_type\": \"solana\",\n \"policy_ids\": []\n }\n ],\n \"primary_signer\": {\n \"subject_id\": \"cm7oxq1el000e11o8iwp7d0d0\"\n },\n \"recovery_user\": {\n \"linked_accounts\": [\n {\n \"type\": \"email\",\n \"address\": \"[email protected]\"\n }\n ]\n }\n}")
.asString();const options = {
method: 'POST',
headers: {
'privy-app-id': '<privy-app-id>',
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
wallets: [
{chain_type: 'ethereum', policy_ids: []},
{chain_type: 'solana', policy_ids: []}
],
primary_signer: {subject_id: 'cm7oxq1el000e11o8iwp7d0d0'},
recovery_user: {linked_accounts: [{type: 'email', address: '[email protected]'}]}
})
};
fetch('https://api.privy.io/v1/wallets_with_recovery', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.privy.io/v1/wallets_with_recovery",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'wallets' => [
[
'chain_type' => 'ethereum',
'policy_ids' => [
]
],
[
'chain_type' => 'solana',
'policy_ids' => [
]
]
],
'primary_signer' => [
'subject_id' => 'cm7oxq1el000e11o8iwp7d0d0'
],
'recovery_user' => [
'linked_accounts' => [
[
'type' => 'email',
'address' => '[email protected]'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json",
"privy-app-id: <privy-app-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.privy.io/v1/wallets_with_recovery"
payload := strings.NewReader("{\n \"wallets\": [\n {\n \"chain_type\": \"ethereum\",\n \"policy_ids\": []\n },\n {\n \"chain_type\": \"solana\",\n \"policy_ids\": []\n }\n ],\n \"primary_signer\": {\n \"subject_id\": \"cm7oxq1el000e11o8iwp7d0d0\"\n },\n \"recovery_user\": {\n \"linked_accounts\": [\n {\n \"type\": \"email\",\n \"address\": \"[email protected]\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("privy-app-id", "<privy-app-id>")
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"wallets": [
{
"id": "ubul5xhljqorce73sf82u0p3",
"address": "0x3DE69Fd93873d40459f27Ce5B74B42536f8d6149",
"chain_type": "ethereum",
"policy_ids": [],
"additional_signers": [],
"created_at": 1744300912643,
"owner_id": "lzjb3xnjk2ntod3w1hgwa358",
"exported_at": null,
"imported_at": null,
"archived_at": null
},
{
"id": "sb4y18l68xze8gfszafmyv3q",
"address": "9wtGmqMamnKfz49XBwnJASbjcVnnKnT78qKopCL54TAk",
"chain_type": "solana",
"policy_ids": [],
"additional_signers": [],
"created_at": 1744300912644,
"owner_id": "lzjb3xnjk2ntod3w1hgwa358",
"exported_at": null,
"imported_at": null,
"archived_at": null
}
],
"recovery_user_id": "so6bsadjfi3ihhkyt9hlqv6x"
}Create wallets
deprecated
Create one or more wallets associated with a recovery user, so the user can later regain wallet access via the linked accounts. Deprecated; prefer the standard wallet creation flow combined with a separate recovery setup.
POST
/
v1
/
wallets_with_recovery
Create wallets with recovery
curl --request POST \
--url https://api.privy.io/v1/wallets_with_recovery \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '
{
"wallets": [
{
"chain_type": "ethereum",
"policy_ids": []
},
{
"chain_type": "solana",
"policy_ids": []
}
],
"primary_signer": {
"subject_id": "cm7oxq1el000e11o8iwp7d0d0"
},
"recovery_user": {
"linked_accounts": [
{
"type": "email",
"address": "[email protected]"
}
]
}
}
'HttpResponse<String> response = Unirest.post("https://api.privy.io/v1/wallets_with_recovery")
.header("privy-app-id", "<privy-app-id>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"wallets\": [\n {\n \"chain_type\": \"ethereum\",\n \"policy_ids\": []\n },\n {\n \"chain_type\": \"solana\",\n \"policy_ids\": []\n }\n ],\n \"primary_signer\": {\n \"subject_id\": \"cm7oxq1el000e11o8iwp7d0d0\"\n },\n \"recovery_user\": {\n \"linked_accounts\": [\n {\n \"type\": \"email\",\n \"address\": \"[email protected]\"\n }\n ]\n }\n}")
.asString();const options = {
method: 'POST',
headers: {
'privy-app-id': '<privy-app-id>',
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
wallets: [
{chain_type: 'ethereum', policy_ids: []},
{chain_type: 'solana', policy_ids: []}
],
primary_signer: {subject_id: 'cm7oxq1el000e11o8iwp7d0d0'},
recovery_user: {linked_accounts: [{type: 'email', address: '[email protected]'}]}
})
};
fetch('https://api.privy.io/v1/wallets_with_recovery', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.privy.io/v1/wallets_with_recovery",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'wallets' => [
[
'chain_type' => 'ethereum',
'policy_ids' => [
]
],
[
'chain_type' => 'solana',
'policy_ids' => [
]
]
],
'primary_signer' => [
'subject_id' => 'cm7oxq1el000e11o8iwp7d0d0'
],
'recovery_user' => [
'linked_accounts' => [
[
'type' => 'email',
'address' => '[email protected]'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json",
"privy-app-id: <privy-app-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.privy.io/v1/wallets_with_recovery"
payload := strings.NewReader("{\n \"wallets\": [\n {\n \"chain_type\": \"ethereum\",\n \"policy_ids\": []\n },\n {\n \"chain_type\": \"solana\",\n \"policy_ids\": []\n }\n ],\n \"primary_signer\": {\n \"subject_id\": \"cm7oxq1el000e11o8iwp7d0d0\"\n },\n \"recovery_user\": {\n \"linked_accounts\": [\n {\n \"type\": \"email\",\n \"address\": \"[email protected]\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("privy-app-id", "<privy-app-id>")
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"wallets": [
{
"id": "ubul5xhljqorce73sf82u0p3",
"address": "0x3DE69Fd93873d40459f27Ce5B74B42536f8d6149",
"chain_type": "ethereum",
"policy_ids": [],
"additional_signers": [],
"created_at": 1744300912643,
"owner_id": "lzjb3xnjk2ntod3w1hgwa358",
"exported_at": null,
"imported_at": null,
"archived_at": null
},
{
"id": "sb4y18l68xze8gfszafmyv3q",
"address": "9wtGmqMamnKfz49XBwnJASbjcVnnKnT78qKopCL54TAk",
"chain_type": "solana",
"policy_ids": [],
"additional_signers": [],
"created_at": 1744300912644,
"owner_id": "lzjb3xnjk2ntod3w1hgwa358",
"exported_at": null,
"imported_at": null,
"archived_at": null
}
],
"recovery_user_id": "so6bsadjfi3ihhkyt9hlqv6x"
}Directly managing user authorization keys via the API is an advanced setting. We recommend using
Privy’s SDKs, which internally manage user authorization keys if applicable.
Authorizations
Basic Auth header with your app ID as the username and your app secret as the password.
Headers
ID of your Privy app.
Body
application/json
Was this page helpful?

