Lead Bank Entity API
The Entity API from Lead Bank — 2 operation(s) for entity.
The Entity API from Lead Bank — 2 operation(s) for entity.
openapi: 3.0.1
info:
title: Lead Bank Account Number Entity API
description: Lead Bank's APIs
version: v1.0
servers:
- url: https://api.sandbox.lead.bank
- url: https://api.lead.bank
security:
- bearerAuth: []
tags:
- name: Entity
paths:
/v0/entities:
post:
tags:
- Entity
operationId: create-an-entity
summary: Create an entity
description: Create an Individual, Sole Prop or Business Entity.
parameters:
- name: Idempotency-Key
in: header
description: Idempotency key
required: true
schema:
type: string
maxLength: 255
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateAnEntityRequestBody'
responses:
'200':
description: Entity object created.
content:
application/json:
schema:
$ref: '#/components/schemas/CreateAnEntitySuccessResponse'
'400':
description: Your request parameters did not validate.
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'409':
description: An entity with the same client_customer_id already exists.
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'422':
description: We couldn't parse your request body, please check that your request body is valid JSON.
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'429':
description: Too many requests. Please slow down your request rate.
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'500':
description: Server error. Please try your request again.
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'503':
description: Service unavailable. Please try your request again.
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
get:
tags:
- Entity
operationId: retrieve-an-entity-by-client-customer-id
summary: Retrieve an entity by client customer id
description: Retrieve an entity by the client customer id
parameters:
- name: client_customer_id
in: query
required: true
description: Client Customer ID of the entity object you want to retrieve.
schema:
type: string
responses:
'200':
description: An entity object.
content:
application/json:
schema:
$ref: '#/components/schemas/RetrieveAnEntitySuccessResponse'
'400':
description: Your request parameters did not validate.
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'404':
description: id passed in doesn't correspond to an entity
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'429':
description: Too many requests. Please slow down your request rate.
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'500':
description: Server error. Please try your request again.
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'503':
description: Service unavailable. Please try your request again.
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
/v0/entities/{id}:
patch:
tags:
- Entity
operationId: Update-an-entity
summary: Update an entity
description: 'Certain updates on Entity trigger KYC re-screening, requiring an updated kyc_details.result and kyc_details.screened_at.
For individual entities, KYC re-screening is triggered by changes to: first name, last name, date of birth, tax ID (for US entities), existing identification document (for non-US entities), and switching between US vs. non-US entities.
For business and sole proprietorship entities, KYC re-screening is triggered by changes to: business name, business type, tax ID (US entities), and existing identification document (non-US entities).
Note: Business and sole proprietors cannot switch between US and non-US entities. A new entity must be created in such case.
'
parameters:
- name: id
in: path
required: true
description: Entity ID
schema:
type: string
- name: Idempotency-Key
in: header
description: Idempotency key
required: true
schema:
type: string
maxLength: 255
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateAnEntityRequestBody'
responses:
'200':
description: Entity object updated.
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateAnEntitySuccessResponse'
'400':
description: Your request parameters did not validate.
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'404':
description: id passed in doesn't correspond to an entity
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'409':
description: A request to update this entity is already in progress.
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'422':
description: We couldn't parse your request body, please check that your request body is valid JSON.
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'429':
description: Too many requests. Please slow down your request rate.
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'500':
description: Server error. Please try your request again.
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'503':
description: Service unavailable. Please try your request again.
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
get:
tags:
- Entity
operationId: retrieve-an-entity-by-entity-id
summary: Retrieve an entity by entity id
description: Retrieve an entity by entity id
parameters:
- name: id
in: path
required: true
description: Entity ID of the entity object you want to retrieve.
schema:
type: string
responses:
'200':
description: An entity object.
content:
application/json:
schema:
$ref: '#/components/schemas/RetrieveAnEntitySuccessResponse'
'400':
description: Your request parameters did not validate.
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'404':
description: id passed in doesn't correspond to an entity
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'429':
description: Too many requests. Please slow down your request rate.
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'500':
description: Server error. Please try your request again.
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'503':
description: Service unavailable. Please try your request again.
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
components:
schemas:
BusinessTypeEnum:
type: string
enum:
- corporation
- partnership
- sole_prop
- llc
- trust
- cooperative
- other
description: 'Business Types. Possible business types are `corporation`, `partnership`, `sole_prop`, `llc`, `trust`, `cooperative`, `other`.
- For business entity, cannot use `sole_prop` as business type.
- For sole_prop entity, must use `sole_prop` as business type.
'
KycDetailsResultEnum:
type: string
enum:
- pending
- passed
- failed
description: 'KYC result. Possible values: pending | passed | failed. '
BusinessDetails:
type: object
required:
- name
- identification_details
- address_details
properties:
type:
$ref: '#/components/schemas/BusinessTypeEnum'
name:
type: string
description: Legal name of the business. Must be at least 2 characters.
gross_annual_revenue:
type: string
description: Business gross revenue for prior fiscal year.
currency_code:
type: string
description: A three-letter currency code as defined in ISO 4217.
industry:
type: array
items:
type: string
description: NAICS code(s) for the applicable industries. 2-6 digits of NAICS code(s) are accepted and valid NAICS codes can be found on naics.com/search. Please refer to 2022 NAICS Reference Files.
doing_business_as:
type: string
description: Business name if the business operates under a different name.
website:
type: string
description: The website of the business. Must start with http:// or https://.
contact_methods:
type: array
items:
$ref: '#/components/schemas/ContactMethod'
address_details:
$ref: '#/components/schemas/AddressDetails'
identification_details:
$ref: '#/components/schemas/IdentificationDetailsBusiness'
additional_documents:
type: array
items:
$ref: '#/components/schemas/AdditionalDocument'
description: Details for the business entity
ContactMethodPhone:
title: Phone Number
type: object
required:
- type
- phone_number
properties:
type:
$ref: '#/components/schemas/ContactMethodTypePhone'
phone_number:
type: string
description: Primary phone number of the entity. Must follow E.123 format.
OfacDetailsResultEnum:
type: string
enum:
- pending
- passed
- failed
description: 'OFAC result. Possible values: pending | passed | failed. '
CreditDetails:
type: object
required:
- credit_score
- credit_report_source
- credit_pulled_at
properties:
credit_score:
type: string
description: Credit score given by the credit bureau. Cannot be above 999.
credit_report_source:
$ref: '#/components/schemas/CreditReportSourceEnum'
credit_pulled_at:
type: string
format: date-time
description: Date time credit is pulled at.
description: Details on credit data from credit bureaus on the entity.
UpdateAnEntityRequestBody:
oneOf:
- $ref: '#/components/schemas/UpdateAnIndividualEntityRequestBody'
- $ref: '#/components/schemas/UpdateABusinessEntityRequestBody'
- $ref: '#/components/schemas/UpdateASolePropEntityRequestBody'
discriminator:
propertyName: type
mapping:
individual: '#/components/schemas/UpdateAnIndividualEntityRequestBody'
business: '#/components/schemas/UpdateABusinessEntityRequestBody'
sole_prop: '#/components/schemas/UpdateASolePropEntityRequestBody'
CreateASolePropEntityResponse:
title: Sole Prop
type: object
required:
- id
- type
- business_details
- sole_proprietor
- created_at
- updated_at
properties:
id:
type: string
description: Unique ID for the Entity object.
client_customer_id:
type: string
maxLength: 64
description: Client customer ID for the entity object. Limit of 64 characters.
created_at:
type: string
format: date-time
description: Timestamp at which the entity object is created.
updated_at:
type: string
format: date-time
description: Timestamp at which the entity object was last updated.
type:
$ref: '#/components/schemas/EntityTypeSoleProp'
intended_roles:
type: array
items:
$ref: '#/components/schemas/IntendedRolesEnum'
example: 'Possible values: authorized_user, authorized_signer, account_holder. In the event more than 1 role is passed in and at least 1 role doesn’t pass validation, the request will not succeed. It will be an all or nothing behavior. For type = business, sole_prop, only account_holder should be provided'
risk_score:
$ref: '#/components/schemas/EntityRiskScoreEnum'
business_details:
$ref: '#/components/schemas/BusinessDetails'
sole_proprietor:
$ref: '#/components/schemas/SoleProprietor'
rfi_details:
$ref: '#/components/schemas/RfiDetails'
ofac_details:
$ref: '#/components/schemas/OfacDetails'
kyc_details:
$ref: '#/components/schemas/KycDetails'
credit_details:
type: array
items:
$ref: '#/components/schemas/CreditDetails'
role_details:
type: array
items:
$ref: '#/components/schemas/RoleDetails'
metadata:
$ref: '#/components/schemas/Metadata'
AddressDetails:
type: object
properties:
physical_address:
$ref: '#/components/schemas/Address'
description: Physical address for the entity. Physical addresses must not be P.O. boxes, registered agent addresses or in prohibited countries.
mailing_address:
$ref: '#/components/schemas/Address'
description: Mailing address for the entity.
other_addresses:
type: array
description: Other addresses for the entity.
items:
$ref: '#/components/schemas/Address'
Metadata:
type: object
additionalProperties:
type: string
description: A set of key-value pairs that can be used to store additional information related to this object.
ContactMethodEmail:
title: Email
type: object
required:
- type
- email
properties:
type:
$ref: '#/components/schemas/ContactMethodTypeEmail'
email:
type: string
description: Must be a valid email address in the form `local-part@domain.tld`. The domain must contain at least one dot. Addresses using `localhost`, IP literals (e.g., user@[127.0.0.1]), or quoted local parts (e.g., "user"@example.com) are not accepted. Only common, real-world email formats are supported.
example: abc@gmail.com
SoleProprietor:
type: object
required:
- entity_id
properties:
entity_id:
type: string
minLength: 1
description: Individual entity_id created for the sole proprietor. Data requirements for sole proprietors match those of authorized_signer roles.
APIError:
type: object
properties:
code:
type: string
description: The error code.
title:
type: string
description: The error title.
detail:
type: string
description: A detailed error description.
status:
type: string
description: The HTTP status code.
invalid_parameters:
type: array
description: Invalid request parameters with reasons, if applicable.
items:
$ref: '#/components/schemas/InvalidParameterDetail'
instance:
type: string
description: The object causing this specific occurrence of the error, if applicable.
AdditionalDocument:
type: object
required:
- type
properties:
client_document_id:
type: string
description: Client document ID for the additional document.
type:
$ref: '#/components/schemas/AdditionalDocumentTypeEnum'
description:
type: string
description: Description about the identification document. Required if additional document type is `other`.
UpdateASolePropEntityRequestBody:
title: Sole Prop
type: object
required:
- type
properties:
type:
$ref: '#/components/schemas/EntityTypeSoleProp'
intended_roles:
type: array
items:
$ref: '#/components/schemas/IntendedRolesEnum'
example: 'Possible values: authorized_user, authorized_signer, account_holder. In the event more than 1 role is passed in and at least 1 role doesn’t pass validation, the request will not succeed. It will be an all or nothing behavior. For type = business, sole_prop, only account_holder should be provided'
risk_score:
$ref: '#/components/schemas/EntityRiskScoreEnum'
business_details:
$ref: '#/components/schemas/UpdateBusinessDetails'
sole_proprietor:
$ref: '#/components/schemas/SoleProprietor'
rfi_details:
$ref: '#/components/schemas/RfiDetails'
ofac_details:
$ref: '#/components/schemas/OfacDetails'
kyc_details:
$ref: '#/components/schemas/KycDetails'
credit_details:
type: array
items:
$ref: '#/components/schemas/CreditDetails'
metadata:
$ref: '#/components/schemas/Metadata'
NonUsEntityTypeEnum:
type: string
pattern: ^non_us_entity$
default: non_us_entity
description: Entity is considered non-US entity if they do not have US tax identification. For non-US entities, at least 1 government-verified identification documents is required.
UpdateAnIndividualEntityRequestBody:
title: Individual
type: object
required:
- type
properties:
type:
$ref: '#/components/schemas/EntityTypeIndividual'
intended_roles:
type: array
items:
$ref: '#/components/schemas/IntendedRolesEnum'
example: 'Possible values: authorized_user, authorized_signer, account_holder. In the event more than 1 role is passed in and at least 1 role doesn’t pass validation, the request will not succeed. It will be an all or nothing behavior. For type = business, sole_prop, only account_holder should be provided'
risk_score:
$ref: '#/components/schemas/EntityRiskScoreEnum'
individual_details:
$ref: '#/components/schemas/UpdateIndividualDetails'
rfi_details:
$ref: '#/components/schemas/RfiDetails'
ofac_details:
$ref: '#/components/schemas/OfacDetails'
kyc_details:
$ref: '#/components/schemas/KycDetails'
credit_details:
type: array
items:
$ref: '#/components/schemas/CreditDetails'
metadata:
$ref: '#/components/schemas/Metadata'
UsEntity:
title: US Entity
type: object
required:
- type
properties:
type:
$ref: '#/components/schemas/UsEntityTypeEnum'
tax_identification:
$ref: '#/components/schemas/TaxIdentification'
identification_documents:
type: array
items:
$ref: '#/components/schemas/IdentificationDocument'
TaxIdentification:
type: object
required:
- type
- value
properties:
type:
$ref: '#/components/schemas/TaxIdentificationTypeEnum'
value:
type: string
description: The entity's US tax identification number. Must be 9 digits (e.g. XXXXXXXXX). ssn must not start with a 9. ein must begin with a number between 00 and 99. itin must begin with a 9
pattern: ^\d{9}$
CreateASolePropEntityRequestBody:
title: Sole Prop
type: object
required:
- type
- business_details
- sole_proprietor
properties:
client_customer_id:
type: string
maxLength: 64
description: Client customer ID for the entity object. Limit of 64 characters.
type:
$ref: '#/components/schemas/EntityTypeSoleProp'
intended_roles:
type: array
items:
$ref: '#/components/schemas/IntendedRolesEnum'
example: 'Possible values: authorized_user, authorized_signer, account_holder. In the event more than 1 role is passed in and at least 1 role doesn’t pass validation, the request will not succeed. It will be an all or nothing behavior. For type = business, sole_prop, only account_holder should be provided'
risk_score:
$ref: '#/components/schemas/EntityRiskScoreEnum'
business_details:
$ref: '#/components/schemas/BusinessDetails'
sole_proprietor:
$ref: '#/components/schemas/SoleProprietor'
rfi_details:
$ref: '#/components/schemas/RfiDetails'
ofac_details:
$ref: '#/components/schemas/OfacDetails'
kyc_details:
$ref: '#/components/schemas/KycDetails'
credit_details:
type: array
items:
$ref: '#/components/schemas/CreditDetails'
metadata:
$ref: '#/components/schemas/Metadata'
NonUsEntityBusiness:
title: Non US Entity
type: object
required:
- type
properties:
type:
$ref: '#/components/schemas/NonUsEntityTypeEnum'
identification_documents:
type: array
items:
$ref: '#/components/schemas/IdentificationDocument'
ContactMethodTypeEmail:
type: string
pattern: ^email$
default: email
description: ContactMethodType = email.
EntityRiskScoreEnum:
type: string
enum:
- low
- medium
- high
description: The entity's risk score, mapped to Lead by the client. Client should have provided risk score mapping to Lead.
IdentificationDocumentsTypeEnum:
type: string
enum:
- drivers_license
- state_or_provincial_id
- passport
- permanent_residency_id
- military_id
- national_id
- matriculate_id
- other
- tax_certificate
- tax_returns
- partnership_agreement
- certificate_of_good_standing
- formation_document
- proof_of_place_on_stock_exchange
- name_certificate
description: 'The entity''s government-verified identification document type. This will apply for identification types other than US tax identification.
- For `individual` entity, possible types are: `drivers_license`, `state_or_provincial_id`, `passport`, `permanent_residency_id`, `military_id`, `national_id`, `matriculate_id`, `other`. Note that `national_id` and `matriculate_id` are not applicable for `us_entity`.
- For `business` entity, possible types are: `tax_certificate`, `tax_returns`, `partnership_agreement`, `certificate_of_good_standing`, `formation_document`, `proof_of_place_on_stock_exchange`, `other`.
- For `sole_prop` entity, possible types are: `tax_certificate`, `tax_returns`, `name_certificate`, `drivers_license`, `state_or_provincial_id`, `passport`, `permanent_residency_id`, `military_id`, `national_id`, `matriculate_id`, `other`. Note that `national_id` and `matriculate_id` are not applicable for `us_entity`.
'
CreateABusinessEntityResponse:
title: Business
type: object
required:
- id
- type
- business_details
- created_at
- updated_at
properties:
id:
type: string
description: Unique ID for the Entity object.
client_customer_id:
type: string
maxLength: 64
description: Client customer ID for the entity object. Limit of 64 characters.
created_at:
type: string
format: date-time
description: Timestamp at which the entity object is created.
updated_at:
type: string
format: date-time
description: Timestamp at which the entity object was last updated.
type:
$ref: '#/components/schemas/EntityTypeBusiness'
intended_roles:
type: array
items:
$ref: '#/components/schemas/IntendedRolesEnum'
example: 'Possible values: authorized_user, authorized_signer, account_holder. In the event more than 1 role is passed in and at least 1 role doesn’t pass validation, the request will not succeed. It will be an all or nothing behavior. For type = business, sole_prop, only account_holder should be provided'
risk_score:
$ref: '#/components/schemas/EntityRiskScoreEnum'
business_details:
$ref: '#/components/schemas/BusinessDetails'
beneficial_owners:
type: array
items:
$ref: '#/components/schemas/BeneficialOwners'
control_persons:
type: array
items:
$ref: '#/components/schemas/ControlPersons'
rfi_details:
$ref: '#/components/schemas/RfiDetails'
ofac_details:
$ref: '#/components/schemas/OfacDetails'
kyc_details:
$ref: '#/components/schemas/KycDetails'
credit_details:
type: array
items:
$ref: '#/components/schemas/CreditDetails'
role_details:
type: array
items:
$ref: '#/components/schemas/RoleDetails'
metadata:
$ref: '#/components/schemas/Metadata'
CreateAnEntityRequestBody:
oneOf:
- $ref: '#/components/schemas/CreateAnIndividualEntityRequestBody'
- $ref: '#/components/schemas/CreateABusinessEntityRequestBody'
- $ref: '#/components/schemas/CreateASolePropEntityRequestBody'
discriminator:
propertyName: type
mapping:
individual: '#/components/schemas/CreateAnIndividualEntityRequestBody'
business: '#/components/schemas/CreateABusinessEntityRequestBody'
sole_prop: '#/components/schemas/CreateASolePropEntityRequestBody'
CreateAnIndividualEntityRequestBody:
title: Individual
type: object
required:
- type
- individual_details
properties:
client_customer_id:
type: string
maxLength: 64
description: Client customer ID for the entity object. Limit of 64 characters.
type:
$ref: '#/components/schemas/EntityTypeIndividual'
intended_roles:
type: array
items:
$ref: '#/components/schemas/IntendedRolesEnum'
example: 'Possible values: authorized_user, authorized_signer, account_holder. In the event more than 1 role is passed in and at least 1 role doesn’t pass validation, the request will not succeed. It will be an all or nothing behavior. For type = business, sole_prop, only account_holder should be provided'
risk_score:
$ref: '#/components/schemas/EntityRiskScoreEnum'
individual_details:
$ref: '#/components/schemas/IndividualDetails'
rfi_details:
$ref: '#/components/schemas/RfiDetails'
ofac_details:
$ref: '#/components/schemas/OfacDetails'
kyc_details:
$ref: '#/components/schemas/KycDetails'
credit_details:
type: array
items:
$ref: '#/components/schemas/CreditDetails'
metadata:
$ref: '#/components/schemas/Metadata'
OfacDetails:
type: object
required:
- result
- screened_at
properties:
result:
$ref: '#/components/schemas/OfacDetailsResultEnum'
screened_at:
type: string
format: date-time
description: Date time OFAC screen is screened at.
description: Details on OFAC on the entity.
IdentificationDetailsBusiness:
type: object
oneOf:
- $ref: '#/components/schemas/UsEntity'
- $ref: '#/components/schemas/NonUsEntityBusiness'
discriminator:
propertyName: type
mapping:
us_entity: '#/components/schemas/UsEntity'
non_us_entity: '#/components/schemas/NonUsEntityBusiness'
BeneficialOwners:
type: object
required:
- entity_id
properties:
entity_id:
type: string
description: Individual entity_id created for the beneficial owner. Data requirements for beneficial owners match those of authorized_signer roles.
ownership_percentage:
type: string
description: Percentage ownership (0-100.00 or 0-1.00 for decimal representation).
pattern: ^(0(\.\d{1,2})?|[1-9]\d{0,1}(\.\d{1,2})?|100(\.0{1,2})?)$
relationship_established_at:
type: string
format: date
description: The date the relationship was established.
RoleDetails:
type: object
properties:
name:
$ref: '#/components/schemas/IntendedRolesEnum'
status:
$ref: '#/components/schemas/RoleDetailsStatus'
criteria_details:
type: array
items:
$ref: '#/components/schemas/CriteriaDetails'
UpdateAnEntitySuccessResponse:
oneOf:
- $ref: '#/components/schemas/CreateAnIndividualEntityResponse'
- $ref: '#/components/schemas/CreateABusinessEntityResponse'
- $ref: '#/components/schemas/CreateASolePropEntityResponse'
discriminator:
propertyName: type
mapping:
individual: '#/components/schemas/CreateAnIndividualEntityResponse'
business: '#/components/schemas/CreateABusinessEntityResponse'
sole_prop: '#/components/schemas/CreateASolePropEntityResponse'
UpdateAddressDetails:
type: object
properties:
physical_address:
$ref: '#/components/schemas/UpdateAddress'
description: Physical address for the entity. Physical addresses must not be P.O. boxes, registered agent addresses or in prohibited countries.
mailing_address:
$ref: '#/components/schemas/UpdateAddress'
description: Mailing address for the entity.
other_addresses:
type: array
description: Other addresses for the entity.
items:
$ref: '#/components/schemas/Address'
RoleDetailsStatus:
type: string
description: Role Details Status
example: active
enum:
- active
- inactive
IntendedRolesEnum:
type: string
enum:
- authorized_user
- authorized_signer
- account_holder
description: 'The entity''s intended role. Lead highly recommends using this field to confirm data requirements for different roles to minimize errors later. In the event more than 1 role is passed in and at least 1 role doesn’t pass validation, the request will not succeed. It will be an all or nothing behavior.
Lead currently supports:
* `authorized_user`: Individual entity with restricted access to the account, without legal responsibility. Only applies to individual entity.
* `authorized_signer`: Individual entity allowed to sign on behalf of the account h
# --- truncated at 32 KB (50 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/lead-bank/refs/heads/main/openapi/lead-bank-entity-api-openapi.yml