Batch create account entity relationships
curl --request POST \
--url https://api.sandbox.lead.bank/v0/accounts/{id}/entity_relationships/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"entity_ids": [
"entity_8kL9jH7gF6dS5aQ4wE3rT2yU1iO",
"entity_2mN3bV4cX5zL6kwdJ7hG8fD9sA0",
"entity_1qW2eR3tY4uI5oP6aS7dF8gH9jK",
"entity_9pLuO8iK7yJ6hT5gR4fE3dD2sS1",
"entity_5zX4cV3bN2m1qW0eR9tY8uI7oP6"
],
"relationship_type": "authorized_user"
}
'import requests
url = "https://api.sandbox.lead.bank/v0/accounts/{id}/entity_relationships/batch"
payload = {
"entity_ids": ["entity_8kL9jH7gF6dS5aQ4wE3rT2yU1iO", "entity_2mN3bV4cX5zL6kwdJ7hG8fD9sA0", "entity_1qW2eR3tY4uI5oP6aS7dF8gH9jK", "entity_9pLuO8iK7yJ6hT5gR4fE3dD2sS1", "entity_5zX4cV3bN2m1qW0eR9tY8uI7oP6"],
"relationship_type": "authorized_user"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
entity_ids: [
'entity_8kL9jH7gF6dS5aQ4wE3rT2yU1iO',
'entity_2mN3bV4cX5zL6kwdJ7hG8fD9sA0',
'entity_1qW2eR3tY4uI5oP6aS7dF8gH9jK',
'entity_9pLuO8iK7yJ6hT5gR4fE3dD2sS1',
'entity_5zX4cV3bN2m1qW0eR9tY8uI7oP6'
],
relationship_type: 'authorized_user'
})
};
fetch('https://api.sandbox.lead.bank/v0/accounts/{id}/entity_relationships/batch', 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/v0/accounts/{id}/entity_relationships/batch",
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([
'entity_ids' => [
'entity_8kL9jH7gF6dS5aQ4wE3rT2yU1iO',
'entity_2mN3bV4cX5zL6kwdJ7hG8fD9sA0',
'entity_1qW2eR3tY4uI5oP6aS7dF8gH9jK',
'entity_9pLuO8iK7yJ6hT5gR4fE3dD2sS1',
'entity_5zX4cV3bN2m1qW0eR9tY8uI7oP6'
],
'relationship_type' => 'authorized_user'
]),
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/v0/accounts/{id}/entity_relationships/batch"
payload := strings.NewReader("{\n \"entity_ids\": [\n \"entity_8kL9jH7gF6dS5aQ4wE3rT2yU1iO\",\n \"entity_2mN3bV4cX5zL6kwdJ7hG8fD9sA0\",\n \"entity_1qW2eR3tY4uI5oP6aS7dF8gH9jK\",\n \"entity_9pLuO8iK7yJ6hT5gR4fE3dD2sS1\",\n \"entity_5zX4cV3bN2m1qW0eR9tY8uI7oP6\"\n ],\n \"relationship_type\": \"authorized_user\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.sandbox.lead.bank/v0/accounts/{id}/entity_relationships/batch")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entity_ids\": [\n \"entity_8kL9jH7gF6dS5aQ4wE3rT2yU1iO\",\n \"entity_2mN3bV4cX5zL6kwdJ7hG8fD9sA0\",\n \"entity_1qW2eR3tY4uI5oP6aS7dF8gH9jK\",\n \"entity_9pLuO8iK7yJ6hT5gR4fE3dD2sS1\",\n \"entity_5zX4cV3bN2m1qW0eR9tY8uI7oP6\"\n ],\n \"relationship_type\": \"authorized_user\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.lead.bank/v0/accounts/{id}/entity_relationships/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entity_ids\": [\n \"entity_8kL9jH7gF6dS5aQ4wE3rT2yU1iO\",\n \"entity_2mN3bV4cX5zL6kwdJ7hG8fD9sA0\",\n \"entity_1qW2eR3tY4uI5oP6aS7dF8gH9jK\",\n \"entity_9pLuO8iK7yJ6hT5gR4fE3dD2sS1\",\n \"entity_5zX4cV3bN2m1qW0eR9tY8uI7oP6\"\n ],\n \"relationship_type\": \"authorized_user\"\n}"
response = http.request(request)
puts response.read_body{
"account_id": "account_9h8g7f6e5d4c3b2a1z0y9x8w7v6",
"relationship_type": "authorized_user",
"entity_ids": [
"entity_8kL9jH7gF6dS5aQ4wE3rT2yU1iO",
"entity_2mN3bV4cX5zL6kwdJ7hG8fD9sA0",
"entity_1qW2eR3tY4uI5oP6aS7dF8gH9jK",
"entity_9pLuO8iK7yJ6hT5gR4fE3dD2sS1",
"entity_5zX4cV3bN2m1qW0eR9tY8uI7oP6"
]
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}Accounts
Batch Create Account Entity Relationships
Associates multiple entities with an account under a single relationship type.
POST
/
v0
/
accounts
/
{id}
/
entity_relationships
/
batch
Batch create account entity relationships
curl --request POST \
--url https://api.sandbox.lead.bank/v0/accounts/{id}/entity_relationships/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"entity_ids": [
"entity_8kL9jH7gF6dS5aQ4wE3rT2yU1iO",
"entity_2mN3bV4cX5zL6kwdJ7hG8fD9sA0",
"entity_1qW2eR3tY4uI5oP6aS7dF8gH9jK",
"entity_9pLuO8iK7yJ6hT5gR4fE3dD2sS1",
"entity_5zX4cV3bN2m1qW0eR9tY8uI7oP6"
],
"relationship_type": "authorized_user"
}
'import requests
url = "https://api.sandbox.lead.bank/v0/accounts/{id}/entity_relationships/batch"
payload = {
"entity_ids": ["entity_8kL9jH7gF6dS5aQ4wE3rT2yU1iO", "entity_2mN3bV4cX5zL6kwdJ7hG8fD9sA0", "entity_1qW2eR3tY4uI5oP6aS7dF8gH9jK", "entity_9pLuO8iK7yJ6hT5gR4fE3dD2sS1", "entity_5zX4cV3bN2m1qW0eR9tY8uI7oP6"],
"relationship_type": "authorized_user"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
entity_ids: [
'entity_8kL9jH7gF6dS5aQ4wE3rT2yU1iO',
'entity_2mN3bV4cX5zL6kwdJ7hG8fD9sA0',
'entity_1qW2eR3tY4uI5oP6aS7dF8gH9jK',
'entity_9pLuO8iK7yJ6hT5gR4fE3dD2sS1',
'entity_5zX4cV3bN2m1qW0eR9tY8uI7oP6'
],
relationship_type: 'authorized_user'
})
};
fetch('https://api.sandbox.lead.bank/v0/accounts/{id}/entity_relationships/batch', 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/v0/accounts/{id}/entity_relationships/batch",
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([
'entity_ids' => [
'entity_8kL9jH7gF6dS5aQ4wE3rT2yU1iO',
'entity_2mN3bV4cX5zL6kwdJ7hG8fD9sA0',
'entity_1qW2eR3tY4uI5oP6aS7dF8gH9jK',
'entity_9pLuO8iK7yJ6hT5gR4fE3dD2sS1',
'entity_5zX4cV3bN2m1qW0eR9tY8uI7oP6'
],
'relationship_type' => 'authorized_user'
]),
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/v0/accounts/{id}/entity_relationships/batch"
payload := strings.NewReader("{\n \"entity_ids\": [\n \"entity_8kL9jH7gF6dS5aQ4wE3rT2yU1iO\",\n \"entity_2mN3bV4cX5zL6kwdJ7hG8fD9sA0\",\n \"entity_1qW2eR3tY4uI5oP6aS7dF8gH9jK\",\n \"entity_9pLuO8iK7yJ6hT5gR4fE3dD2sS1\",\n \"entity_5zX4cV3bN2m1qW0eR9tY8uI7oP6\"\n ],\n \"relationship_type\": \"authorized_user\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.sandbox.lead.bank/v0/accounts/{id}/entity_relationships/batch")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entity_ids\": [\n \"entity_8kL9jH7gF6dS5aQ4wE3rT2yU1iO\",\n \"entity_2mN3bV4cX5zL6kwdJ7hG8fD9sA0\",\n \"entity_1qW2eR3tY4uI5oP6aS7dF8gH9jK\",\n \"entity_9pLuO8iK7yJ6hT5gR4fE3dD2sS1\",\n \"entity_5zX4cV3bN2m1qW0eR9tY8uI7oP6\"\n ],\n \"relationship_type\": \"authorized_user\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.lead.bank/v0/accounts/{id}/entity_relationships/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entity_ids\": [\n \"entity_8kL9jH7gF6dS5aQ4wE3rT2yU1iO\",\n \"entity_2mN3bV4cX5zL6kwdJ7hG8fD9sA0\",\n \"entity_1qW2eR3tY4uI5oP6aS7dF8gH9jK\",\n \"entity_9pLuO8iK7yJ6hT5gR4fE3dD2sS1\",\n \"entity_5zX4cV3bN2m1qW0eR9tY8uI7oP6\"\n ],\n \"relationship_type\": \"authorized_user\"\n}"
response = http.request(request)
puts response.read_body{
"account_id": "account_9h8g7f6e5d4c3b2a1z0y9x8w7v6",
"relationship_type": "authorized_user",
"entity_ids": [
"entity_8kL9jH7gF6dS5aQ4wE3rT2yU1iO",
"entity_2mN3bV4cX5zL6kwdJ7hG8fD9sA0",
"entity_1qW2eR3tY4uI5oP6aS7dF8gH9jK",
"entity_9pLuO8iK7yJ6hT5gR4fE3dD2sS1",
"entity_5zX4cV3bN2m1qW0eR9tY8uI7oP6"
]
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Unique key to ensure idempotent requests
Maximum string length:
255Path Parameters
Account ID The ID of the Account object.
Pattern:
^account_\w+$Example:
"account_xyz123"
Body
application/json
Request body for batch creating entity relationships on an account.
List of entity IDs to associate with the account under the specified relationship type.
Maximum array length:
20The ID of your entity.
Pattern:
^entity_[^\s]{1,33}$Indicates the type of Entity
Available options:
account_holder, authorized_signer, authorized_user Response
Entity relationships created successfully.
The ID of the Account object.
Pattern:
^account_\w+$Example:
"account_xyz123"
Indicates the type of Entity
Available options:
account_holder, authorized_signer, authorized_user List of entity IDs associated with the account under the specified relationship type.
The ID of your entity.
Pattern:
^entity_[^\s]{1,33}$Was this page helpful?
⌘I

