DocsREST + Python SDK + portal. Same credit balance across all three.Open the portal
REST API

Kita API

Upload, poll, deliver. The Kita API turns scanned bank statements, payslips, IDs, and tax filings into structured, validated, fraud-checked data — across PH, MX, and ID schemas. Upload a file, pass a URL, or send base64 — get back clean JSON. Supports webhooks for async processing.

Base URLhttps://api.usekita.comAuthBearer tokenFormatJSON / multipart

Quick Start

1. File Upload (multipart)

Upload a local file directly. The Python SDK handles polling automatically.

Terminal

pip install kita

Python

from kita import KitaClient

client = KitaClient(api_key="kita_prod_...")

# Process a document
result = client.process("statement.pdf", "bank_statement")
result.save_json("output.json")

2. File URL (S3 presigned URL / any public URL)

Pass a file_url and Kita fetches the file server-side. Works with S3 presigned URLs, GCS signed URLs, or any publicly accessible link.

Python

from kita import KitaClient

client = KitaClient(api_key="kita_prod_YOUR_API_KEY")

result = client.process_url(
    "https://your-bucket.s3.amazonaws.com/docs/invoice.pdf?X-Amz-...",
    document_type="sales_invoice"
)
print(result.status, result.extracted_data)

3. File URL + Webhook (fire-and-forget)

Add a webhook_url and the request returns immediately. Kita POSTs to your URL when processing completes or fails — no polling needed.

Python

from kita import KitaClient

client = KitaClient(api_key="kita_prod_YOUR_API_KEY")

# Fire-and-forget: returns immediately with document_id
result = client.process_url(
    "https://your-bucket.s3.amazonaws.com/docs/invoice.pdf?X-Amz-...",
    document_type="bank_statement",
    webhook_url="https://your-server.com/webhooks/kita"
)
# Kita POSTs to your webhook_url when processing completes

4. Poll for Results

If you're not using webhooks, poll the job endpoint until status is "completed" or "failed".

Python

# Poll for results (SDK handles this automatically with client.process)
result = client.get_result(document_id)
print(result.status)          # "completed" | "processing" | "failed"
print(result.extracted_data)

Supported file formats: .pdf, .png, .jpg, .jpeg, .tiff, .bmp

Common document types: bank_statement, sales_invoice, credit_report, payslip, bill, general, auto_classify, and more — see Document Types.

Authentication

Every request requires an API key passed in the Authorization header. Get your key from the Kita dashboard.

HTTP Header

Authorization: Bearer kita_prod_your_key_here

Keep your API key secret — never expose it in client-side code or public repositories. Use the KITA_API_KEY environment variable on your server.

Postman

Set up a Postman environment to test any endpoint interactively.

  1. 1Create an environment named Kita API with variables: baseUrl, apiKey, documentId.
  2. 2Set Auth type to Bearer Token, value {{apiKey}}.
  3. 3POST {{baseUrl}}/api/v1/documents — form-data with file (File) + document_type (Text), or JSON body with file_url.
  4. 4GET {{baseUrl}}/api/v1/documents/jobs/{{documentId}} — poll until status: "completed".

Environment Variables

{
  "baseUrl": "https://api.usekita.com",
  "apiKey": "kita_prod_your_key_here",
  "documentId": "12345"
}

Document Types

Pass the document_type field with any upload. Values are case-insensitive.

