Update a client
curl --request PATCH \
--url https://api-sandbox.ledgersyncappv2.com/v3/clients/{client_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "<string>",
"email": "jsmith@example.com",
"name": "<string>",
"phone": "<string>",
"metadata": {}
}
'import requests
url = "https://api-sandbox.ledgersyncappv2.com/v3/clients/{client_id}"
payload = {
"external_id": "<string>",
"email": "jsmith@example.com",
"name": "<string>",
"phone": "<string>",
"metadata": {}
}
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({
external_id: '<string>',
email: 'jsmith@example.com',
name: '<string>',
phone: '<string>',
metadata: {}
})
};
fetch('https://api-sandbox.ledgersyncappv2.com/v3/clients/{client_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.ledgersyncappv2.com/v3/clients/{client_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([
'external_id' => '<string>',
'email' => 'jsmith@example.com',
'name' => '<string>',
'phone' => '<string>',
'metadata' => [
]
]),
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.ledgersyncappv2.com/v3/clients/{client_id}"
payload := strings.NewReader("{\n \"external_id\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"metadata\": {}\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.ledgersyncappv2.com/v3/clients/{client_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.ledgersyncappv2.com/v3/clients/{client_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 \"external_id\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "cli_01HXYZ8A6N7K2W9PQ4T5Z3V6E0",
"created_at": "2023-11-07T05:31:56Z",
"external_id": "<string>",
"email": "jsmith@example.com",
"name": "<string>",
"phone": "<string>",
"metadata": {},
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "unknown_api_key",
"message": "The API key you presented doesn't match any active key.",
"type": "auth_error",
"doc_url": "https://portal.ledgersyncappv2.com/errors/unknown_api_key",
"category": "AUTH_ERROR",
"is_user_actionable": true,
"source_diagnostic_code": "FIN-103",
"param": "client.email",
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"errors": [
{
"param": "client.email",
"message": "must be a valid email address",
"code": "invalid_email"
}
]
}
}{
"error": {
"code": "unknown_api_key",
"message": "The API key you presented doesn't match any active key.",
"type": "auth_error",
"doc_url": "https://portal.ledgersyncappv2.com/errors/unknown_api_key",
"category": "AUTH_ERROR",
"is_user_actionable": true,
"source_diagnostic_code": "FIN-103",
"param": "client.email",
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"errors": [
{
"param": "client.email",
"message": "must be a valid email address",
"code": "invalid_email"
}
]
}
}{
"error": {
"code": "unknown_api_key",
"message": "The API key you presented doesn't match any active key.",
"type": "auth_error",
"doc_url": "https://portal.ledgersyncappv2.com/errors/unknown_api_key",
"category": "AUTH_ERROR",
"is_user_actionable": true,
"source_diagnostic_code": "FIN-103",
"param": "client.email",
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"errors": [
{
"param": "client.email",
"message": "must be a valid email address",
"code": "invalid_email"
}
]
}
}Clients
Update a client
Partial update — send only the fields you want to change.
Omitted fields stay as they are. Useful for keeping name
or metadata in sync with your own user record.
PATCH
/
clients
/
{client_id}
Update a client
curl --request PATCH \
--url https://api-sandbox.ledgersyncappv2.com/v3/clients/{client_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "<string>",
"email": "jsmith@example.com",
"name": "<string>",
"phone": "<string>",
"metadata": {}
}
'import requests
url = "https://api-sandbox.ledgersyncappv2.com/v3/clients/{client_id}"
payload = {
"external_id": "<string>",
"email": "jsmith@example.com",
"name": "<string>",
"phone": "<string>",
"metadata": {}
}
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({
external_id: '<string>',
email: 'jsmith@example.com',
name: '<string>',
phone: '<string>',
metadata: {}
})
};
fetch('https://api-sandbox.ledgersyncappv2.com/v3/clients/{client_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.ledgersyncappv2.com/v3/clients/{client_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([
'external_id' => '<string>',
'email' => 'jsmith@example.com',
'name' => '<string>',
'phone' => '<string>',
'metadata' => [
]
]),
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.ledgersyncappv2.com/v3/clients/{client_id}"
payload := strings.NewReader("{\n \"external_id\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"metadata\": {}\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.ledgersyncappv2.com/v3/clients/{client_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.ledgersyncappv2.com/v3/clients/{client_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 \"external_id\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "cli_01HXYZ8A6N7K2W9PQ4T5Z3V6E0",
"created_at": "2023-11-07T05:31:56Z",
"external_id": "<string>",
"email": "jsmith@example.com",
"name": "<string>",
"phone": "<string>",
"metadata": {},
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "unknown_api_key",
"message": "The API key you presented doesn't match any active key.",
"type": "auth_error",
"doc_url": "https://portal.ledgersyncappv2.com/errors/unknown_api_key",
"category": "AUTH_ERROR",
"is_user_actionable": true,
"source_diagnostic_code": "FIN-103",
"param": "client.email",
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"errors": [
{
"param": "client.email",
"message": "must be a valid email address",
"code": "invalid_email"
}
]
}
}{
"error": {
"code": "unknown_api_key",
"message": "The API key you presented doesn't match any active key.",
"type": "auth_error",
"doc_url": "https://portal.ledgersyncappv2.com/errors/unknown_api_key",
"category": "AUTH_ERROR",
"is_user_actionable": true,
"source_diagnostic_code": "FIN-103",
"param": "client.email",
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"errors": [
{
"param": "client.email",
"message": "must be a valid email address",
"code": "invalid_email"
}
]
}
}{
"error": {
"code": "unknown_api_key",
"message": "The API key you presented doesn't match any active key.",
"type": "auth_error",
"doc_url": "https://portal.ledgersyncappv2.com/errors/unknown_api_key",
"category": "AUTH_ERROR",
"is_user_actionable": true,
"source_diagnostic_code": "FIN-103",
"param": "client.email",
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"errors": [
{
"param": "client.email",
"message": "must be a valid email address",
"code": "invalid_email"
}
]
}
}Authorizations
Pass your secret key in the Authorization header as a Bearer
token: Authorization: Bearer sk_test_... (sandbox) or
Bearer sk_live_... (production).
Keys are created in the developer portal and the plaintext secret is shown exactly once at creation. Treat them like passwords — never embed them in mobile apps or front-end code.
Path Parameters
Body
application/json
Response
OK
Example:
"cli_01HXYZ8A6N7K2W9PQ4T5Z3V6E0"
Integrator-supplied identifier; useful for joining to your own systems.
Contact phone number for the client.
Free-form key-value pairs for integrator use. Max 20 keys.
Show child attributes
Show child attributes
⌘I
