curl --request PATCH \
--url https://api.sandbox.lead.bank/v2/entities/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"type": "individual",
"intended_eligibility": [
"account_holder"
],
"risk_score": "low",
"individual_details": {
"first_name": "Lucy",
"preferred_first_name": "Lu",
"middle_name": "Reginald",
"last_name": "Collins",
"date_of_birth": "2002-02-15",
"occupation": "Author",
"contact_methods": [
{
"type": "email",
"email": "abc@gmail.com"
}
],
"address_details": {
"physical_address": {
"line_1": "<string>",
"line_2": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "<string>",
"country": "<string>"
},
"mailing_address": {
"line_1": "<string>",
"line_2": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "<string>",
"country": "<string>"
},
"other_addresses": [
{
"line_1": "123 Main St.",
"city": "Denver",
"country": "US",
"line_2": "Apt 25",
"postal_code": 80014,
"state": "CO"
}
]
},
"identification_details": {
"type": "us_entity",
"identification_documents": [
{
"file_id": "file_7Tq4mR9vKx2LpW8nZc3B",
"identification_number": "X1234567",
"issuing_country": "GB",
"expiration_date": "2030-06-01"
},
{
"type": "passport",
"identification_number": "X7654321",
"issuing_country": "GB",
"expiration_date": "2031-01-15"
}
]
},
"additional_documents": [
{
"file_id": "file_X5jD8hN2sQ6yFb1Gt9Ka"
},
{
"type": "financial_statement"
}
]
},
"credit_details": [
{
"credit_report_source": "equifax",
"credit_pulled_at": "2023-11-07T05:31:56Z",
"credit_score": "<string>",
"credit_report_non_score_value": "unestablished"
}
],
"metadata": {}
}
'import requests
url = "https://api.sandbox.lead.bank/v2/entities/{id}"
payload = {
"type": "individual",
"intended_eligibility": ["account_holder"],
"risk_score": "low",
"individual_details": {
"first_name": "Lucy",
"preferred_first_name": "Lu",
"middle_name": "Reginald",
"last_name": "Collins",
"date_of_birth": "2002-02-15",
"occupation": "Author",
"contact_methods": [
{
"type": "email",
"email": "abc@gmail.com"
}
],
"address_details": {
"physical_address": {
"line_1": "<string>",
"line_2": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "<string>",
"country": "<string>"
},
"mailing_address": {
"line_1": "<string>",
"line_2": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "<string>",
"country": "<string>"
},
"other_addresses": [
{
"line_1": "123 Main St.",
"city": "Denver",
"country": "US",
"line_2": "Apt 25",
"postal_code": 80014,
"state": "CO"
}
]
},
"identification_details": {
"type": "us_entity",
"identification_documents": [
{
"file_id": "file_7Tq4mR9vKx2LpW8nZc3B",
"identification_number": "X1234567",
"issuing_country": "GB",
"expiration_date": "2030-06-01"
},
{
"type": "passport",
"identification_number": "X7654321",
"issuing_country": "GB",
"expiration_date": "2031-01-15"
}
]
},
"additional_documents": [{ "file_id": "file_X5jD8hN2sQ6yFb1Gt9Ka" }, { "type": "financial_statement" }]
},
"credit_details": [
{
"credit_report_source": "equifax",
"credit_pulled_at": "2023-11-07T05:31:56Z",
"credit_score": "<string>",
"credit_report_non_score_value": "unestablished"
}
],
"metadata": {}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: 'individual',
intended_eligibility: ['account_holder'],
risk_score: 'low',
individual_details: {
first_name: 'Lucy',
preferred_first_name: 'Lu',
middle_name: 'Reginald',
last_name: 'Collins',
date_of_birth: '2002-02-15',
occupation: 'Author',
contact_methods: [{type: 'email', email: 'abc@gmail.com'}],
address_details: {
physical_address: {
line_1: '<string>',
line_2: '<string>',
city: '<string>',
postal_code: '<string>',
state: '<string>',
country: '<string>'
},
mailing_address: {
line_1: '<string>',
line_2: '<string>',
city: '<string>',
postal_code: '<string>',
state: '<string>',
country: '<string>'
},
other_addresses: [
{
line_1: '123 Main St.',
city: 'Denver',
country: 'US',
line_2: 'Apt 25',
postal_code: 80014,
state: 'CO'
}
]
},
identification_details: {
type: 'us_entity',
identification_documents: [
{
file_id: 'file_7Tq4mR9vKx2LpW8nZc3B',
identification_number: 'X1234567',
issuing_country: 'GB',
expiration_date: '2030-06-01'
},
{
type: 'passport',
identification_number: 'X7654321',
issuing_country: 'GB',
expiration_date: '2031-01-15'
}
]
},
additional_documents: [{file_id: 'file_X5jD8hN2sQ6yFb1Gt9Ka'}, {type: 'financial_statement'}]
},
credit_details: [
{
credit_report_source: 'equifax',
credit_pulled_at: '2023-11-07T05:31:56Z',
credit_score: '<string>',
credit_report_non_score_value: 'unestablished'
}
],
metadata: {}
})
};
fetch('https://api.sandbox.lead.bank/v2/entities/{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.lead.bank/v2/entities/{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([
'type' => 'individual',
'intended_eligibility' => [
'account_holder'
],
'risk_score' => 'low',
'individual_details' => [
'first_name' => 'Lucy',
'preferred_first_name' => 'Lu',
'middle_name' => 'Reginald',
'last_name' => 'Collins',
'date_of_birth' => '2002-02-15',
'occupation' => 'Author',
'contact_methods' => [
[
'type' => 'email',
'email' => 'abc@gmail.com'
]
],
'address_details' => [
'physical_address' => [
'line_1' => '<string>',
'line_2' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'state' => '<string>',
'country' => '<string>'
],
'mailing_address' => [
'line_1' => '<string>',
'line_2' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'state' => '<string>',
'country' => '<string>'
],
'other_addresses' => [
[
'line_1' => '123 Main St.',
'city' => 'Denver',
'country' => 'US',
'line_2' => 'Apt 25',
'postal_code' => 80014,
'state' => 'CO'
]
]
],
'identification_details' => [
'type' => 'us_entity',
'identification_documents' => [
[
'file_id' => 'file_7Tq4mR9vKx2LpW8nZc3B',
'identification_number' => 'X1234567',
'issuing_country' => 'GB',
'expiration_date' => '2030-06-01'
],
[
'type' => 'passport',
'identification_number' => 'X7654321',
'issuing_country' => 'GB',
'expiration_date' => '2031-01-15'
]
]
],
'additional_documents' => [
[
'file_id' => 'file_X5jD8hN2sQ6yFb1Gt9Ka'
],
[
'type' => 'financial_statement'
]
]
],
'credit_details' => [
[
'credit_report_source' => 'equifax',
'credit_pulled_at' => '2023-11-07T05:31:56Z',
'credit_score' => '<string>',
'credit_report_non_score_value' => 'unestablished'
]
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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.lead.bank/v2/entities/{id}"
payload := strings.NewReader("{\n \"type\": \"individual\",\n \"intended_eligibility\": [\n \"account_holder\"\n ],\n \"risk_score\": \"low\",\n \"individual_details\": {\n \"first_name\": \"Lucy\",\n \"preferred_first_name\": \"Lu\",\n \"middle_name\": \"Reginald\",\n \"last_name\": \"Collins\",\n \"date_of_birth\": \"2002-02-15\",\n \"occupation\": \"Author\",\n \"contact_methods\": [\n {\n \"type\": \"email\",\n \"email\": \"abc@gmail.com\"\n }\n ],\n \"address_details\": {\n \"physical_address\": {\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"mailing_address\": {\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"other_addresses\": [\n {\n \"line_1\": \"123 Main St.\",\n \"city\": \"Denver\",\n \"country\": \"US\",\n \"line_2\": \"Apt 25\",\n \"postal_code\": 80014,\n \"state\": \"CO\"\n }\n ]\n },\n \"identification_details\": {\n \"type\": \"us_entity\",\n \"identification_documents\": [\n {\n \"file_id\": \"file_7Tq4mR9vKx2LpW8nZc3B\",\n \"identification_number\": \"X1234567\",\n \"issuing_country\": \"GB\",\n \"expiration_date\": \"2030-06-01\"\n },\n {\n \"type\": \"passport\",\n \"identification_number\": \"X7654321\",\n \"issuing_country\": \"GB\",\n \"expiration_date\": \"2031-01-15\"\n }\n ]\n },\n \"additional_documents\": [\n {\n \"file_id\": \"file_X5jD8hN2sQ6yFb1Gt9Ka\"\n },\n {\n \"type\": \"financial_statement\"\n }\n ]\n },\n \"credit_details\": [\n {\n \"credit_report_source\": \"equifax\",\n \"credit_pulled_at\": \"2023-11-07T05:31:56Z\",\n \"credit_score\": \"<string>\",\n \"credit_report_non_score_value\": \"unestablished\"\n }\n ],\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.lead.bank/v2/entities/{id}")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"individual\",\n \"intended_eligibility\": [\n \"account_holder\"\n ],\n \"risk_score\": \"low\",\n \"individual_details\": {\n \"first_name\": \"Lucy\",\n \"preferred_first_name\": \"Lu\",\n \"middle_name\": \"Reginald\",\n \"last_name\": \"Collins\",\n \"date_of_birth\": \"2002-02-15\",\n \"occupation\": \"Author\",\n \"contact_methods\": [\n {\n \"type\": \"email\",\n \"email\": \"abc@gmail.com\"\n }\n ],\n \"address_details\": {\n \"physical_address\": {\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"mailing_address\": {\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"other_addresses\": [\n {\n \"line_1\": \"123 Main St.\",\n \"city\": \"Denver\",\n \"country\": \"US\",\n \"line_2\": \"Apt 25\",\n \"postal_code\": 80014,\n \"state\": \"CO\"\n }\n ]\n },\n \"identification_details\": {\n \"type\": \"us_entity\",\n \"identification_documents\": [\n {\n \"file_id\": \"file_7Tq4mR9vKx2LpW8nZc3B\",\n \"identification_number\": \"X1234567\",\n \"issuing_country\": \"GB\",\n \"expiration_date\": \"2030-06-01\"\n },\n {\n \"type\": \"passport\",\n \"identification_number\": \"X7654321\",\n \"issuing_country\": \"GB\",\n \"expiration_date\": \"2031-01-15\"\n }\n ]\n },\n \"additional_documents\": [\n {\n \"file_id\": \"file_X5jD8hN2sQ6yFb1Gt9Ka\"\n },\n {\n \"type\": \"financial_statement\"\n }\n ]\n },\n \"credit_details\": [\n {\n \"credit_report_source\": \"equifax\",\n \"credit_pulled_at\": \"2023-11-07T05:31:56Z\",\n \"credit_score\": \"<string>\",\n \"credit_report_non_score_value\": \"unestablished\"\n }\n ],\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.lead.bank/v2/entities/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"individual\",\n \"intended_eligibility\": [\n \"account_holder\"\n ],\n \"risk_score\": \"low\",\n \"individual_details\": {\n \"first_name\": \"Lucy\",\n \"preferred_first_name\": \"Lu\",\n \"middle_name\": \"Reginald\",\n \"last_name\": \"Collins\",\n \"date_of_birth\": \"2002-02-15\",\n \"occupation\": \"Author\",\n \"contact_methods\": [\n {\n \"type\": \"email\",\n \"email\": \"abc@gmail.com\"\n }\n ],\n \"address_details\": {\n \"physical_address\": {\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"mailing_address\": {\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"other_addresses\": [\n {\n \"line_1\": \"123 Main St.\",\n \"city\": \"Denver\",\n \"country\": \"US\",\n \"line_2\": \"Apt 25\",\n \"postal_code\": 80014,\n \"state\": \"CO\"\n }\n ]\n },\n \"identification_details\": {\n \"type\": \"us_entity\",\n \"identification_documents\": [\n {\n \"file_id\": \"file_7Tq4mR9vKx2LpW8nZc3B\",\n \"identification_number\": \"X1234567\",\n \"issuing_country\": \"GB\",\n \"expiration_date\": \"2030-06-01\"\n },\n {\n \"type\": \"passport\",\n \"identification_number\": \"X7654321\",\n \"issuing_country\": \"GB\",\n \"expiration_date\": \"2031-01-15\"\n }\n ]\n },\n \"additional_documents\": [\n {\n \"file_id\": \"file_X5jD8hN2sQ6yFb1Gt9Ka\"\n },\n {\n \"type\": \"financial_statement\"\n }\n ]\n },\n \"credit_details\": [\n {\n \"credit_report_source\": \"equifax\",\n \"credit_pulled_at\": \"2023-11-07T05:31:56Z\",\n \"credit_score\": \"<string>\",\n \"credit_report_non_score_value\": \"unestablished\"\n }\n ],\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "entity_xyz123",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"type": "individual",
"individual_details": {
"first_name": "<string>",
"last_name": "<string>",
"identification_details": {
"type": "us_entity",
"tax_identification": {
"type": "ssn",
"value": "<string>"
},
"identification_documents": [
{
"file_id": "file_7Tq4mR9vKx2LpW8nZc3B",
"identification_number": "X1234567",
"issuing_country": "GB",
"expiration_date": "2030-06-01"
},
{
"type": "passport",
"identification_number": "X7654321",
"issuing_country": "GB",
"expiration_date": "2031-01-15"
}
],
"legacy_identification_documents": [
{
"client_document_id": "passport_jane_doe.pdf",
"type": "passport",
"identification_number": "X1234567",
"issuing_country": "GB",
"expiration_date": "2026-06-01"
}
]
},
"preferred_first_name": "<string>",
"middle_name": "<string>",
"date_of_birth": "2002-02-15",
"occupation": "<string>",
"contact_methods": [
{
"type": "email",
"email": "abc@gmail.com"
}
],
"address_details": {
"physical_address": {
"line_1": "123 Main St.",
"city": "Denver",
"country": "US",
"line_2": "Apt 25",
"postal_code": 80014,
"state": "CO"
},
"mailing_address": {
"line_1": "123 Main St.",
"city": "Denver",
"country": "US",
"line_2": "Apt 25",
"postal_code": 80014,
"state": "CO"
},
"other_addresses": [
{
"line_1": "123 Main St.",
"city": "Denver",
"country": "US",
"line_2": "Apt 25",
"postal_code": 80014,
"state": "CO"
}
]
},
"additional_documents": [
{
"file_id": "file_X5jD8hN2sQ6yFb1Gt9Ka"
},
{
"type": "financial_statement"
}
],
"legacy_additional_documents": [
{
"client_document_id": "2026_01_02_statement",
"type": "bank_statement",
"description": "Bank statement for January"
}
]
},
"eligibility": {
"account_holder": {
"status": "eligible",
"failed_checks": []
},
"minor_account_holder": {
"status": "ineligible",
"failed_checks": [
{
"check": "check_date_of_birth_above_maximum",
"entity_id": "entity_xyz123",
"reason": "The entity exceeds the maximum age for minor_account_holder."
}
]
},
"authorized_signer": {
"status": "eligible",
"failed_checks": []
},
"authorized_user": {
"status": "eligible",
"failed_checks": []
}
},
"client_customer_id": "<string>",
"risk_score": "low",
"rfi_details": {
"result": "completed",
"requested_at": "2023-11-07T05:31:56Z"
},
"ofac_details": {
"result": "passed",
"screened_at": "2023-11-07T05:31:56Z"
},
"kyc_details": {
"result": "passed",
"screened_at": "2023-11-07T05:31:56Z"
},
"credit_details": [
{
"credit_report_source": "equifax",
"credit_pulled_at": "2023-11-07T05:31:56Z",
"credit_score": "<string>",
"credit_report_non_score_value": "unestablished"
}
],
"intended_eligibility": [
"account_holder"
],
"metadata": {}
}{
"code": "request_malformed",
"message": "The request is invalid and cannot be parsed by the server.",
"errors": [
{
"code": "body_malformed",
"message": "The request body is missing or isn't JSON."
}
]
}{
"code": "token_invalid",
"message": "The bearer token is missing, expired, malformed, or invalid."
}{
"code": "object_not_found",
"message": "No object exists at the requested ID, or it is not visible to this caller."
}{
"code": "idempotency_key_in_use",
"message": "A concurrent request using this Idempotency-Key is still in flight."
}{
"code": "parameters_invalid",
"message": "One or more parameters are invalid.",
"errors": [
{
"code": "check_date_of_birth",
"message": "entity_xyz123 is not eligible for account_holder. The entity must be 18 or older.",
"parameters": [
"intended_eligibility"
]
}
]
}{
"code": "rate_limit_exceeded",
"message": "You have exceeded the rate limit for this endpoint. Retry with backoff."
}{
"code": "internal_server_error",
"message": "Something went wrong on our end. Contact Lead with the Request-Id if this persists."
}{
"code": "service_unavailable",
"message": "The service is temporarily unavailable. Retry after the indicated delay."
}{
"code": "gateway_timeout",
"message": "An upstream system timed out. Retry with backoff."
}Update an Entity
Update an individual, business, or sole_prop Entity. Some changes need a fresh KYC attestation. See Create and update for which changes need one and how PATCH handles each field.
curl --request PATCH \
--url https://api.sandbox.lead.bank/v2/entities/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"type": "individual",
"intended_eligibility": [
"account_holder"
],
"risk_score": "low",
"individual_details": {
"first_name": "Lucy",
"preferred_first_name": "Lu",
"middle_name": "Reginald",
"last_name": "Collins",
"date_of_birth": "2002-02-15",
"occupation": "Author",
"contact_methods": [
{
"type": "email",
"email": "abc@gmail.com"
}
],
"address_details": {
"physical_address": {
"line_1": "<string>",
"line_2": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "<string>",
"country": "<string>"
},
"mailing_address": {
"line_1": "<string>",
"line_2": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "<string>",
"country": "<string>"
},
"other_addresses": [
{
"line_1": "123 Main St.",
"city": "Denver",
"country": "US",
"line_2": "Apt 25",
"postal_code": 80014,
"state": "CO"
}
]
},
"identification_details": {
"type": "us_entity",
"identification_documents": [
{
"file_id": "file_7Tq4mR9vKx2LpW8nZc3B",
"identification_number": "X1234567",
"issuing_country": "GB",
"expiration_date": "2030-06-01"
},
{
"type": "passport",
"identification_number": "X7654321",
"issuing_country": "GB",
"expiration_date": "2031-01-15"
}
]
},
"additional_documents": [
{
"file_id": "file_X5jD8hN2sQ6yFb1Gt9Ka"
},
{
"type": "financial_statement"
}
]
},
"credit_details": [
{
"credit_report_source": "equifax",
"credit_pulled_at": "2023-11-07T05:31:56Z",
"credit_score": "<string>",
"credit_report_non_score_value": "unestablished"
}
],
"metadata": {}
}
'import requests
url = "https://api.sandbox.lead.bank/v2/entities/{id}"
payload = {
"type": "individual",
"intended_eligibility": ["account_holder"],
"risk_score": "low",
"individual_details": {
"first_name": "Lucy",
"preferred_first_name": "Lu",
"middle_name": "Reginald",
"last_name": "Collins",
"date_of_birth": "2002-02-15",
"occupation": "Author",
"contact_methods": [
{
"type": "email",
"email": "abc@gmail.com"
}
],
"address_details": {
"physical_address": {
"line_1": "<string>",
"line_2": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "<string>",
"country": "<string>"
},
"mailing_address": {
"line_1": "<string>",
"line_2": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "<string>",
"country": "<string>"
},
"other_addresses": [
{
"line_1": "123 Main St.",
"city": "Denver",
"country": "US",
"line_2": "Apt 25",
"postal_code": 80014,
"state": "CO"
}
]
},
"identification_details": {
"type": "us_entity",
"identification_documents": [
{
"file_id": "file_7Tq4mR9vKx2LpW8nZc3B",
"identification_number": "X1234567",
"issuing_country": "GB",
"expiration_date": "2030-06-01"
},
{
"type": "passport",
"identification_number": "X7654321",
"issuing_country": "GB",
"expiration_date": "2031-01-15"
}
]
},
"additional_documents": [{ "file_id": "file_X5jD8hN2sQ6yFb1Gt9Ka" }, { "type": "financial_statement" }]
},
"credit_details": [
{
"credit_report_source": "equifax",
"credit_pulled_at": "2023-11-07T05:31:56Z",
"credit_score": "<string>",
"credit_report_non_score_value": "unestablished"
}
],
"metadata": {}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: 'individual',
intended_eligibility: ['account_holder'],
risk_score: 'low',
individual_details: {
first_name: 'Lucy',
preferred_first_name: 'Lu',
middle_name: 'Reginald',
last_name: 'Collins',
date_of_birth: '2002-02-15',
occupation: 'Author',
contact_methods: [{type: 'email', email: 'abc@gmail.com'}],
address_details: {
physical_address: {
line_1: '<string>',
line_2: '<string>',
city: '<string>',
postal_code: '<string>',
state: '<string>',
country: '<string>'
},
mailing_address: {
line_1: '<string>',
line_2: '<string>',
city: '<string>',
postal_code: '<string>',
state: '<string>',
country: '<string>'
},
other_addresses: [
{
line_1: '123 Main St.',
city: 'Denver',
country: 'US',
line_2: 'Apt 25',
postal_code: 80014,
state: 'CO'
}
]
},
identification_details: {
type: 'us_entity',
identification_documents: [
{
file_id: 'file_7Tq4mR9vKx2LpW8nZc3B',
identification_number: 'X1234567',
issuing_country: 'GB',
expiration_date: '2030-06-01'
},
{
type: 'passport',
identification_number: 'X7654321',
issuing_country: 'GB',
expiration_date: '2031-01-15'
}
]
},
additional_documents: [{file_id: 'file_X5jD8hN2sQ6yFb1Gt9Ka'}, {type: 'financial_statement'}]
},
credit_details: [
{
credit_report_source: 'equifax',
credit_pulled_at: '2023-11-07T05:31:56Z',
credit_score: '<string>',
credit_report_non_score_value: 'unestablished'
}
],
metadata: {}
})
};
fetch('https://api.sandbox.lead.bank/v2/entities/{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.lead.bank/v2/entities/{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([
'type' => 'individual',
'intended_eligibility' => [
'account_holder'
],
'risk_score' => 'low',
'individual_details' => [
'first_name' => 'Lucy',
'preferred_first_name' => 'Lu',
'middle_name' => 'Reginald',
'last_name' => 'Collins',
'date_of_birth' => '2002-02-15',
'occupation' => 'Author',
'contact_methods' => [
[
'type' => 'email',
'email' => 'abc@gmail.com'
]
],
'address_details' => [
'physical_address' => [
'line_1' => '<string>',
'line_2' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'state' => '<string>',
'country' => '<string>'
],
'mailing_address' => [
'line_1' => '<string>',
'line_2' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'state' => '<string>',
'country' => '<string>'
],
'other_addresses' => [
[
'line_1' => '123 Main St.',
'city' => 'Denver',
'country' => 'US',
'line_2' => 'Apt 25',
'postal_code' => 80014,
'state' => 'CO'
]
]
],
'identification_details' => [
'type' => 'us_entity',
'identification_documents' => [
[
'file_id' => 'file_7Tq4mR9vKx2LpW8nZc3B',
'identification_number' => 'X1234567',
'issuing_country' => 'GB',
'expiration_date' => '2030-06-01'
],
[
'type' => 'passport',
'identification_number' => 'X7654321',
'issuing_country' => 'GB',
'expiration_date' => '2031-01-15'
]
]
],
'additional_documents' => [
[
'file_id' => 'file_X5jD8hN2sQ6yFb1Gt9Ka'
],
[
'type' => 'financial_statement'
]
]
],
'credit_details' => [
[
'credit_report_source' => 'equifax',
'credit_pulled_at' => '2023-11-07T05:31:56Z',
'credit_score' => '<string>',
'credit_report_non_score_value' => 'unestablished'
]
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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.lead.bank/v2/entities/{id}"
payload := strings.NewReader("{\n \"type\": \"individual\",\n \"intended_eligibility\": [\n \"account_holder\"\n ],\n \"risk_score\": \"low\",\n \"individual_details\": {\n \"first_name\": \"Lucy\",\n \"preferred_first_name\": \"Lu\",\n \"middle_name\": \"Reginald\",\n \"last_name\": \"Collins\",\n \"date_of_birth\": \"2002-02-15\",\n \"occupation\": \"Author\",\n \"contact_methods\": [\n {\n \"type\": \"email\",\n \"email\": \"abc@gmail.com\"\n }\n ],\n \"address_details\": {\n \"physical_address\": {\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"mailing_address\": {\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"other_addresses\": [\n {\n \"line_1\": \"123 Main St.\",\n \"city\": \"Denver\",\n \"country\": \"US\",\n \"line_2\": \"Apt 25\",\n \"postal_code\": 80014,\n \"state\": \"CO\"\n }\n ]\n },\n \"identification_details\": {\n \"type\": \"us_entity\",\n \"identification_documents\": [\n {\n \"file_id\": \"file_7Tq4mR9vKx2LpW8nZc3B\",\n \"identification_number\": \"X1234567\",\n \"issuing_country\": \"GB\",\n \"expiration_date\": \"2030-06-01\"\n },\n {\n \"type\": \"passport\",\n \"identification_number\": \"X7654321\",\n \"issuing_country\": \"GB\",\n \"expiration_date\": \"2031-01-15\"\n }\n ]\n },\n \"additional_documents\": [\n {\n \"file_id\": \"file_X5jD8hN2sQ6yFb1Gt9Ka\"\n },\n {\n \"type\": \"financial_statement\"\n }\n ]\n },\n \"credit_details\": [\n {\n \"credit_report_source\": \"equifax\",\n \"credit_pulled_at\": \"2023-11-07T05:31:56Z\",\n \"credit_score\": \"<string>\",\n \"credit_report_non_score_value\": \"unestablished\"\n }\n ],\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.lead.bank/v2/entities/{id}")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"individual\",\n \"intended_eligibility\": [\n \"account_holder\"\n ],\n \"risk_score\": \"low\",\n \"individual_details\": {\n \"first_name\": \"Lucy\",\n \"preferred_first_name\": \"Lu\",\n \"middle_name\": \"Reginald\",\n \"last_name\": \"Collins\",\n \"date_of_birth\": \"2002-02-15\",\n \"occupation\": \"Author\",\n \"contact_methods\": [\n {\n \"type\": \"email\",\n \"email\": \"abc@gmail.com\"\n }\n ],\n \"address_details\": {\n \"physical_address\": {\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"mailing_address\": {\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"other_addresses\": [\n {\n \"line_1\": \"123 Main St.\",\n \"city\": \"Denver\",\n \"country\": \"US\",\n \"line_2\": \"Apt 25\",\n \"postal_code\": 80014,\n \"state\": \"CO\"\n }\n ]\n },\n \"identification_details\": {\n \"type\": \"us_entity\",\n \"identification_documents\": [\n {\n \"file_id\": \"file_7Tq4mR9vKx2LpW8nZc3B\",\n \"identification_number\": \"X1234567\",\n \"issuing_country\": \"GB\",\n \"expiration_date\": \"2030-06-01\"\n },\n {\n \"type\": \"passport\",\n \"identification_number\": \"X7654321\",\n \"issuing_country\": \"GB\",\n \"expiration_date\": \"2031-01-15\"\n }\n ]\n },\n \"additional_documents\": [\n {\n \"file_id\": \"file_X5jD8hN2sQ6yFb1Gt9Ka\"\n },\n {\n \"type\": \"financial_statement\"\n }\n ]\n },\n \"credit_details\": [\n {\n \"credit_report_source\": \"equifax\",\n \"credit_pulled_at\": \"2023-11-07T05:31:56Z\",\n \"credit_score\": \"<string>\",\n \"credit_report_non_score_value\": \"unestablished\"\n }\n ],\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.lead.bank/v2/entities/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"individual\",\n \"intended_eligibility\": [\n \"account_holder\"\n ],\n \"risk_score\": \"low\",\n \"individual_details\": {\n \"first_name\": \"Lucy\",\n \"preferred_first_name\": \"Lu\",\n \"middle_name\": \"Reginald\",\n \"last_name\": \"Collins\",\n \"date_of_birth\": \"2002-02-15\",\n \"occupation\": \"Author\",\n \"contact_methods\": [\n {\n \"type\": \"email\",\n \"email\": \"abc@gmail.com\"\n }\n ],\n \"address_details\": {\n \"physical_address\": {\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"mailing_address\": {\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"other_addresses\": [\n {\n \"line_1\": \"123 Main St.\",\n \"city\": \"Denver\",\n \"country\": \"US\",\n \"line_2\": \"Apt 25\",\n \"postal_code\": 80014,\n \"state\": \"CO\"\n }\n ]\n },\n \"identification_details\": {\n \"type\": \"us_entity\",\n \"identification_documents\": [\n {\n \"file_id\": \"file_7Tq4mR9vKx2LpW8nZc3B\",\n \"identification_number\": \"X1234567\",\n \"issuing_country\": \"GB\",\n \"expiration_date\": \"2030-06-01\"\n },\n {\n \"type\": \"passport\",\n \"identification_number\": \"X7654321\",\n \"issuing_country\": \"GB\",\n \"expiration_date\": \"2031-01-15\"\n }\n ]\n },\n \"additional_documents\": [\n {\n \"file_id\": \"file_X5jD8hN2sQ6yFb1Gt9Ka\"\n },\n {\n \"type\": \"financial_statement\"\n }\n ]\n },\n \"credit_details\": [\n {\n \"credit_report_source\": \"equifax\",\n \"credit_pulled_at\": \"2023-11-07T05:31:56Z\",\n \"credit_score\": \"<string>\",\n \"credit_report_non_score_value\": \"unestablished\"\n }\n ],\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "entity_xyz123",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"type": "individual",
"individual_details": {
"first_name": "<string>",
"last_name": "<string>",
"identification_details": {
"type": "us_entity",
"tax_identification": {
"type": "ssn",
"value": "<string>"
},
"identification_documents": [
{
"file_id": "file_7Tq4mR9vKx2LpW8nZc3B",
"identification_number": "X1234567",
"issuing_country": "GB",
"expiration_date": "2030-06-01"
},
{
"type": "passport",
"identification_number": "X7654321",
"issuing_country": "GB",
"expiration_date": "2031-01-15"
}
],
"legacy_identification_documents": [
{
"client_document_id": "passport_jane_doe.pdf",
"type": "passport",
"identification_number": "X1234567",
"issuing_country": "GB",
"expiration_date": "2026-06-01"
}
]
},
"preferred_first_name": "<string>",
"middle_name": "<string>",
"date_of_birth": "2002-02-15",
"occupation": "<string>",
"contact_methods": [
{
"type": "email",
"email": "abc@gmail.com"
}
],
"address_details": {
"physical_address": {
"line_1": "123 Main St.",
"city": "Denver",
"country": "US",
"line_2": "Apt 25",
"postal_code": 80014,
"state": "CO"
},
"mailing_address": {
"line_1": "123 Main St.",
"city": "Denver",
"country": "US",
"line_2": "Apt 25",
"postal_code": 80014,
"state": "CO"
},
"other_addresses": [
{
"line_1": "123 Main St.",
"city": "Denver",
"country": "US",
"line_2": "Apt 25",
"postal_code": 80014,
"state": "CO"
}
]
},
"additional_documents": [
{
"file_id": "file_X5jD8hN2sQ6yFb1Gt9Ka"
},
{
"type": "financial_statement"
}
],
"legacy_additional_documents": [
{
"client_document_id": "2026_01_02_statement",
"type": "bank_statement",
"description": "Bank statement for January"
}
]
},
"eligibility": {
"account_holder": {
"status": "eligible",
"failed_checks": []
},
"minor_account_holder": {
"status": "ineligible",
"failed_checks": [
{
"check": "check_date_of_birth_above_maximum",
"entity_id": "entity_xyz123",
"reason": "The entity exceeds the maximum age for minor_account_holder."
}
]
},
"authorized_signer": {
"status": "eligible",
"failed_checks": []
},
"authorized_user": {
"status": "eligible",
"failed_checks": []
}
},
"client_customer_id": "<string>",
"risk_score": "low",
"rfi_details": {
"result": "completed",
"requested_at": "2023-11-07T05:31:56Z"
},
"ofac_details": {
"result": "passed",
"screened_at": "2023-11-07T05:31:56Z"
},
"kyc_details": {
"result": "passed",
"screened_at": "2023-11-07T05:31:56Z"
},
"credit_details": [
{
"credit_report_source": "equifax",
"credit_pulled_at": "2023-11-07T05:31:56Z",
"credit_score": "<string>",
"credit_report_non_score_value": "unestablished"
}
],
"intended_eligibility": [
"account_holder"
],
"metadata": {}
}{
"code": "request_malformed",
"message": "The request is invalid and cannot be parsed by the server.",
"errors": [
{
"code": "body_malformed",
"message": "The request body is missing or isn't JSON."
}
]
}{
"code": "token_invalid",
"message": "The bearer token is missing, expired, malformed, or invalid."
}{
"code": "object_not_found",
"message": "No object exists at the requested ID, or it is not visible to this caller."
}{
"code": "idempotency_key_in_use",
"message": "A concurrent request using this Idempotency-Key is still in flight."
}{
"code": "parameters_invalid",
"message": "One or more parameters are invalid.",
"errors": [
{
"code": "check_date_of_birth",
"message": "entity_xyz123 is not eligible for account_holder. The entity must be 18 or older.",
"parameters": [
"intended_eligibility"
]
}
]
}{
"code": "rate_limit_exceeded",
"message": "You have exceeded the rate limit for this endpoint. Retry with backoff."
}{
"code": "internal_server_error",
"message": "Something went wrong on our end. Contact Lead with the Request-Id if this persists."
}{
"code": "service_unavailable",
"message": "The service is temporarily unavailable. Retry after the indicated delay."
}{
"code": "gateway_timeout",
"message": "An upstream system timed out. Retry with backoff."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
A unique key for this request, up to 255 characters. Retrying with the same key and body returns the original response without applying the update twice. See Idempotency.
255Path Parameters
The ID of your entity.
^entity_[^\s]{1,33}$"entity_xyz123"
Body
- Individual
- Business
- Sole Prop
Lead ignores fields not listed here.
Type of entity = individual.
^individual$The relationship types you intend this entity to hold. When you send it, Lead checks the entity's data against every listed type and rejects the request with 422 parameters_invalid if any fails. The check is all or nothing, and the error returns every failing check, not just the first. Listing fewer types than the entity qualifies for still succeeds, and eligibility shows everything it qualifies for.
If the check passes, Lead saves the list and returns it on the entity. On a PATCH, Lead checks the entity as it would be after the update, against the list you send or, if you leave the field out, the saved list. Send an empty array to clear the saved list; no check runs.
A relationship type an entity can hold.
account_holder: Full control of, and legal responsibility for, the account.minor_account_holder: An individual aged 16 or 17 with account holder eligibility.authorized_signer: An individual allowed to sign on behalf of the account holder, without legal responsibility.authorized_user: An individual with restricted access to the account, without legal responsibility.
account_holder, minor_account_holder, authorized_signer, authorized_user ["account_holder"]
The entity's risk score, mapped to Lead by the client. Client should have provided risk score mapping to Lead.
low, medium, high "low"
Details for the individual entity.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Details on OFAC on the entity.
Show child attributes
Show child attributes
Details on KYC on the entity.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
A set of key-value pairs that can be used to store additional information related to this object.
Show child attributes
Show child attributes
Response
Entity object updated.
- Individual
- Business
- Sole Prop
Unique ID for the Entity object.
^entity_[^\s]{1,33}$"entity_xyz123"
Timestamp at which the entity object is created.
Timestamp at which the entity object was last updated.
Type of entity = individual.
^individual$Details for the individual entity. An authorized_user requires only first_name, last_name, a contact method, and identification_details.type. Other relationship types require more; see Eligibility.
Show child attributes
Show child attributes
Whether the entity's current data qualifies it for each relationship type, with the failing checks. Response only. Lead computes it from current data on every read and never stores it. All four keys are always present. On a program that does not offer minor account holders, minor_account_holder is ineligible for every entity.
Show child attributes
Show child attributes
{
"account_holder": { "status": "eligible", "failed_checks": [] },
"minor_account_holder": {
"status": "ineligible",
"failed_checks": [
{
"check": "check_date_of_birth_above_maximum",
"entity_id": "entity_xyz123",
"reason": "The entity exceeds the maximum age for minor_account_holder."
}
]
},
"authorized_signer": { "status": "eligible", "failed_checks": [] },
"authorized_user": { "status": "eligible", "failed_checks": [] }
}
Your customer ID, on entities created on v0 or through Entity files. Response only. Lead ignores it if sent, and does not return it on other entities.
The entity's risk score, mapped to Lead by the client. Client should have provided risk score mapping to Lead.
low, medium, high "low"
Show child attributes
Show child attributes
Details on OFAC on the entity.
Show child attributes
Show child attributes
Details on KYC on the entity.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The relationship types you intend this entity to hold. When you send it, Lead checks the entity's data against every listed type and rejects the request with 422 parameters_invalid if any fails. The check is all or nothing, and the error returns every failing check, not just the first. Listing fewer types than the entity qualifies for still succeeds, and eligibility shows everything it qualifies for.
If the check passes, Lead saves the list and returns it on the entity. On a PATCH, Lead checks the entity as it would be after the update, against the list you send or, if you leave the field out, the saved list. Send an empty array to clear the saved list; no check runs.
A relationship type an entity can hold.
account_holder: Full control of, and legal responsibility for, the account.minor_account_holder: An individual aged 16 or 17 with account holder eligibility.authorized_signer: An individual allowed to sign on behalf of the account holder, without legal responsibility.authorized_user: An individual with restricted access to the account, without legal responsibility.
account_holder, minor_account_holder, authorized_signer, authorized_user ["account_holder"]
A set of key-value pairs that can be used to store additional information related to this object.
Show child attributes
Show child attributes
Was this page helpful?

