Kita Documents API

Borrower document upload and extraction.

OpenAPI Specification

kita-documents-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Kita Capture Applications Documents 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: Documents
  description: Borrower document upload and extraction.
paths:
  /applications/{id}/documents:
    parameters:
    - $ref: '#/components/parameters/ApplicationId'
    post:
      tags:
      - Documents
      operationId: uploadDocuments
      summary: Upload borrower documents
      description: Upload one or more files as multipart/form-data. Each file's extraction pipeline runs after the response returns.
      x-scope: write
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                files:
                  type: array
                  items:
                    type: string
                    format: binary
      responses:
        '201':
          description: Documents accepted for processing.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Document'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
    get:
      tags:
      - Documents
      operationId: listDocuments
      summary: List documents on an application
      x-scope: read
      parameters:
      - name: include
        in: query
        required: false
        description: Pass `download_url` to add signed download URLs valid for one hour.
        schema:
          type: string
          enum:
          - download_url
      responses:
        '200':
          description: The documents on this application.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Document'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /applications/{id}/documents/{docId}:
    parameters:
    - $ref: '#/components/parameters/ApplicationId'
    - $ref: '#/components/parameters/DocumentId'
    get:
      tags:
      - Documents
      operationId: getDocument
      summary: Get a document
      description: Returns the document plus the structured `kita_raw` extraction, `recommendations`, and `inconsistencies`.
      x-scope: read
      responses:
        '200':
          description: The document and its extraction.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Document'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      tags:
      - Documents
      operationId: deleteDocument
      summary: Delete a document
      description: Deletes the file and recomputes file completeness.
      x-scope: write
      responses:
        '200':
          description: Deleted.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  responses:
    Forbidden:
      description: Valid key lacks the required scope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found in this organization.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: Malformed body, missing fields, or bad parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing, malformed, unknown, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        message:
          type: string
          description: Human-readable description of the error.
      required:
      - message
    Document:
      type: object
      properties:
        id:
          type: string
        status:
          $ref: '#/components/schemas/DocumentStatus'
        download_url:
          type: string
          format: uri
          description: Signed URL
          valid one hour. Present when `include=download_url`.: null
        kita_raw:
          type: object
          description: Structured extraction output.
        recommendations:
          type: array
          items:
            type: object
        inconsistencies:
          type: array
          items:
            type: object
    DocumentStatus:
      type: string
      enum:
      - awaiting
      - processing
      - verified
      - low_confidence
      - missing
  parameters:
    ApplicationId:
      name: id
      in: path
      required: true
      description: Application UUID or human `app_id` (e.g. `APP-1234`).
      schema:
        type: string
    DocumentId:
      name: docId
      in: path
      required: true
      description: Document identifier.
      schema:
        type: string
  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>`.

        '