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

# Get latest application state

> Retrieve the latest application state for a specific application



## OpenAPI

````yaml api-reference/openapi.yaml get /getLatestApplicationState
openapi: 3.0.0
info:
  title: Parcha API
  version: 1.0.0
  description: API for managing Parcha jobs and checks
servers:
  - url: https://api.parcha.ai/api/v1
    description: Agent Hub API server
  - url: https://demo.parcha.ai/api/v1
    description: Sandbox API server
  - url: https://us1.parcha.ai/api/v1
    description: Legacy API server
  - url: http://{your-company-domain}.parcha.ai/api/v1
    description: Custom Enterpris server (your company's API server)
security:
  - bearerAuth: []
paths:
  /getLatestApplicationState:
    get:
      summary: Get latest application state
      description: Retrieve the latest application state for a specific application
      parameters:
        - name: agent_key
          in: query
          required: true
          schema:
            type: string
          description: The agent key
        - name: application_id
          in: query
          required: true
          schema:
            type: string
          description: The ID of the application
      responses:
        '200':
          description: Application state retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationState'
      security:
        - bearerAuth: []
components:
  schemas:
    ApplicationState:
      type: object
      required:
        - self_attested_data
        - applicant_id
        - applicant_type
        - application_status
        - updated_at
      properties:
        self_attested_data:
          oneOf:
            - $ref: '#/components/schemas/BusinessCaseSchema'
            - $ref: '#/components/schemas/IndividualCaseSchema'
        applicant_id:
          type: string
          description: The ID of the applicant
        applicant_type:
          type: string
          enum:
            - kyb
            - kyc
            - entity
          description: The type of applicant
        application_status:
          type: string
          enum:
            - PENDING
            - IN_PROGRESS
            - COMPLETE
            - ERROR
          description: The current status of the application
        current_check_results:
          type: array
          items:
            $ref: '#/components/schemas/CheckResult'
          description: Current check results
        past_check_results:
          type: array
          items:
            $ref: '#/components/schemas/CheckResult'
          description: Past check results
        updated_at:
          type: string
          format: date-time
          description: Last update timestamp
    BusinessCaseSchema:
      type: object
      required:
        - business_name
      properties:
        business_name:
          type: string
          description: The name of the business
        registered_business_name:
          type: string
          description: The registered name of the business
        address_of_incorporation:
          $ref: '#/components/schemas/Address'
        address_of_operation:
          $ref: '#/components/schemas/Address'
        website:
          type: string
          description: The business website URL
        business_purpose:
          type: string
          description: The purpose of the business
        description:
          type: string
          description: Business description
        industry:
          type: string
          description: The industry the business operates in
        tin_number:
          type: string
          description: Tax Identification Number
        incorporation_date:
          type: string
          format: date
          description: Date of incorporation
    IndividualCaseSchema:
      type: object
      required:
        - first_name
        - last_name
      properties:
        first_name:
          type: string
          description: The first name of the individual
        middle_name:
          type: string
          description: The middle name of the individual
        last_name:
          type: string
          description: The last name of the individual
        date_of_birth:
          type: string
          format: date
          description: The date of birth of the individual
        address:
          $ref: '#/components/schemas/Address'
        country_of_nationality:
          type: string
          description: The country of nationality of the individual
        country_of_residence:
          type: string
          description: The country of residence of the individual
        email:
          type: string
          format: email
          description: The email of the individual
        phone:
          type: string
          description: The phone number of the individual
    CheckResult:
      type: object
      required:
        - check_id
        - status
      properties:
        check_id:
          type: string
          description: The ID of the check
        status:
          type: string
          enum:
            - PENDING
            - IN_PROGRESS
            - COMPLETE
            - ERROR
          description: The status of the check
        result:
          type: object
          description: The result of the check
        error:
          type: string
          description: Error message if the check failed
        updated_at:
          type: string
          format: date-time
          description: Last update timestamp
    Address:
      type: object
      properties:
        street_1:
          type: string
          description: Primary street address line
        street_2:
          type: string
          description: Secondary street address line (optional)
        city:
          type: string
          description: City name
        state:
          type: string
          description: State/province code
        country_code:
          type: string
          description: Two-letter ISO country code (e.g., "US", "GB")
        postal_code:
          type: string
          description: Postal/ZIP code
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key obtained from your Parcha account settings. Include as Bearer
        token in the Authorization header.

````