TypeWhat it extracts
Financial
bank_statementTransactions, balances, flow metrics, category breakdowns, fraud signals
passbookBank passbook — same extraction as bank_statement
credit_card_statementTransactions, balances, payment info
payslipEarnings, deductions, net pay, employer info, statutory IDs, fraud score
billProvider, amounts, due dates, verification signals
sales_invoiceSeller/buyer, line items, totals, VAT, invoice signals
audited_financial_statementMulti-pass extraction: balance sheet, income statement, cash flow, notes/schedules, qualitative data, ratios, completeness scoring, risk flags
loan_statementLoan details, payment schedule, balances
loan_agreementLoan Agreement / Promissory Note — parties, terms, collateral, penalties
Commercial
purchase_orderPO details, line items
receiptReceipt (POS) — items, totals, payment method
bill_of_ladingShipping details, consignee, cargo
remittance_slipRemittance details, amounts
Identity & General
government_idGovernment-Issued ID — name, ID number, dates, photo
certificate_of_employmentEmployer, employee, position, dates, salary
insurance_policyPolicy details, coverage, beneficiaries
proof_of_billingProof of Billing / Address — address verification, billing details
formGeneric form — auto-extracted fields
general_documentAuto-classifies and extracts relevant fields
other_documentGeneric extraction with AI-generated signals
Philippines (PH)
credit_reportPH Credit Report — accounts, KYC, bureau score, payment history, 21-sheet Excel export
bir_2303BIR 2303 — Certificate of Registration, TIN, tax types, RDO
bir_2307BIR 2307 — Creditable Tax Withheld, payor/payee, ATC codes
income_tax_returnIncome Tax Return (1700/1701/1702) — income, deductions, tax computation
certificate_of_registrationBIR Certificate of Registration
business_registration_dtiDTI Business Registration — name, owner, capitalization
business_registration_secSEC Certificate of Registration — incorporators, capital, directors
general_information_sheetGIS — stockholders, directors, officers, beneficial owners, compliance
secretarys_certificateSecretary's Certificate — resolutions, authorized signatories, notarization
certificate_of_incorporationCertificate of Incorporation — registration, capital, incorporators
business_permitBusiness Permit — permit details, business activities, fees
mayors_permitMayor's Permit — permit number, validity, business type, fees
barangay_clearanceBarangay Clearance — residency, good moral character, purpose
tin_idTIN ID Card — TIN, name, address, RDO
sss_ddr_voucherSSS DDR Voucher — member info, claim details, pension, disbursement
land_titleLand Title (TCT/OCT) — owner, property details, encumbrances, tax declaration
vehicle_registrationVehicle Registration (LTO) — owner, vehicle info, encumbrance, fees
Mexico (MX)
acta_constitutivaArticles of Incorporation — shareholders, capital structure, legal reps, notarial info, governance
poder_notarialNotarized Power of Attorney — grantor, representative, power scope, limitations, notarial info
constancia_situacion_fiscalSAT Tax Status Certificate — RFC, taxpayer info, fiscal address, tax regime, obligations
actas_de_asambleaShareholder Meeting Minutes — attendees, agenda, resolutions, capital changes, notarial info
estados_financierosFinancial Statements — balance sheet, income statement, cash flow, ratios, consistency checks
ineINE Voter ID (Credencial para Votar) — clave de elector, CURP, personal info, address
Indonesia (ID)
ktpKTP National ID — NIK, name, address, personal details
npwpNPWP Tax ID — taxpayer number, name, address, tax office
ktp_npwpKTP & NPWP combined — identity + tax in one extraction
slikSLIK Credit Report (OJK) — debtor profile, credit facilities, collateral, collectibility, metrics
nibNIB Business ID (OSS) — company info, KBLI codes, shareholders
akta_pendirianDeed of Establishment — company, capital, shareholders, directors, commissioners
akta_perubahanDeed of Amendment — amendment details, updated capital, board changes
sk_kemenkumhamMinistry of Law Decree — decree number, type, reference deeds
debtor_statement_letterSurat Pernyataan Debitur — loan details, declarations, signatures
client_service_contractKontrak Layanan — contract parties, terms, scope, payment
ar_agingAR Aging Report — aging buckets, receivable line items
cash_flow_projectionCash Flow Projection — monthly inflow/outflow, opening/closing balances

Supported file formats: .pdf, .png, .jpg, .jpeg, .tiff, .bmp

Endpoints

All endpoints are authenticated via Authorization: Bearer <key>. Responses are JSON unless otherwise noted.

