Lean Technologies Identity Raw Data API

The Identity Raw Data API from Lean Technologies — 1 operation(s) for identity raw data.

OpenAPI Specification

lean-technologies-identity-raw-data-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Consents Account On File Account Controls (New) Account Controls (New) Identity Raw Data API
  version: v0.2.3
servers:
- url: https://sandbox.leantech.me
  description: Sandbox
- url: https://api2.leantech.me
  description: Production
security:
- bearerAuth: []
tags:
- name: Identity Raw Data
  x-displayName: Identity Raw Data
paths:
  /data/v2/identity:
    servers: []
    get:
      operationId: fetchIdentitiesV2
      summary: Get identity
      description: "Get the identity details of the account holder stored at the bank. \nRequires the following permissions: `identity`\n"
      parameters:
      - $ref: '#/components/parameters/AsyncParameter'
      - $ref: '#/components/parameters/PageParameter'
      - $ref: '#/components/parameters/SizeParameter'
      - $ref: '#/components/parameters/EntityIdParameter'
      - $ref: '#/components/parameters/MetaParameter'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FetchIdentityV2Result'
              examples:
                Get_Identity_V2_KSA_Example:
                  summary: Successful get identity - KSA
                  value:
                    status: OK
                    results_id: 37c84e2a-9f15-4d76-b218-56f8a31c2e5d
                    message: Data successfully retrieved
                    meta: null
                    timestamp: '2025-09-12T17:15:05.424086733Z'
                    status_detail: null
                    data:
                      identities:
                      - entity_id: a5b23e1f-67d8-42c9-a815-98f4c7e36d92
                        full_legal_name: ABDULLAH AHMED Lean
                        name: ABDULLAH
                        phone: '+966541782365'
                        email_address: aa_qahtani85@gmail.com
                        legal_structure: ''
                        mobile_number: '+966541782365'
                        address:
                          address_type: RESIDENTIAL
                          building_type: Apartment
                          apartment_or_villa_number: '1'
                          building_name: Lean building
                          street: Lean street
                          area: main area
                          town_name: حي الياسمين
                          region: '6'
                          country: SA
                          post_code: '13325'
                          po_box: '123'
                          street_address: 100 وح
                          address_line: 173 وحدة حي الياسمين
                        account_role: ADMINISTRATOR
                        party_type: SOLE
                        party_id: PT_0000000029837526
                        party_number: 0000000029837526
                        birth_date: '1985-03-15'
                        gender: MALE
                      page:
                        number: 0
                        size: 50
                        total_elements: 1
                        total_pages: 1
                      type: identity
                    type: identity
                    refreshed_at: '2025-08-10T10:45:27.963Z'
                BankIssueV2Example:
                  $ref: '#/components/examples/BankIssueV2Example'
        '202':
          description: Accepted (Asynchronous request)
          content:
            application/json:
              examples:
                GetAccountsV2AsyncExample:
                  $ref: '#/components/examples/AsyncProcessingV2Example'
        '400':
          description: Bad Request
          content:
            application/json:
              examples:
                InvalidParametersExample:
                  $ref: '#/components/examples/InvalidParametersExample'
        '404':
          description: Entity not found
          content:
            application/json:
              examples:
                UnknownEntityExample:
                  $ref: '#/components/examples/UnknownEntityExample'
        '500':
          description: Internal Server Error
          content:
            application/json:
              examples:
                InternalServerErrorExample:
                  $ref: '#/components/examples/InternalServerErrorExample'
      tags:
      - Identity Raw Data
