Kita Results API

Retrieve extraction results, summaries and exports.

OpenAPI Specification

kita-results-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Kita Capture Applications Results API
  version: v1
  summary: Document intelligence — extract structured, validated, fraud-checked data from bank statements, payslips, IDs, credit reports and 30+ other document types.
  description: 'Kita Capture turns scanned or photographed financial and identity documents into clean

    JSON — transactions, metadata, metrics, and fraud signals. Upload a file (multipart or

    base64), submit a URL, or batch up to 100 documents, then poll for results or receive an

    HMAC-signed webhook.


    Authentication uses an organization API key prefixed `kita_prod_` sent as

    `Authorization: Bearer <key>`. Errors return `{ "error": ..., "message": ... }`.

    Rate limiting is per organization; 429 responses carry a `Retry-After` header.


    NOTE: Kita does not publish a machine-readable OpenAPI description. This document was

    generated by the API Evangelist enrichment pipeline from Kita''s own published API

    documentation (shipped verbatim inside the official `kita-docs-mcp` npm package and

    served at https://www.kita.ai/documentation). Only operations, parameters, fields and

    status codes that Kita documents are represented here.

    '
  contact:
    name: Kita Support
    email: support@kita.ai
    url: https://www.kita.ai/documentation
  x-source:
  - https://www.kita.ai/documentation
  - https://unpkg.com/kita-docs-mcp@0.4.0/docs/Documentation.md
  x-generated-by: api-evangelist-enrichment-pipeline
  x-generated: '2026-07-19'
servers:
- url: https://portal.usekita.com
  description: Production (default; override with the KITA_API_URL environment variable)
security:
- BearerAuth: []
tags:
- name: Results
  description: Retrieve extraction results, summaries and exports.
paths:
  /api/results/{documentId}:
    parameters:
    - name: documentId
      in: path
      required: true
      schema:
        type: integer
    get:
      tags:
      - Results
      operationId: getDocumentResult
      summary: Get the extraction result
      description: Retrieve the full processed result. Poll until `status` is `completed`.
      responses:
        '200':
          description: The extraction result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResult'
              example:
                status: completed
                document_type: bank_statement
                document_id: 123
                metadata:
                  account_holder_name: Juan Dela Cruz
                  account_number: '1234567890'
                  financial_institution: BDO
                  statement_start_date: 01-01-2024
                  statement_end_date: 01-31-2024
                  currency: PHP
                  opening_balance: 50000.0
                  closing_balance: 62000.0
                extracted_data:
                  transactions:
                  - date: 01-02-2024
                    description: SALARY CREDIT
                    credit: 30000.0
                    debit: null
                    balance: 80000.0
                    category: income
                    subcategory: salary
                    transaction_type: credit
                  metrics:
                    total_inflow: 45000.0
                    total_outflow: 33000.0
                    net_cash_flow: 12000.0
                    average_balance: 58000.0
                    total_transactions: 25
                fraud_detection:
                  risk_level: low
                  authenticity_score: 92
                  signals:
                  - severity: info
                    category: document_integrity
                    message: Document appears authentic
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
  /api/documents/{id}/summary:
    parameters:
    - $ref: '#/components/parameters/DocumentIdPath'
    get:
      tags:
      - Results
      operationId: getDocumentSummary
      summary: Get key metrics for a bank statement or passbook
      description: Account info, flows, balances and category breakdowns. No transaction-level data.
      parameters:
      - name: format
        in: query
        required: false
        schema:
          type: string
          enum:
          - json
          - csv
          default: json
      responses:
        '200':
          description: The summary.
          content:
            application/json:
              schema:
                type: object
            text/csv:
              schema:
                type: string
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /api/v1/documents:
    get:
      tags:
      - Results
      operationId: listDocuments
      summary: List processed documents
      description: List all processed documents for the organization, with offset pagination and filters.
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          default: 100
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          default: 0
      - name: status
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/JobStatus'
      - name: document_type
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/DocumentType'
      responses:
        '200':
          description: A page of documents.
          content:
            application/json:
              schema:
                type: object
                properties:
                  documents:
                    type: array
                    items:
                      type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
  /api/v1/documents/{id}/export:
    parameters:
    - $ref: '#/components/parameters/DocumentIdPath'
    get:
      tags:
      - Results
      operationId: exportDocument
      summary: Download the schema-driven Excel export
      description: Multi-sheet Excel for schema-based types — `audited_financial_statement` (17-sheet workbook), `credit_report`, `slik` and others.
      responses:
        '200':
          description: The workbook.
          content:
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                type: string
                format: binary
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /api/v1/documents/{id}/custom-export:
    parameters:
    - $ref: '#/components/parameters/DocumentIdPath'
    get:
      tags:
      - Results
      operationId: customExportDocument
      summary: Download the organization's configured Excel export
      description: Works for all document types where the organization has a custom export schema enabled.
      responses:
        '200':
          description: The workbook.
          content:
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                type: string
                format: binary
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /api/v1/documents/jobs/{documentId}:
    parameters:
    - name: documentId
      in: path
      required: true
      schema:
        type: integer
    get:
      tags:
      - Results
      operationId: getDocumentJob
      summary: Get the processing job for a document
      description: Surfaces per-document cost reporting — `total_cost_usd` and the `cost_report` per-call breakdown (model, prompt/completion tokens, USD per call, stage).
      responses:
        '200':
          description: The job record.
          content:
            application/json:
              schema:
                type: object
                properties:
                  total_cost_usd:
                    type: number
                  cost_report:
                    type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    DocumentResult:
      type: object
      description: Shared envelope for every document type.
      properties:
        status:
          $ref: '#/components/schemas/JobStatus'
        document_type:
          $ref: '#/components/schemas/DocumentType'
        document_id:
          type: integer
        filename:
          type: string
        processing_time_seconds:
          type: number
        uploaded_at:
          type: string
          format: date-time
        metadata:
          type: object
          description: Document-level info — account holder, dates, institution.
        extracted_data:
          type: object
          description: Type-specific extracted content.
        fraud_detection:
          $ref: '#/components/schemas/FraudDetection'
    Error:
      type: object
      properties:
        error:
          type: string
          description: Short error label.
        message:
          type: string
          description: Human-readable description.
    FraudDetection:
      type: object
      description: Fraud and authenticity signals. Present only when data exists.
      properties:
        risk_level:
          type: string
          examples:
          - low
        authenticity_score:
          type: number
        signals:
          type: array
          items:
            type: object
            properties:
              severity:
                type: string
              category:
                type: string
              message:
                type: string
    JobStatus:
      type: string
      enum:
      - pending
      - processing
      - completed
      - failed
    DocumentType:
      type: string
      description: 'Document type slug. Case-insensitive. Three types run the legacy stage-config pipeline

        (`bank_statement`, `audited_financial_statement`, `general_information_sheet`); the rest

        run the universal vocabulary-driven pipeline. Slugs without a dedicated vocabulary fall

        back to the `other_document` extractor.

        '
      enum:
      - bank_statement
      - audited_financial_statement
      - general_information_sheet
      - bank_certificate
      - credit_card_statement
      - loan_statement
      - mobile_banking_screenshot
      - passbook
      - payslip
      - business_financials
      - bill
      - receipt
      - remittance_slip
      - sales_invoice
      - government_id
      - certificate_of_employment
      - barangay_clearance
      - credit_report
      - slik
      - acta_constitutiva
      - mx_legal
      - indo_legal
      - combined_document
      - other_document
      - bir_2303
      - bir_2307
      - tin_id
      - secretarys_certificate
      - business_registration_dti
      - business_registration_sec
      - certificate_of_incorporation
      - business_permit
      - mayors_permit
      - purchase_order
      - bill_of_lading
      - proof_of_billing
      - land_title
      - vehicle_registration
      - insurance_policy
      - loan_agreement
      - income_tax_return
  responses:
    NotFound:
      description: Document or batch ID does not exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Rate limited. Wait and retry; check the `Retry-After` header.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Invalid or missing API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  parameters:
    DocumentIdPath:
      name: id
      in: path
      required: true
      schema:
        type: integer
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'Organization API key prefixed `kita_prod_`, issued from the Kita dashboard at

        https://portal.usekita.com and sent as `Authorization: Bearer <key>`.

        '