> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lead.bank/llms.txt
> Use this file to discover all available pages before exploring further.

# Update an Entity

> 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.




## OpenAPI

````yaml PATCH /v0/entities/{id}
openapi: 3.0.1
info:
  title: Lead Bank
  description: Lead Bank's APIs
  version: v1.0
servers:
  - url: https://api.sandbox.lead.bank
  - url: https://api.lead.bank
security:
  - bearerAuth: []
tags:
  - name: ACH
  - name: Account Number
  - name: OAuth
  - name: Events
  - name: Instant Payments
  - name: Lending
  - name: Simulation
  - name: Internal Transfer
  - name: Disbursement
  - name: Entity
  - name: Wire
  - name: Originator
  - name: Funding
  - name: Balances
  - name: Compliance
  - name: UserAccount
  - name: Blockchain Payment
paths:
  /v0/entities/{id}:
    patch:
      tags:
        - 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.
      operationId: Update-an-entity
      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'
components:
  schemas:
    UpdateAnEntityRequestBody:
      oneOf:
        - $ref: '#/components/schemas/UpdateAnIndividualEntityRequestBody'
        - $ref: '#/components/schemas/UpdateABusinessEntityRequestBody'
        - $ref: '#/components/schemas/UpdateASolePropEntityRequestBody'
      discriminator:
        propertyName: type
        mapping:
          individual:
            $ref: '#/components/schemas/UpdateAnIndividualEntityRequestBody'
          business:
            $ref: '#/components/schemas/UpdateABusinessEntityRequestBody'
          sole_prop:
            $ref: '#/components/schemas/UpdateASolePropEntityRequestBody'
    UpdateAnEntitySuccessResponse:
      oneOf:
        - $ref: '#/components/schemas/CreateAnIndividualEntityResponse'
        - $ref: '#/components/schemas/CreateABusinessEntityResponse'
        - $ref: '#/components/schemas/CreateASolePropEntityResponse'
      discriminator:
        propertyName: type
        mapping:
          individual:
            $ref: '#/components/schemas/CreateAnIndividualEntityResponse'
          business:
            $ref: '#/components/schemas/CreateABusinessEntityResponse'
          sole_prop:
            $ref: '#/components/schemas/CreateASolePropEntityResponse'
    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.
    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'
    UpdateABusinessEntityRequestBody:
      title: Business
      type: object
      required:
        - type
      properties:
        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/UpdateBusinessDetails'
        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'
        metadata:
          $ref: '#/components/schemas/Metadata'
    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'
    CreateAnIndividualEntityResponse:
      title: Individual
      type: object
      required:
        - id
        - type
        - 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/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'
        role_details:
          type: array
          items:
            $ref: '#/components/schemas/RoleDetails'
        metadata:
          $ref: '#/components/schemas/Metadata'
    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'
    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'
    InvalidParameterDetail:
      type: object
      properties:
        parameter:
          type: string
          description: Which parameter is invalid.
          example: transaction_type
        reason:
          type: string
          description: Why the parameter is invalid.
    EntityTypeIndividual:
      type: string
      pattern: ^individual$
      default: individual
      description: Type of entity = individual.
    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 holder, without legal responsibility. Only applies to
        individual entity.

        * `account_holder`: Entity with full control and legal responsibility
        for the account. Applies to all entity types.
    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.
    UpdateIndividualDetails:
      type: object
      properties:
        first_name:
          type: string
          description: Legal first name. Must be at least 2 character.
          example: Lucy
        preferred_first_name:
          type: string
          description: Preferred first name.
          example: Lu
        middle_name:
          type: string
          description: Middle name.
          example: Reginald
        last_name:
          type: string
          description: Legal last name. Must be at least 2 character.
          example: Collins
        date_of_birth:
          type: string
          format: date
          description: >-
            Date of birth, in YYYY-MM-DD format.  Authorized signers and account
            holders must be 18 years or older.
          example: '2002-02-15'
        occupation:
          type: string
          description: Occupation / job.
          example: Author
        contact_methods:
          type: array
          items:
            $ref: '#/components/schemas/ContactMethod'
        address_details:
          $ref: '#/components/schemas/UpdateAddressDetails'
        identification_details:
          $ref: '#/components/schemas/IdentificationDetailsIndividual'
        additional_documents:
          type: array
          items:
            $ref: '#/components/schemas/AdditionalDocument'
      description: Details for the individual entity
    RfiDetails:
      type: object
      required:
        - result
        - requested_at
      properties:
        result:
          $ref: '#/components/schemas/RfiDetailsResultEnum'
        requested_at:
          type: string
          format: date-time
          description: Date time RFI is requested at.
    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.
    KycDetails:
      type: object
      required:
        - result
        - screened_at
      properties:
        result:
          $ref: '#/components/schemas/KycDetailsResultEnum'
        screened_at:
          type: string
          format: date-time
          description: Date time KYC screen is screened at.
      description: Details on KYC on the entity.
    CreditDetails:
      type: object
      required:
        - credit_report_source
        - credit_pulled_at
      properties:
        credit_score:
          type: string
          description: >-
            Credit score given by the credit bureau. Cannot be above 850.
            Mutually exclusive with `credit_report_non_score_value`.
        credit_report_non_score_value:
          $ref: '#/components/schemas/CreditReportNonScoreValueEnum'
        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. Exactly one of
        `credit_score` or `credit_report_non_score_value` must be provided.
    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.
    EntityTypeBusiness:
      type: string
      pattern: ^business$
      default: business
      description: Type of entity = business.
    UpdateBusinessDetails:
      type: object
      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.
        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/UpdateAddressDetails'
        identification_details:
          $ref: '#/components/schemas/IdentificationDetailsBusiness'
        additional_documents:
          type: array
          items:
            $ref: '#/components/schemas/AdditionalDocument'
      description: Details for the business entity
    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.
    ControlPersons:
      type: object
      required:
        - entity_id
        - title
      properties:
        entity_id:
          type: string
          description: >-
            Individual entity_id created for the control person. Data
            requirements for control persons match those of authorized_signer
            roles.
        title:
          type: string
          description: The title of this control person.
        relationship_established_at:
          type: string
          format: date
          description: The date the relationship was established.
    EntityTypeSoleProp:
      type: string
      pattern: ^sole_prop$
      default: sole_prop
      description: Type of entity = sole_prop.
    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.
    IndividualDetails:
      type: object
      required:
        - first_name
        - last_name
        - identification_details
      properties:
        first_name:
          type: string
          description: Legal first name.
        preferred_first_name:
          type: string
          description: Preferred first name.
        middle_name:
          type: string
          description: Middle name.
        last_name:
          type: string
          description: Legal last name. Must be at least 2 alphanumeric characters.
        date_of_birth:
          type: string
          format: date
          description: >-
            Date of birth, in YYYY-MM-DD format. Authorized signers and account
            holders must be 18 years or older.
          example: '2002-02-15'
        occupation:
          type: string
          description: Occupation / job.
        contact_methods:
          type: array
          items:
            $ref: '#/components/schemas/ContactMethod'
        address_details:
          $ref: '#/components/schemas/AddressDetails'
        identification_details:
          $ref: '#/components/schemas/IdentificationDetailsIndividual'
        additional_documents:
          type: array
          items:
            $ref: '#/components/schemas/AdditionalDocument'
      description: Details for the individual entity
    RoleDetails:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/IntendedRolesEnum'
        status:
          $ref: '#/components/schemas/RoleDetailsStatus'
        criteria_details:
          type: array
          items:
            $ref: '#/components/schemas/CriteriaDetails'
    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
    ContactMethod:
      type: object
      oneOf:
        - $ref: '#/components/schemas/ContactMethodEmail'
        - $ref: '#/components/schemas/ContactMethodPhone'
      discriminator:
        propertyName: type
        mapping:
          email:
            $ref: '#/components/schemas/ContactMethodEmail'
          phone_number:
            $ref: '#/components/schemas/ContactMethodPhone'
    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'
    IdentificationDetailsIndividual:
      type: object
      oneOf:
        - $ref: '#/components/schemas/UsEntity'
        - $ref: '#/components/schemas/NonUsEntityIndividual'
      discriminator:
        propertyName: type
        mapping:
          us_entity:
            $ref: '#/components/schemas/UsEntity'
          non_us_entity:
            $ref: '#/components/schemas/NonUsEntityIndividual'
    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`.
    RfiDetailsResultEnum:
      type: string
      enum:
        - requested
        - completed
      description: >-
        Result of request for information with the end customer. Leave blank if
        RFI has not been sent to the customer.
    OfacDetailsResultEnum:
      type: string
      enum:
        - pending
        - passed
        - failed
      description: 'OFAC result. Possible values: pending | passed | failed. '
    KycDetailsResultEnum:
      type: string
      enum:
        - pending
        - passed
        - failed
      description: 'KYC result. Possible values: pending | passed | failed. '
    CreditReportNonScoreValueEnum:
      type: string
      enum:
        - unestablished
        - frozen
      description: >-
        Indicates the state of a credit file when a numeric score is not
        available.
    CreditReportSourceEnum:
      type: string
      enum:
        - equifax
        - experian
        - transunion
      description: The name of the credit bureau.
    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.
    IdentificationDetailsBusiness:
      type: object
      oneOf:
        - $ref: '#/components/schemas/UsEntity'
        - $ref: '#/components/schemas/NonUsEntityBusiness'
      discriminator:
        propertyName: type
        mapping:
          us_entity:
            $ref: '#/components/schemas/UsEntity'
          non_us_entity:
            $ref: '#/components/schemas/NonUsEntityBusiness'
    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'
    RoleDetailsStatus:
      type: string
      description: Role Details Status
      example: active
      enum:
        - active
        - inactive
    CriteriaDetails:
      type: object
      properties:
        failed_checks:
          type: array
          items:
            type: string
        entity_id:
          type: string
    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
    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.
    UpdateAddress:
      type: object
      properties:
        line_1:
          type: string
          description: >-
            Address line 1 is the required primary street-address field. It must
            contain the full base address needed to identify the physical
            location, such as the street number and street name together, or the
            closest local equivalent in countries where addresses do not use
            that exact structure.


            Use address line 1 for all core location details that describe the
            main property or thoroughfare. Regardless of how each component of
            an address is collected from your end-users, they must be combined
            into address line 1 before sending to Lead.


            Do not:

            - split the primary street address across line 1 and line 2

            - put only the street number in line 1 and the street name in line 2

            - pad line 1 with false or altered data just to satisfy validation
        line_2:
          type: string
          description: >-
            Address line 2 is optional and should be used only for secondary or
            sub-premise information, such as:

            - apartment

            - unit

            - suite

            - floor

            - building

            - care-of / attention


            If there is no secondary or sub-premise information, address line 2
            should be blank.


            Do not use address line 2 for any part of the primary street
            address.
        city:
          type: string
          description: City.
        postal_code:
          type: string
          description: >-
            Postal Code, required for US addresses. Please follow the following
            format: US: ^\d5(?:-\d4)?$, CN: ^\d6$, GB: ^[A-Z]{1,2}d[A-Z0-9]?
            ?d[A-Z]{2}$, JP: ^\d3-\d4$
        state:
          type: string
          description: State. required for US addresses in 2 character code (e.g. NY).
        country:
          type: string
          description: ISO3166-1 Alpha-2 country code.
    Address:
      type: object
      required:
        - line_1
        - city
        - country
      properties:
        line_1:
          type: string
          description: >-
            Address line 1 is the required primary street-address field. It must
            contain the full base address needed to identify the physical
            location, such as the street number and street name together, or the
            closest local equivalent in countries where addresses do not use
            that exact structure.


            Use address line 1 for all core location details that describe the
            main property or thoroughfare. Regardless of how each component of
            an address is collected from your end-users, they must be combined
            into address line 1 before sending to Lead.


            Do not:

            - split the primary street address across line 1 and line 2

            - put only the street number in line 1 and the street name in line 2

            - pad line 1 with false or altered data just to satisfy validation
          example: 123 Main St.
        line_2:
          type: string
          description: >-
            Address line 2 is optional and should be used only for secondary or
            sub-premise information, such as:

            - apartment

            - unit

            - suite

            - floor

            - building

            - care-of / attention


            If there is no secondary or sub-premise information, address line 2
            should be blank.


            Do not use address line 2 for any part of the primary street
            address.
          example: Apt 25
        city:
          type: string
          description: City.
          example: Denver
        postal_code:
          type: string
          description: >-
            Postal Code, required for US addresses. Please follow the following
            format: US: ^\d5(?:-\d4)?$, CN: ^\d6$, GB: ^[A-Z]{1,2}d[A-Z0-9]?
            ?d[A-Z]{2}$, JP: ^\d3-\d4$
          example: 80014
        state:
          type: string
          description: State. required for US addresses in 2 character code (e.g. NY).
          example: CO
        country:
          type: string
          description: ISO3166-1 Alpha-2 country code.
          example: US
    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'
    NonUsEntityIndividual:
      title: Non US Entity
      type: object
      required:
        - type
      properties:
        type:
          $ref: '#/components/schemas/NonUsEntityTypeEnum'
        identification_documents:
          type: array
          items:
            $ref: '#/components/schemas/IdentificationDocument'
    AdditionalDocumentTypeEnum:
      type: string
      enum:
        - bank_statement
        - utility_bills
        - proof_of_address
        - investigation_report
        - financial_statement
        - public_records
        - adverse_media
        - id_selfie
        - other
      description: >-
        Type of additional non-government documents being provided to verify
        entity. Possible values are `bank_statement`, `utility_bills`,
        `proof_of_address`, `investigation_report`, `financial_statement`,
        `public_records`, `adverse_media`, `id_selfie`, `other`.
    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.
    ContactMethodTypePhone:
      type: string
      pattern: ^phone_number$
      default: phone_number
      example: +22 607 123 4567
      description: ContactMethodType = phone_number. Conforms to E.123 standard
    UsEntityTypeEnum:
      type: string
      pattern: ^us_entity$
      default: us_entity
      description: >-
        Entity is considered US entity if they have US tax identification. For
        US entities, US tax identification number as well as other available
        government-verified identification documents, if collected, are
        required.
    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}$
    IdentificationDocument:
      type: object
      required:
        - type
        - identification_number
        - issuing_country
      properties:
        client_document_id:
          type: string
          description: Client document ID for the identification document.
        type:
          $ref: '#/components/schemas/IdentificationDocumentsTypeEnum'
        description:
          type: string
          description: >-
            Description about the identification document. Required if
            identification document type is `other`.
        identification_number:
          type: string
          description: Unique identification number on the identification document.
        expiration_date:
          type: string
          format: date
          description: Expiration date of the identification document.
        issuing_state:
          type: string
          description: >-
            Issuing state of the identification document. Must be 2 character
            code (e.g. NY). If the issuing country is US, this value must be a
            valid US State.
        issuing_country:
          type: string
          description: >-
            Issuing country of the identification document. ISO3166-1 Alpha-2
            country code.
    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.
    TaxIdentificationTypeEnum:
      type: string
      enum:
        - ssn
        - itin
        - ein
      description: >
        The entity's US tax identification type.

        - For `individual` entity, `ssn` or `itin` is required.

        - For `business` entity, `ein` is required. For single-member LLC
        entities where no EIN is available, `ssn` or `itin` may be used.

        - For `sole_prop` entity, `ssn` or `itin` or `ein` is required.
    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`.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````