Skip to main content
POST
/
passport-profile
/
v2
/
linked-wallets
Link wallet v2
curl --request POST \
  --url https://api.sandbox.immutable.com/passport-profile/v2/linked-wallets \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "io.metamask",
  "wallet_address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
  "signature": "<string>",
  "nonce": "<string>"
}
'
import requests

url = "https://api.sandbox.immutable.com/passport-profile/v2/linked-wallets"

payload = {
"type": "io.metamask",
"wallet_address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"signature": "<string>",
"nonce": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'io.metamask',
wallet_address: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
signature: '<string>',
nonce: '<string>'
})
};

fetch('https://api.sandbox.immutable.com/passport-profile/v2/linked-wallets', 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.sandbox.immutable.com/passport-profile/v2/linked-wallets",
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([
'type' => 'io.metamask',
'wallet_address' => '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
'signature' => '<string>',
'nonce' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$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.sandbox.immutable.com/passport-profile/v2/linked-wallets"

payload := strings.NewReader("{\n \"type\": \"io.metamask\",\n \"wallet_address\": \"0xd8da6bf26964af9d7eed9e03e53415d37aa96045\",\n \"signature\": \"<string>\",\n \"nonce\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
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))

}
HttpResponse<String> response = Unirest.post("https://api.sandbox.immutable.com/passport-profile/v2/linked-wallets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"io.metamask\",\n \"wallet_address\": \"0xd8da6bf26964af9d7eed9e03e53415d37aa96045\",\n \"signature\": \"<string>\",\n \"nonce\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.sandbox.immutable.com/passport-profile/v2/linked-wallets")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"io.metamask\",\n \"wallet_address\": \"0xd8da6bf26964af9d7eed9e03e53415d37aa96045\",\n \"signature\": \"<string>\",\n \"nonce\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
  "type": "MetaMask",
  "created_at": "2021-08-31T00:00:00Z",
  "updated_at": "2021-08-31T00:00:00Z",
  "clientName": "Passport Dashboard",
  "name": "Test"
}
{
"message": "all fields must be provided",
"link": "https://docs.x.immutable.com/reference/#/",
"trace_id": "e47634b79a5cd6894ddc9639ec4aad26",
"code": "VALIDATION_ERROR",
"details": {}
}
{
"message": "all fields must be provided",
"link": "https://docs.x.immutable.com/reference/#/",
"trace_id": "e47634b79a5cd6894ddc9639ec4aad26",
"code": "UNAUTHORISED_REQUEST",
"details": {}
}
{
"message": "all fields must be provided",
"link": "https://docs.x.immutable.com/reference/#/",
"trace_id": "e47634b79a5cd6894ddc9639ec4aad26",
"code": "AUTHENTICATION_ERROR",
"details": {}
}
{
"message": "all fields must be provided",
"link": "https://docs.x.immutable.com/reference/#/",
"trace_id": "e47634b79a5cd6894ddc9639ec4aad26",
"code": "INTERNAL_SERVER_ERROR",
"details": {}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Link wallet V2 request

type
string
required

This should be the EIP-6963 rdns value, if you're unable to get the rdns value you can provide "External". If using WalletConnect then provide "WalletConnect".

Maximum string length: 32
Example:

"io.metamask"

wallet_address
string
required

The address of the external wallet being linked to Passport

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0xd8da6bf26964af9d7eed9e03e53415d37aa96045"

signature
string
required

The EIP-712 signature

nonce
string
required

A unique identifier for the signature

Response

OK

Linked wallet

address
string
required

Ethereum address

Example:

"0xd8da6bf26964af9d7eed9e03e53415d37aa96045"

type
string
required

Wallet type

Example:

"MetaMask"

created_at
string<date-time>
required

Created at

Example:

"2021-08-31T00:00:00Z"

updated_at
string<date-time>
required

Created at

Example:

"2021-08-31T00:00:00Z"

clientName
string
required

Name of client that linked the wallet

Example:

"Passport Dashboard"

name
string

Name

Example:

"Test"