MethodPathDescription
POST/api/v1/documentsUpload a file, base64, or URL for processing (supports webhook_url)
GET/api/v1/documents/jobs/{document_id}Retrieve full result by document ID
GET/api/documents/{id}/summary48 summary metrics (bank statements)
GET/api/documents/{id}/custom-exportDownload org-configured Excel export
GET/api/v1/documents/{id}/exportSchema-based Excel export (audited_financial_statement, credit report, SLIK)
GET/api/documentsList documents with optional filters
POST/api/v1/batchCreate a batch job or process from URL
GET/api/v1/batch/{batch_id}Check batch status and progress
GET/api/v1/batch/{batch_id}/resultsGet full results for all batch documents
POST/api/v1/documents/mergeMerge multiple files into one document for processing
PUT/api/v1/documents/{id}/transactionsEdit transactions on a processed document
POST/api/v1/documents/{id}/transactions/revertRestore original extracted transactions
POST/api/v1/documents/{id}/transactions/revalidateRe-run validation and metrics after edits
POST/api/v1/documents

Three input methods — provide exactly one of file, file_base64, or file_url.

ParameterRequiredDescription
file*Multipart file upload (PDF, PNG, JPG)
file_base64*Base64-encoded file content (data URI prefix accepted)
file_url*Public or S3 presigned URL to fetch the file from
filenameRequired with file_base64 and file_url
document_typeYesDocument type (see table above)
passwordNoPDF password if encrypted
webhook_urlNoURL to receive a POST when processing completes or fails
* Provide exactly one of file, file_base64, or file_url.  † filename is inferred from multipart upload but required for base64 and URL inputs.

Option A: File upload (multipart)

Python

result = client.process(
    "statement.pdf",
    "bank_statement",
    wait=True,            # Wait for completion (default: True)
    poll_interval=2,      # Seconds between status checks
    timeout=600,          # Max wait time in seconds
    password=None,        # PDF password if encrypted
    show_progress=True    # Show progress spinner
)
GET/api/v1/documents/jobs/{document_id}

Python

result = client.get_result(12345)
print(result.metadata)
result.save_json("output.json")

Transaction Editing

After a document is processed, you can programmatically edit its transactions, restore the originals, or re-run validation and metrics on edited data. This is useful for correcting OCR errors, re-categorizing transactions, or adjusting values before generating reports.

Transaction editing is available for bank_statement and passbook document types. After editing, call /revalidate to re-compute metrics and fraud signals against the updated transactions.

PUT/api/v1/documents/{id}/transactions

Replace the transaction array on a processed document. Pass the full updated list — this is a full replacement, not a patch.

Python

updated = client.edit_transactions(12345, transactions=[
    {
        "date": "01-02-2024",
        "description": "SALARY CREDIT",
        "credit": 30000.00,
        "debit": None,
        "balance": 80000.00,
        "category": "income",
        "subcategory": "salary",
        "transaction_type": "credit",
    },
])
print(updated.status, updated.transactions_count)
POST/api/v1/documents/{id}/transactions/revert

Discard all edits and restore the original extracted transactions. This also resets metrics and validation to their original state.

Python

reverted = client.revert_transactions(12345)
print(reverted.status, reverted.transactions_count)
POST/api/v1/documents/{id}/transactions/revalidate

Re-run validation checks and re-compute all metrics (inflow/outflow, category breakdowns, extended metrics) and fraud signals against the current transaction data. Call this after editing transactions.

Python

result = client.revalidate_transactions(12345)
print(result.status)
print(result.metrics)  # re-computed metrics

Typical workflow: PUT /transactions to edit → POST /revalidate to re-compute → GET /results/{id} to fetch updated output. Use POST /revert at any time to undo all edits.

Python SDK

Install with pip install kita. The SDK wraps all HTTP endpoints, handles polling, and returns typed DocumentResult objects.

Python

# Pass directly
client = KitaClient(api_key="kita_prod_...")

# Or set environment variable
# export KITA_API_KEY=kita_prod_...
client = KitaClient()

Serialize results with result.to_dict(), result.to_json(), or result.save_json(path).


Response Schemas

Philippines (PH) Document Schemas

PH

Region-specific document types for the Philippine market. Uses the same POST /api/v1/documents endpoint — just pass the PH document_type.

Mexico (MX) Document Schemas

MX

Region-specific document types for the Mexican market. Uses the same POST /api/v1/documents endpoint — just pass the Mexican document_type.

Indonesia (ID) Document Schemas

ID

Region-specific document types for the Indonesian market. Uses the same POST /api/v1/documents endpoint — just pass the Indonesian document_type.


Download Export

Download Excel exports of processed documents. Two export modes are available: org-configured exports (all document types) and schema-based exports (audited_financial_statement, credit report, SLIK, and other schema-based types).

EndpointUse case
/api/documents/{id}/custom-exportOrg-configured Excel format (works for all document types)
/api/documents/{id}/credit-report-exportMulti-sheet credit report Excel (credit reports only)
/api/v1/documents/{id}/exportSchema-based multi-sheet Excel (audited_financial_statement, credit report, SLIK, etc.)
GET/api/v1/documents/{id}/export

Download a multi-sheet Excel workbook using the document's type-specific schema. For audited_financial_statement documents, this generates a 17-sheet workbook covering company info, balance sheet, income statement, cash flow, notes, ratios, risk flags, data validation, prior year comparison, shareholders, equity, tax, and more.

Python

# Org-configured export
client.custom_export(result.document_id, "report.xlsx")

# Credit report multi-sheet export
client.custom_export(result.document_id, "credit.xlsx", export_type="credit_report")

# Schema-based export (audited_financial_statement 17-sheet workbook, credit report, SLIK, etc.)
client.custom_export(result.document_id, "financial_report.xlsx", export_type="schema")

If the document type has no export schema, the /export endpoint returns 400 with error code INVALID_EXPORT_TYPE. If the document hasn't finished processing, it returns DOCUMENT_NOT_PROCESSED.

Webhooks

Instead of polling GET /api/v1/documents/jobs/{document_id}, pass a webhook_url when uploading. Kita will POST to that URL when processing completes or fails.

webhook_url is accepted on all three input methods (file, file_base64, file_url). The upload returns immediately with document_id + status: "processing".

Payload: document.completed

The completed payload includes extracted_data inline so you can process results immediately, plus a result_url to fetch the full result later.

JSON

{
  "event": "document.completed",
  "document_id": 12345,
  "status": "completed",
  "document_type": "bank_statement",
  "file_name": "statement.pdf",
  "processing_time_seconds": 12.5,
  "extracted_data": { "..." : "..." },
  "result_url": "/api/v1/documents/jobs/12345"
}

Payload: document.failed

JSON

{
  "event": "document.failed",
  "document_id": 12345,
  "status": "failed",
  "error": "Password-protected PDF — provide password parameter",
  "document_type": "bank_statement",
  "file_name": "statement.pdf",
  "failed_at": "2025-06-15T10:30:05Z"
}

S3 + webhook (fire-and-forget)

Python

result = client.process_url(
    "https://my-bucket.s3.amazonaws.com/docs/statement.pdf?X-Amz-...",
    "bank_statement",
    webhook_url="https://api.yourapp.com/webhooks/kita"
)
# Returns immediately with document_id + status="processing"
# Kita POSTs to your webhook_url when done

Batch Processing

Process up to 100 documents in a single request. Requires a paid plan. Use POST /api/v1/batch to create a job, then poll GET /api/v1/batch/{batch_id} for status.

HTTP API

Create a batch job with document URLs, then poll for progress and retrieve results.

cURL