components:
  schemas:
    DataResult:
      type: object
      allOf:
      - $ref: '#/components/schemas/Result'
      - type: object
        properties:
          refreshed_at:
            description: The datetime of when the data was refreshed
            type:
            - string
            - 'null'
            format: date-time
          type:
            description: The endpoint the original request was made to.
            type:
            - string
            - 'null'
    PageMetadata:
      description: Metadata about the current page of results
      type: object
      properties:
        number:
          description: The current page being returned by the API
          type: integer
          format: int32
        size:
          description: The page size requested
          type: integer
          format: int32
        total_elements:
          description: The total number of elements in all pages
          type: integer
          format: int64
        total_pages:
          description: The total number of pages retrievable
          type: integer
          format: int32
        sort:
          description: Sort parameters applied to the results
          type: array
          items:
            type: string
      required:
      - number
      - size
      - total_elements
      - total_pages
    FetchIdentityV2Result:
      type: object
      allOf:
      - $ref: '#/components/schemas/DataResult'
      - properties:
          data:
            $ref: '#/components/schemas/IdentityData'
        type: object
      x-toBuilder: true
    Result:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/ResultStatus'
        results_id:
          description: The unique identifier for the request
          type: string
          format: uuid
        message:
          description: A message describing the status of the request
          type: string
        meta:
          description: Meta information about the request
          type:
          - object
          - 'null'
          additionalProperties:
            type: string
        timestamp:
          description: The datetime of when the request was made
          type: string
          format: date-time
        status_detail:
          description: Additional information about the status
          type:
          - object
          - 'null'
          allOf:
          - $ref: '#/components/schemas/StatusDetail'
      required:
      - status
      - results_id
      - message
      - timestamp
    IdentityV2data:
      type: object
      properties:
        entity_id:
          description: entity id
          type: string
          format: uuid
        full_legal_name:
          description: Full legal name as retrieved from bank
          type: string
        name:
          description: Name of the account holder
          type: string
        national_id:
          description: National ID number for the country
          type: string
        birth_date:
          description: The date of birth of the account holder.
          type: string
          format: date
        gender:
          description: The gender of the account holder.
          type: string
        email_address:
          description: The registered email address of the account holder.
          type: string
        legal_structure:
          description: Legal structure of the entity
          type: string
        phone:
          description: Phone number of the account holder
          type: string
        mobile_number:
          description: Mobile number of the account holder
          type: string
        address:
          $ref: '#/components/schemas/Address'
        account_role:
          description: Role of the account holder
          type: string
        party_type:
          description: Type of party relationship
          type: string
          enum:
          - DELEGATE
          - JOINT
          - SOLE
          - UNSUPPORTED
        party_id:
          description: Unique identifier for the party
          type: string
        party_number:
          description: Party number assigned by the institution
          type: string
      x-toBuilder: true
    ResultStatus:
      description: The status of the request
      type: string
      enum:
      - OK
      - PENDING
      - FAILED
      - CONSENT_EXPIRED
      - RECONNECT_REQUIRED
      - PROCESSING_STARTED
    Address:
      description: The full address details
      type: object
      properties:
        address_line:
          description: Full address line as retrieved from bank
          type: string
        address_type:
          description: The type of address (e.g., residential, business).
          type: string
        building_type:
          description: The type of building, apartments or villa for example.
          type: string
        apartment_or_villa_number:
          description: The apartment or villa/house number.
          type: string
        building_name:
          description: The name of the building.
          type: string
        street:
          description: The street name.
          type: string
        area:
          description: The area or neighborhood.
          type: string
        street_address:
          description: Street address which may include house number, street name and PO Box
          type: string
        post_code:
          description: The Zip or postal code associated with the address.
          type: string
        town_name:
          description: The town or city name where the address is located.
          type: string
        region:
          description: The region of the address. State, province, prefecture, or region
          type: string
        po_box:
          description: The post office box number.
          type: string
        country:
          description: The country where the address is located.
          type: string
      x-toBuilder: true
    StatusDetail:
      type:
      - object
      - 'null'
      properties:
        granular_status_code:
          description: Granular status code
          type:
          - string
          - 'null'
        status_additional_info:
          description: Additional information about the status
          type:
          - string
          - 'null'
    IdentityData:
      type: object
      properties:
        account_id:
          description: Account ID
          type: string
          format: uuid
        type:
          description: The endpoint the original request was made to.
          type: string
        identities:
          description: An array of identities associated with the Entity.
          type: array
          items:
            $ref: '#/components/schemas/IdentityV2data'
        page:
          $ref: '#/components/schemas/PageMetadata'
      required:
      - type
      x-toBuilder: true
  examples:
    InternalServerErrorExample:
      summary: Internal server error response
      description: Response when an unexpected server error occurs
      value:
        results_id: 516adc40-af36-4284-bfba-46ec69dfe6d3
        timestamp: '2025-08-07T13:07:38.834977945Z'
        status: INTERNAL_SERVER_ERROR
        message: Something has gone wrong. If you continue to see this error, please get in touch with Lean.
        metadata: null
    UnknownEntityExample:
      summary: Entity not found error response
      description: Response when the provided entity_id is not found
      value:
        results_id: 516adc40-af36-4284-bfba-46ec69dfe6d3
        timestamp: '2025-09-10T21:03:05.413806605Z'
        status: UNKNOWN_ENTITY
        message: The entity_id provided did not match an account in our records.
        metadata: null
    InvalidParametersExample:
      summary: Invalid parameters error response
      description: Response when required parameters are missing or invalid
      value:
        results_id: 516adc40-af36-4284-bfba-46ec69dfe6d3
        timestamp: '2025-09-10T21:05:59.919233187Z'
        status: INVALID_PARAMETERS
        message: 'The request is badly formatted or a parameter of the wrong type has been provided, field: entity_id, value: e34d8e49-9af2-4252-a53e-bd2df855134.'
        metadata: null
    BankIssueV2Example:
      summary: Failed request due to bank technical issues
      description: Response when the bank is experiencing technical problems
      value:
        status: FAILED
        results_id: 516adc40-af36-4284-bfba-46ec69dfe6d3
        message: Your bank is currently experiencing technological problems. Please try again later.
        meta: null
        timestamp: '2025-09-12T05:13:49.739987382Z'
        status_detail:
          granular_status_code: BANK_ISSUE
          status_additional_info: Your bank is currently experiencing technological problems. Please try again later.
        type: null
        refreshed_at: null
    AsyncProcessingV2Example:
      summary: Asynchronous processing response with async=true
      description: Response to request with async=true
      value:
        status: PENDING
        results_id: df73d596-7138-46df-af96-cbcbe9a8af59
        message: Please wait for a webhook or try again later.
        meta: null
        timestamp: '2025-09-11T19:15:07.829993148Z'
        status_detail: null
        data: null
        type: null
        refreshed_at: null
  parameters:
    MetaParameter:
      name: meta
      description: 'Additional data you would like to store against the request. Example: {"foo": "val"}'
      in: query
      required: false
      schema:
        type: string
    SizeParameter:
      name: size
      description: The number of objects you want to return as a page size.
      in: query
      required: false
      schema:
        type: integer
        default: 50
        maximum: 100
        minimum: 1
    EntityIdParameter:
      name: entity_id
      description: The entity_id you're querying for, which is created by LinkSDK `.connect()` function.
      in: query
      required: false
      schema:
        type: string
        format: uuid
    AsyncParameter:
      name: async
      in: query
      description: 'When true the API will return a results_id which can be fetched from the /data/v2/results endpoint when ready. **Note: it''s recommended to use the sync flow (async=false) for all requests by adapting the [data workflow](https://docs.leantech.me/docs/data-workflow) for connected entities.**'
      required: false
      schema:
        type: boolean
        default: false
      deprecated: true
    PageParameter:
      name: page
      in: query
      description: The page you're requesting - returns page 0 of a response if not specified.
      required: false
      schema:
        type: integer
        default: 0
        minimum: 0
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer