Common Errors
Four request patterns account for most errors when calling the Entity API.Open API Spec Validation
Open API Spec Validation
Lead’s Entity API documentation covers our API interface specification and Lead’s raw Open API. Any request that violates this specification returns a
422, for example a POST entity request that omits a required field.Failure of Synchronous Business Validation
Failure of Synchronous Business Validation
Lead runs a synchronous set of business validations over Entity
POST / PATCH requests. If the request violates any of those checks, the API will return a 422.Intended Role Failure
Intended Role Failure
You can pass
intended_roles in a POST / PATCH request. Lead then evaluates synchronously whether the data you provided satisfies the data requirements for each listed role.If any listed role fails evaluation, the request returns a 422 that names the role check that failed. Omitting intended_roles removes the error from the create or update response, but the same gap surfaces later when you use the entity_id downstream.The checks behind these synchronous errors are identical to the checks reported in role_details on the GET entity response.409 on Create: Duplicate client_customer_id
409 on Create: Duplicate client_customer_id
Each
client_customer_id must be unique within your program. A POST entity request whose client_customer_id is already in use returns a 409 rather than creating a duplicate entity. Retrieve the existing entity with GET /v0/entities?client_customer_id=… and PATCH it instead of re-creating it.Troubleshooting Role Eligibility
Role eligibility checks return a422 only when you pass intended_roles in the POST or PATCH request. Without it, the same checks still run, and the response tells you which data requirements the entity has not yet met for each role.
To find out why an entity is not eligible for a role, inspect the role_details array on the entity. It names exactly which checks fail and on which entity.
The following steps show how to read a role eligibility failure and resolve it.
1
Find the Role and Check its Status
In the
role_details array, find the object where the name matches the role you’re checking (e.g., account_holder, minor_account_holder, authorized_signer, or authorized_user).Once you’ve found the correct role object, check its status field:active: The entity has passed all checks and is eligible for this role.inactive: The entity is not eligible. Proceed to the next step to diagnose the failure.
2
Diagnose the Failure
If the status is
inactive, look inside that role’s criteria_details array. This array explains what went wrong.Each object in criteria_details contains:entity_id: The ID of the entity that has the problem and must be updated.failed_checks: A list of one or more error codes.
Refer to the Role Check Failure table below to understand what each code in the
failed_checks list means and how to resolve it.Understand Indirect Failures (Child Entities)
Sometimes, an entity’s role isinactive because a related child entity (like a control person or beneficial owner) has failed its own required checks. The criteria_details array is designed to point you directly to that failing child entity.
Example
Let’s say a business is inactive for the account_holder role.
- The Requirement: For a
businessto be anaccount_holder, it must list at least one control person incontrol_persons. That control person’s entity must, in turn, be eligible for theauthorized_signerrole. - The Dependency: To be an
authorized_signer, the control person’s entity must have apassedKYC status. - The Failure: In this case, the control person’s entity failed its KYC check.
- The Result: Because the control person is not a valid
authorized_signer, the parentbusinesscannot become anaccount_holder. Thecriteria_detailsfor thebusinesscontains an object pointing to the control person’sentity_idwith afailed_checkslist containingCheckKYCStatus.
business entity.
Role Check Failure Codes
Intended Role Parameter
Notes for using the intended roles parameter in POST and PATCH requests or Customer File Uploads
intended_roles is an optional parameter on entity POST and PATCH requests and on Customer file records. Pass it when you believe you have captured every data point a role requires. It asks Lead to validate synchronously that the entity meets the data requirements for each listed role.
This catches gaps before they cause downstream failures. Suppose the entity data you are about to send does not yet meet the Account Holder requirements:
If the request includes
intended_roles: ["account_holder"], Lead rejects it with a 422 that names the failing check. Nothing is created or updated. Fix the named field and resubmit. A Customer file record that includes intended_roles fails validation the same way.intended_roles, Lead creates the entity as long as it meets the schema requirements, even though it does not yet qualify as an account_holder. The role_details array in the response shows which roles it qualifies for, and you can update the entity later to close the gap.
When a synchronous intended_roles validation fails, the 422 names the failing check using the same vocabulary as role_details. For example, an entity under 16 submitted with an intended role of minor_account_holder returns:
intended_roles is optional. If the entity meets a role’s data requirements and you do not pass intended_roles, Lead still treats the entity as eligible for that role in downstream use cases such as Account Number creation.File-Integrated Programs: Error Handling and Retry
If your program reports customers via the Customer files rather than the API, validation failures surface through the file cycle instead:- Lead posts a success message in Slack when the batch processes, listing the files it included.
- If a file fails validation, the error messages appear in your Slack alert channel.
- Fix the file and upload a new version. Lead re-runs validation on the latest version of each file in the batch.