curl -X POST https://api.usekita.com/api/v1/batch \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "documents": [
      { "file_url": "https://example.com/stmt1.pdf", "document_type": "bank_statement" },
      { "file_url": "https://example.com/stmt2.pdf", "document_type": "bank_statement" },
      { "file_url": "https://example.com/payslip.pdf", "document_type": "payslip" }
    ]
  }'
MethodPathDescription
POST/api/v1/batchCreate batch — pass documents array with file_url + document_type
GET/api/v1/batch/{batch_id}Poll status, progress_percent, per-document state
GET/api/v1/batch/{batch_id}/resultsGet full extracted data for all documents

Python SDK

Three input modes — toggle between them. All return the same result structure.

From Folder

batch = client.batch_process(
    "/path/to/statements",
    "bank_statement",
    extensions=['.pdf', '.png', '.jpg'],  # Default file types
    recursive=False,                       # Search subdirectories
    max_workers=5                          # Parallel upload threads
)

results = batch.results()  # {filepath: DocumentResult}

for filepath, result in results.items():
    print(f"{filepath}: {result.status}")
    result.save_json(f"{filepath}_output.json")

From Folder accepts extensions (default ['.pdf','.png','.jpg']), recursive (default False), and max_workers (default 5). From Base64 requires file_base64, filename, and document_type per item.

Merge Documents

Combine multiple images or PDFs into a single document before processing. Useful for multi-page documents scanned as separate images (e.g. a bank statement photographed page by page). Each file in the files list can specify a file_url, file_path (SDK only, auto-converted to base64), or file_base64 — and they can be mixed freely.

HTTP API

POST/api/v1/documents/merge

Send a JSON body with an array of files to merge and process as a single document. The API is deployed on AWS (ALB) and proxied through Vercel rewrites from api.usekita.com.

FieldTypeRequiredDescription
filesarrayYesArray of objects, each with a file_url, file_path, or file_base64 key
document_typestringYesTarget document type for the merged result (e.g. bank_statement)
output_filenamestringNoCustom filename for the merged PDF (default: auto-generated)

cURL

curl -X POST https://api.usekita.com/api/v1/documents/merge \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  -d '{
    "files": [
      { "file_url": "https://example.com/page1.pdf" },
      { "file_url": "https://example.com/page2.pdf" }
    ],
    "document_type": "bank_statement",
    "output_filename": "merged_document.pdf"
  }'

Python SDK

The SDK merge_documents method accepts mixed input types — URLs, local file paths, and base64 strings — in a single call.

Python

result = client.merge_documents(
    files=[
        {"file_url": "https://example.com/cover.pdf"},
        {"file_path": "/path/to/scan.png"},
        {"file_base64": "iVBORw0KGgo...", "filename": "page3.png"},
    ],
    document_type="bank_statement",
)

The merged file is processed as a single document. Poll GET /api/v1/documents/jobs/{document_id} with the returned document_id to retrieve the extracted result.

Error Handling

HTTP Status Codes

StatusMeaningWhat to do
200SuccessParse the JSON response
202AcceptedDocument queued — poll for results
400Bad RequestCheck your request body / parameters
401UnauthorizedInvalid or missing API key
403ForbiddenUpgrade required, or document type not enabled for your org
404Not FoundDocument or batch ID doesn't exist
429Rate LimitedWait and retry. Check Retry-After header.
500Server ErrorRetry after a brief delay

Error Response Format

JSON

{
  "error": "Bad Request",
  "message": "documents array is required and must not be empty"
}

Python Exceptions

Python

from kita import (
    KitaClient,
    KitaError,
    KitaAPIError,
    KitaAuthenticationError,
    KitaRateLimitError
)

try:
    result = client.process("doc.pdf", "bank_statement")
except KitaAuthenticationError:
    print("Invalid API key")
except KitaRateLimitError as e:
    print(f"Rate limited. Retry after {e.retry_after}s")
except KitaAPIError as e:
    print(f"API Error {e.status_code}: {e.message}")
except KitaError as e:
    print(f"SDK Error: {e}")

Questions? Email support@usekita.com