Skip to main content
PATCH
/
v1
/
addressBook
/
recipients
/
{id}
Modify a recipient
curl --request PATCH \
  --url https://api-sandbox.circle.com/v1/addressBook/recipients/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "metadata": {
    "nickname": "sample nickname",
    "email": "satoshi@circle.com",
    "bns": "sample.circle"
  }
}
'
import requests

url = "https://api-sandbox.circle.com/v1/addressBook/recipients/{id}"

payload = { "metadata": {
        "nickname": "sample nickname",
        "email": "satoshi@circle.com",
        "bns": "sample.circle"
    } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.text)
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    metadata: {nickname: 'sample nickname', email: 'satoshi@circle.com', bns: 'sample.circle'}
  })
};

fetch('https://api-sandbox.circle.com/v1/addressBook/recipients/{id}', 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.circle.com/v1/addressBook/recipients/{id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PATCH",
  CURLOPT_POSTFIELDS => json_encode([
    'metadata' => [
        'nickname' => 'sample nickname',
        'email' => 'satoshi@circle.com',
        'bns' => 'sample.circle'
    ]
  ]),
  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.circle.com/v1/addressBook/recipients/{id}"

	payload := strings.NewReader("{\n  \"metadata\": {\n    \"nickname\": \"sample nickname\",\n    \"email\": \"satoshi@circle.com\",\n    \"bns\": \"sample.circle\"\n  }\n}")

	req, _ := http.NewRequest("PATCH", 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.patch("https://api-sandbox.circle.com/v1/addressBook/recipients/{id}")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"metadata\": {\n    \"nickname\": \"sample nickname\",\n    \"email\": \"satoshi@circle.com\",\n    \"bns\": \"sample.circle\"\n  }\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api-sandbox.circle.com/v1/addressBook/recipients/{id}")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"metadata\": {\n    \"nickname\": \"sample nickname\",\n    \"email\": \"satoshi@circle.com\",\n    \"bns\": \"sample.circle\"\n  }\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "id": "8755d0ea-14f9-4259-b092-de23c14b6568",
    "chain": "ETH",
    "address": "0x45bfcf1a6289a0b77b4d3f7d12005a05949fd8c3",
    "metadata": {
      "nickname": "sample nickname",
      "email": "satoshi@circle.com",
      "bns": "sample.circle"
    },
    "status": "pending",
    "createDate": "2022-07-21T20:13:35.578678Z",
    "updateDate": "2022-07-21T20:19:24.859052Z"
  }
}
{
  "code": 400,
  "message": "Bad request."
}
{
  "code": 401,
  "message": "Malformed authorization."
}
{
  "code": 404,
  "message": "Not found."
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string<uuid>
required

Universally unique identifier (UUID v4) of a resource.

Example:

"b3d9d2d5-4c12-4946-a09d-953e82fae2b0"

Body

application/json
metadata
object

Recipient metadata. For Singapore (CIRCLE_SG) customers creating a self-hosted (ownership.custody.type = self_hosted) entry, email is required (validation error 2038).

Response

Successfully updated the address book recipient.

data
object

Recipient returned after a metadata update. The payload omits identity and ownership for all Circle entities.