Back to Documentation

API Reference

Complete API endpoint documentation with cURL and Postman examples

Base URL: http://149.102.159.66:8000
Replace with your production URL in production environments.

Authentication Endpoints

User Login

POST/auth/loginAuth: None (Public)

Authenticate a user and receive a JWT access token. The token should be stored and used for subsequent authenticated requests.

Headers

HeaderValueRequired
Content-Typetext/plain (TOON format)Required
Accepttext/plainRequired

Request Body

FieldTypeRequiredDescription
emailstringRequiredUser's email address
passwordstringRequiredUser's password

Example:

email:"user@example.com"
password:"yourpassword123"

cURL Example

curl -X POST "http://149.102.159.66:8000/auth/login" \
  -H "Content-Type: text/plain" \
  -H "Accept: text/plain" \
  -d 'email:"user@example.com"
password:"yourpassword123"'
📮Postman Configuration
POST
http://149.102.159.66:8000/auth/login
Send
Headers
Body
✓KEYVALUE
✓Content-Typetext/plain (TOON format)
✓Accepttext/plain
email:"user@example.com"
password:"yourpassword123"
Quick Steps: 1. Set method to POST → 2. URL: http://149.102.159.66:8000/auth/login → 3. Headers Tab:

Response Example (200 OK)

access_token:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
token_type:"bearer"
user_type:"standard"
roles:["user"]

User Registration

POST/users/registerAuth: None (Public)

Create a new user account. After registration, the user can login to receive an access token.

Headers

HeaderValueRequired
Content-Typetext/plain (TOON format)Required
Accepttext/plainRequired

Request Body

FieldTypeRequiredDescription
first_namestringRequiredUser's first name
last_namestringRequiredUser's last name
emailstringRequiredUser's email address
passwordstringRequiredPassword (min 8 characters)

Example:

first_name:"John"
last_name:"Doe"
email:"john.doe@example.com"
password:"securepassword123"

cURL Example

curl -X POST "http://149.102.159.66:8000/users/register" \
  -H "Content-Type: text/plain" \
  -H "Accept: text/plain" \
  -d 'first_name:"John"
last_name:"Doe"
email:"john.doe@example.com"
password:"securepassword123"'
📮Postman Configuration
POST
http://149.102.159.66:8000/users/register
Send
Headers
Body
✓KEYVALUE
✓Content-Typetext/plain (TOON format)
✓Accepttext/plain
first_name:"John"
last_name:"Doe"
email:"john.doe@example.com"
password:"securepassword123"
Quick Steps: 1. Set method to POST → 2. URL: http://149.102.159.66:8000/users/register → 3. Headers Tab:

Response Example (200 OK)

message:"User registered successfully"
user:{
  id:"uuid-xxx-xxx"
  email:"john.doe@example.com"
  first_name:"John"
  last_name:"Doe"
  api_key:"ak_xxxxxxxxxxxxxx"
}

User Logout

POST/auth/logoutAuth: JWT Bearer Token

Invalidate the current user session. The JWT token will be blacklisted.

Headers

HeaderValueRequired
AuthorizationBearer YOUR_JWT_TOKENRequired

cURL Example

curl -X POST "http://149.102.159.66:8000/auth/logout" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
📮Postman Configuration
POST
http://149.102.159.66:8000/auth/logout
Send
Authorization
Headers
Type:
Token:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
✓KEYVALUE
✓AuthorizationBearer YOUR_JWT_TOKEN
Quick Steps: 1. Set method to POST → 2. URL: http://149.102.159.66:8000/auth/logout → 3. Authorization Tab → Type: Bearer Token → Enter your JWT token

Response Example (200 OK)

message:"Logged out successfully"

User Endpoints

Get User Profile

GET/users/profileAuth: JWT Bearer Token

Retrieve the current authenticated user's profile information including their API key.

Headers

HeaderValueRequired
AuthorizationBearer YOUR_JWT_TOKENRequired
Content-Typetext/plainOptional
Accepttext/plainOptional

cURL Example

curl -X GET "http://149.102.159.66:8000/users/profile" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Accept: text/plain"
📮Postman Configuration
GET
http://149.102.159.66:8000/users/profile
Send
Authorization
Headers
Type:
Token:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
✓KEYVALUE
✓AuthorizationBearer YOUR_JWT_TOKEN
✓Content-Typetext/plain
✓Accepttext/plain
Quick Steps: 1. Set method to GET → 2. URL: http://149.102.159.66:8000/users/profile → 3. Authorization Tab → Type: Bearer Token → Enter your JWT token

Response Example (200 OK)

id:"uuid-xxx-xxx"
email:"john.doe@example.com"
first_name:"John"
last_name:"Doe"
api_key:"ak_xxxxxxxxxxxxxxxxxxxxxx"
user_type:"standard"
roles:["user"]
created_at:"2025-01-20T10:30:00Z"

S3 Upload API Endpoints

Complete request and response guide for S3-based document ingestion.

Base URL

https://your-api-domain/v1/documents

Authentication

All endpoints require API Key authentication via the X-API-Key header.

X-API-Key: YOUR_API_KEY

Response Format

All responses are encoded in toon format and returned with Content-Type set to text/plain.

1. Upload Document (Single File)

Submit a single document by S3 URL and specify the document type for downstream extraction.

POSTPOST /upload-documentAuth: X-API-Key

Request

POST /v1/documents/upload-document
Content-Type: application/json
X-API-Key: YOUR_API_KEY

{
  "s3_url": "https://bucket.s3.us-east-1.amazonaws.com/documents/invoice.pdf",
  "document_type": "InvoicePDF"
}

Parameters

FieldDescription
s3_url (required)Full S3 URL to the document.
document_type (required)One of: ReceiptPDF, ReceiptImage, InvoicePDF, InvoiceImage.

Success Response (200)

status: pending
request_id: req_abc123def456
filename: invoice.pdf
file_size: 245632
message: S3 document downloaded and queued for processing.
submitted_at: 2026-03-14T10:30:45.123456

Error Responses

Missing s3_url (400)
error: s3_url is required
Missing document_type (400)
error: document_type is required
Invalid S3 URL (400)
error: Could not parse S3 URL
S3 Download Failed (400)
error: S3 download failed
📮Postman Configuration
POST
http://149.102.159.66:8000/v1/documents/upload-document
Send
Headers
Body
✓KEYVALUE
✓X-API-KeyYOUR_API_KEY
✓Content-Typeapplication/json
{
  "s3_url": "https://bucket.s3.us-east-1.amazonaws.com/documents/invoice.pdf",
  "document_type": "InvoicePDF"
}
Quick Steps: 1. Set method to POST 2. URL: http://149.102.159.66:8000/v1/documents/upload-document 3. Headers Tab: - X-API-Key: your_api_key - Content-Type: application/json 4. Body Tab → Select raw → JSON 5. Paste the JSON body with s3_url and document_type

2. Process Bank Statement

Queue a PDF bank statement directly from S3 for asynchronous processing.

POSTPOST /process-bank-statementAuth: X-API-Key

Request

POST /v1/documents/process-bank-statement
Content-Type: application/json
X-API-Key: YOUR_API_KEY

{
  "s3_url": "https://bucket.s3.us-east-1.amazonaws.com/statements/statement_2026_03.pdf"
}

Parameters

FieldDescription
s3_url (required)Full S3 URL to a PDF bank statement file.
PDF validationThe URL must end with .pdf and point to an AWS S3 object.

Success Response (200)

status: pending
request_id: req_xyz789abc123
filename: statement_2026_03.pdf
file_size: 512048
message: Bank statement from S3 downloaded and queued for processing.
submitted_at: 2026-03-14T11:15:30.654321

Error Responses

Missing s3_url (400)
error: s3_url is required
Not a PDF file (400)
error: S3 URL must point to a PDF file
Invalid URL format (400)
error: Could not parse S3 URL
S3 Access Failed (400)
error: S3 download failed
📮Postman Configuration
POST
http://149.102.159.66:8000/v1/documents/process-bank-statement
Send
Headers
Body
✓KEYVALUE
✓X-API-KeyYOUR_API_KEY
✓Content-Typeapplication/json
{
  "s3_url": "https://bucket.s3.us-east-1.amazonaws.com/statements/statement_2026_03.pdf"
}
Quick Steps: 1. Set method to POST 2. URL: http://149.102.159.66:8000/v1/documents/process-bank-statement 3. Headers Tab: - X-API-Key: your_api_key - Content-Type: application/json 4. Body Tab → Select raw → JSON 5. Paste the JSON body with the PDF s3_url

3. Bulk Upload Files

Process up to 50 S3 objects in one batch and return per-file outcomes in the results array.

POSTPOST /bulk-upload-filesAuth: X-API-Key

Request

POST /v1/documents/bulk-upload-files
Content-Type: application/json
X-API-Key: YOUR_API_KEY

{
  "s3_urls": [
    "https://bucket.s3.us-east-1.amazonaws.com/invoices/inv_001.pdf",
    "https://bucket.s3.us-east-1.amazonaws.com/invoices/inv_002.pdf",
    "https://bucket.s3.us-east-1.amazonaws.com/receipts/receipt_001.jpg"
  ],
  "document_type": "InvoicePDF"
}

Parameters

FieldDescription
s3_urls (required)Array of S3 URLs. Maximum 50 files per request.
document_type (required)One of: ReceiptPDF, ReceiptImage, InvoicePDF, InvoiceImage. Applied to all files in the batch.

Success Response (200)

status: completed
total_files: 3
successful_uploads: 2
failed_uploads: 1
request_ids[0]: req_inv001_abc123
request_ids[1]: req_inv002_def456
results[0]:
  filename: inv_001.pdf
  request_id: req_inv001_abc123
  status: pending
  file_size: 128456
  error_message: ""
results[1]:
  filename: inv_002.pdf
  request_id: req_inv002_def456
  status: pending
  file_size: 145230
  error_message: ""
results[2]:
  filename: receipt_001.jpg
  request_id: req_receipt001_ghi789
  status: failed
  file_size: 0
  error_message: S3 download failed
message: Processed 2 files successfully, 1 failed
submitted_at: 2026-03-14T12:00:15.987654

Error Responses

Missing s3_urls (400)
error: s3_urls array is required
Missing document_type (400)
error: document_type is required
Empty s3_urls array (400)
error: s3_urls array is required
Too many files (400)
error: Maximum 50 files allowed per bulk upload
📮Postman Configuration
POST
http://149.102.159.66:8000/v1/documents/bulk-upload-files
Send
Headers
Body
✓KEYVALUE
✓X-API-KeyYOUR_API_KEY
✓Content-Typeapplication/json
{
  "s3_urls": [
    "https://bucket.s3.us-east-1.amazonaws.com/invoices/inv_001.pdf",
    "https://bucket.s3.us-east-1.amazonaws.com/invoices/inv_002.pdf",
    "https://bucket.s3.us-east-1.amazonaws.com/receipts/receipt_001.jpg"
  ],
  "document_type": "InvoicePDF"
}
Quick Steps: 1. Set method to POST 2. URL: http://149.102.159.66:8000/v1/documents/bulk-upload-files 3. Headers Tab: - X-API-Key: your_api_key - Content-Type: application/json 4. Body Tab → Select raw → JSON 5. Paste the JSON body with s3_urls and document_type

4. Unified Upload (Classification)

Classify a batch of S3-backed files, optionally enriched with document metadata.

POSTPOST /v1/documents/unified-uploadAuth: X-API-Key

Request

POST /v1/documents/unified-upload
Content-Type: application/json
X-API-Key: YOUR_API_KEY

{
  "s3_urls": [
    "https://bucket.s3.us-east-1.amazonaws.com/documents/doc1.pdf",
    "https://bucket.s3.us-east-1.amazonaws.com/documents/doc2.jpg"
  ]
}

Parameters

FieldDescription
s3_urls (required)Array of S3 URLs. Maximum 10 files for unified classification.
document_type (optional)Pre-specified document type.
document_id (optional)Custom document identifier.
environment (optional)Environment context.

Success Response (200)

status: completed
results[0]:
  filename: doc1.pdf
  document_type: invoice
  confidence: 0.9847
  status: completed
results[1]:
  filename: doc2.jpg
  document_type: receipt
  confidence: 0.8765
  status: completed
total_files: 2
successful: 2
failed: 0
message: Classification completed
submitted_at: 2026-03-14T13:45:20.345678

Error Responses

Empty s3_urls (400)
error: s3_urls list cannot be empty
Too many files (400)
error: Maximum 10 files per batch. You provided: 15
Invalid S3 URL format (400)
error: Invalid S3 URL format: https://invalid-url.com/file.pdf
📮Postman Configuration
POST
http://149.102.159.66:8000/v1/documents/unified-upload
Send
Headers
Body
✓KEYVALUE
✓X-API-KeyYOUR_API_KEY
✓Content-Typeapplication/json
{
  "s3_urls": [
    "https://bucket.s3.us-east-1.amazonaws.com/documents/doc1.pdf",
    "https://bucket.s3.us-east-1.amazonaws.com/documents/doc2.jpg"
  ]
}
Quick Steps: 1. Set method to POST 2. URL: http://149.102.159.66:8000/v1/documents/unified-upload 3. Headers Tab: - X-API-Key: your_api_key - Content-Type: application/json 4. Body Tab → Select raw → JSON 5. Paste the JSON body with s3_urls and optional metadata fields

Check Request Status

GET/v1/requests/{request_id}Auth: X-API-Key

Poll this endpoint to check the processing status of a document. Returns extracted data when processing is complete.

Headers

HeaderValueRequired
X-API-KeyYOUR_API_KEYRequired

cURL Example

curl -X GET "http://149.102.159.66:8000/v1/requests/req_abc123xyz" \
  -H "X-API-Key: YOUR_API_KEY"
📮Postman Configuration
GET
http://149.102.159.66:8000/v1/requests/{request_id}
Send
Authorization
Headers
Type:
Key:X-API-Key
Value:ak_xxxxxxxxxxxxxx
Add to:Header
✓KEYVALUE
✓X-API-KeyYOUR_API_KEY
Quick Steps: 1. Set method to GET → 2. URL: http://149.102.159.66:8000/v1/requests/{request_id} → 3. Replace {request_id} with actual ID

Response Example (200 OK)

request_id:"req_abc123xyz"
status:"completed"
processing_time_ms:2500
result_data:{
  invoice_number:"INV-2025-001"
  vendor_name:"ABC Supplies Co."
  date:"2025-01-20"
  total_amount:1250.00
  currency:"USD"
  line_items:[
    {description:"Office Supplies" quantity:10 unit_price:50.00 amount:500.00}
    {description:"Paper" quantity:5 unit_price:150.00 amount:750.00}
  ]
}

WebSocket Request Status Stream

WS/v1/ws/statusAuth: X-API-Key

Overview

The /v1/ws/status WebSocket endpoint provides real-time status updates for document processing requests. Unlike REST polling, this endpoint maintains a persistent connection and pushes updates to your client whenever request status changes, eliminating the need for repeated queries.

When to use: Use WebSocket for interactive user dashboards, progress tracking, or real-time notifications. Use REST polling for batch processing or stateless API integrations.

Connection Details

URL:

ws://149.102.159.66:8000/v1/ws/status
wss://149.102.159.66:8000/v1/ws/status  # Production with TLS

Authentication:

Pass your API key via the X-API-Key header before connection:

X-API-Key: <your_api_key>

Connection Lifecycle:

  1. Client initiates WebSocket handshake with X-API-Key header
  2. Server validates API key; closes with code 1008 if invalid
  3. On success, server sends action: connection acknowledgment
  4. Client can now subscribe to request IDs
  5. Server closes connection on auth error, 5-minute inactivity, or explicit disconnect

Client → Server Messages

Clients send JSON messages to control subscriptions and health checks:

Subscribe to Request Updates

Start tracking status updates for a specific request ID.

{
  "action": "subscribe",
  "request_id": "req_32e69baba8054d018cb5c31f034eca52"
}

Unsubscribe from Request Updates

Stop tracking a request (server auto-unsubscribes on terminal status).

{
  "action": "unsubscribe",
  "request_id": "req_32e69baba8054d018cb5c31f034eca52"
}

Keepalive Check (Ping)

Send periodically to prevent inactivity timeout. Server responds with pong.

{
  "action": "ping"
}
ActionRequired FieldsPurpose
subscriberequest_idStart receiving updates for a request
unsubscriberequest_idStop tracking a request
ping—Keepalive; server responds with pong

Server → Client Messages

The server sends control messages and status events to connected clients:

Connection Acknowledgment

Sent immediately after successful authentication.

{
  "action": "connection",
  "status": "connected",
  "message": "Authentication successful. Ready to subscribe."
}

Snapshot Event

Current request state sent immediately upon subscription.

{
  "event": "snapshot",
  "request_id": "req_32e69baba8054d018cb5c31f034eca52",
  "status": "PROCESSING",
  "message": "processing",
  "submitted_at": "2026-03-16T10:00:00Z",
  "completed_at": null,
  "processing_time_ms": null,
  "result_data": null,
  "formatted_result": null,
  "error_message": null,
  "is_terminal": false
}

Update Event

Sent whenever request status or result changes.

{
  "event": "update",
  "request_id": "req_32e69baba8054d018cb5c31f034eca52",
  "status": "COMPLETED",
  "message": "completed",
  "submitted_at": "2026-03-16T10:00:00Z",
  "completed_at": "2026-03-16T10:01:23Z",
  "processing_time_ms": 83420,
  "result_data": {
    "document_type": "invoice",
    "fields": {
      "invoice_number": "INV-1009",
      "amount": "1200.00",
      "vendor": "Acme Corp"
    }
  },
  "formatted_result": {
    "summary": "Invoice INV-1009 from Acme Corp",
    "amount": "$1,200.00"
  },
  "error_message": null,
  "is_terminal": true
}

Heartbeat Event

Sent every ~5 seconds when no state changes have occurred. Confirms connection is alive.

{
  "event": "heartbeat",
  "request_id": "req_32e69baba8054d018cb5c31f034eca52",
  "status": "PROCESSING",
  "message": "processing",
  "submitted_at": "2026-03-16T10:00:00Z",
  "completed_at": null,
  "processing_time_ms": null,
  "result_data": null,
  "formatted_result": null,
  "error_message": null,
  "is_terminal": false
}

Subscribe Acknowledgment

Confirms subscription success or failure before snapshot is sent.

{
  "action": "ack",
  "request_id": "req_32e69baba8054d018cb5c31f034eca52",
  "success": true,
  "message": "Subscription created"
}

Pong Response

Server response to client ping, includes server timestamp.

{
  "action": "pong",
  "timestamp": 1710581325.123
}

Per-Request Error Event

Sent when a request operation fails (e.g., permission denied, not found).

{
  "action": "error",
  "request_id": "req_32e69baba8054d018cb5c31f034eca52",
  "error": "Request not found or access denied"
}

Unknown Action Error

Sent when client sends unrecognized action.

{
  "action": "error",
  "error": "Unknown action: invalid_action"
}
Message TypeWhen SentPurpose
connectionAfter successful authConfirms connection ready
snapshotImmediately on subscribeCurrent request state
updateWhen status/result changesLive status updates
heartbeatEvery ~5s (idle)Confirms socket is active
ackAfter subscribe/unsubscribeOperation confirmation
pongIn response to pingKeepalive response
errorOn request or action failureError details

Full Field Reference

Every RequestStatusEvent (snapshot, update, heartbeat) contains these fields:

FieldTypeAlways PresentDescription
eventstringYesOne of: "snapshot" | "update" | "heartbeat"
request_idstringYesUnique identifier for the request being tracked
statusstringYesProcessing status (see Status Values section)
messagestringYesHuman-readable lowercase status label (e.g., "processing", "completed"). Use for UI display.
submitted_atISO 8601YesWhen the request was submitted (e.g., "2026-03-16T10:00:00Z")
completed_atISO 8601 | nullYesWhen processing completed (null if still processing)
processing_time_msinteger | nullYesWall-clock milliseconds from submission to completion (null while processing)
result_dataobject | nullYesRaw unprocessed result output (available only when status === "COMPLETED")
formatted_resultobject | nullYesPost-processed, display-ready result (available only when status === "COMPLETED"). Prefer this over result_data for UI rendering.
error_messagestring | nullYesError details (populated only when status === "FAILED")
is_terminalbooleanYesTrue if status is terminal (COMPLETED, FAILED, CANCELLED, TIMEOUT). After a terminal event, the server auto-unsubscribes.

Timing Behavior

The server follows strict timing intervals for polling and keepalive:

Poll Interval: 1.5 seconds

Server checks request status every 1.5 seconds. If status has changed since the last check, an update event is sent.

Heartbeat Interval: 5.0 seconds

If no status change occurs within ~5 seconds, a heartbeat event is sent (with current state). This confirms the connection is alive without broadcasting false updates.

Event Type Selection

  • update: Sent when status or result changed (detected on poll interval)
  • heartbeat: Sent when nothing changed for 5 seconds (keepalive signal)

Error Handling

WebSocket Close Codes

1008 — Policy Violation

JWT authentication failed or expired. Reconnect with a valid token.

1011 — Internal Error

Unexpected server error. Check server logs and retry with exponential backoff.

1000 — Normal Closure

Expected disconnect after all subscriptions completed, or client-initiated close.

Per-Request Errors

If a subscribe/unsubscribe fails, server sends an error event instead of an ack:

{
  "action": "error",
  "request_id": "req_32e69baba8054d018cb5c31f034eca52",
  "error": "Request not found or access denied"
}

Distinguishing Errors

  • Connection-level: WebSocket close frame (code 1008/1011) → auth or server failure
  • Request-level: action: error JSON message → subscribe/unsubscribe failed for that request ID

Reconnection Guide

Best practices for handling disconnections and recovering active subscriptions:

1. Track Active Subscriptions

Maintain a set of currently active request IDs on the client side.

2. Exponential Backoff on Reconnect

Start with 1 second, then 2s, 4s, 8s, etc., up to 60s. Prevents thundering herd on server restart.

3. Re-subscribe After Reconnect

Once the new WebSocket is open, re-issue subscribe messages for all active request IDs. The server will send fresh snapshots.

4. Deduplicate Snapshots

If a snapshot arrives after you've already received updates for that request, ignore the snapshot (compare timestamps or version numbers).

5. Heartbeat Timeout

If no message arrives for 15+ seconds, close and reconnect. Don't wait forever.

Testing in Postman

📮Postman WebSocket Configuration
WS
ws://149.102.159.66:8000/v1/ws/status
Connect
Headers
✓KEYVALUE
✓X-API-Keyyour_api_key

Step 1: Paste your API key in the X-API-Key header

Step 2: Click Connect to establish WebSocket connection

Step 3: Send subscription message in Message tab:

{
  "action": "subscribe",
  "request_id": "req_example_id"
}

Step 4: Observe snapshot, update, and heartbeat events

Voice Tools Endpoints

Text to Speech

POST/v1/voice/text-to-speechAuth: API Key

Convert text to speech audio. Returns base64 encoded audio data. Maximum text length is 5000 characters.

Headers

HeaderValueRequired
X-API-KeyYOUR_API_KEYRequired
Content-Typetext/plain (TOON format)Required

Request Body

FieldTypeRequiredDescription
textstringRequiredText to convert to speech (max 5000 chars)
languagestringOptionalLanguage code (default: 'en')

Example:

text:"Hello, this is a text to speech demo."
language:"en"

cURL Example

curl -X POST "http://149.102.159.66:8000/v1/voice/text-to-speech" \
  -H "X-API-Key: ak_xxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: text/plain" \
  -d 'text:"Hello, this is a text to speech demo."
language:"en"'
📮Postman Configuration
POST
http://149.102.159.66:8000/v1/voice/text-to-speech
Send
Authorization
Headers
Body
Type:
Key:X-API-Key
Value:ak_xxxxxxxxxxxxxx
Add to:Header
✓KEYVALUE
✓X-API-KeyYOUR_API_KEY
✓Content-Typetext/plain (TOON format)
text:"Hello, this is a text to speech demo."
language:"en"
Quick Steps: 1. Set method to POST → 2. URL: http://149.102.159.66:8000/v1/voice/text-to-speech → 3. Headers Tab:

Response Example (200 OK)

audio:"UklGRiQA..." (base64 encoded audio)
mimeType:"audio/mpeg"
duration:"2.5s"
processing_time:"0.8s"
model:"tts-1"
voice:"default"

Speech to Text

POST/v1/voice/speech-to-textAuth: API Key

Convert audio to text transcription. Supports WAV, MP3, OGG, M4A, FLAC, WEBM formats. Maximum file size is 10MB.

Headers

HeaderValueRequired
X-API-KeyYOUR_API_KEYRequired
Content-Typemultipart/form-dataRequired

Request Body

FieldTypeRequiredDescription
audiofileRequiredAudio file (WAV, MP3, OGG, M4A, FLAC, WEBM - max 10MB)

cURL Example

curl -X POST "http://149.102.159.66:8000/v1/voice/speech-to-text" \
  -H "X-API-Key: ak_xxxxxxxxxxxxxxxxxxxxxx" \
  -F "audio=@/path/to/recording.wav"
📮Postman Configuration
POST
http://149.102.159.66:8000/v1/voice/speech-to-text
Send
Authorization
Headers
Body
Type:
Key:X-API-Key
Value:ak_xxxxxxxxxxxxxx
Add to:Header
✓KEYVALUE
✓X-API-KeyYOUR_API_KEY
✓Content-Typemultipart/form-data
✓audioSelect File
Quick Steps: 1. Set method to POST → 2. URL: http://149.102.159.66:8000/v1/voice/speech-to-text → 3. Headers Tab:

Response Example (200 OK)

text:"This is the transcribed text from the audio file."
language:"en"
confidence:0.95
duration:"5.2s"
processing_time:"1.2s"
model:"whisper"

History Endpoints

Get Document History

GET/v1/history/documentsAuth: API Key

Retrieve paginated document processing history including bank statements, invoices, and receipts. Supports filtering by document type, status, and date range.

Headers

HeaderValueRequired
X-API-KeyYOUR_API_KEYRequired
Accepttext/plainOptional

Request Body

FieldTypeRequiredDescription
pageintegerOptionalPage number (default: 1)
page_sizeintegerOptionalItems per page (default: 20, max: 100)
document_typestringOptionalFilter by type: BankStatement, Receipt, Invoice
status_filterstringOptionalFilter by status: COMPLETED, FAILED, PENDING, PROCESSING
date_fromdatetimeOptionalFilter from date (ISO format)
date_todatetimeOptionalFilter to date (ISO format)

cURL Example

curl -X GET "http://149.102.159.66:8000/v1/history/documents?page=1&page_size=10&document_type=BankStatement" \
  -H "X-API-Key: ak_xxxxxxxxxxxxxxxxxxxxxx"
📮Postman Configuration
GET
http://149.102.159.66:8000/v1/history/documents
Send
Authorization
Headers
Body
Type:
Key:X-API-Key
Value:ak_xxxxxxxxxxxxxx
Add to:Header
✓KEYVALUE
✓X-API-KeyYOUR_API_KEY
✓Accepttext/plain
Enter your TOON formatted data here
Quick Steps: 1. Set method to GET → 2. URL: http://149.102.159.66:8000/v1/history/documents → 3. Params Tab:

Response Example (200 OK)

total:70
page:1
page_size:10
document_type_filter:"BankStatement"
items:[
  {
    request_id:"req_abc123"
    document_type:"BankStatementPDF"
    original_filename:"statement.pdf"
    file_size_bytes:54022
    status:"COMPLETED"
    submitted_at:"2025-01-23T06:23:11Z"
    completed_at:"2025-01-23T06:23:20Z"
    processing_duration_ms:5487
    is_success:true
    summary:{
      document_type:"bank_statement"
      extraction_confidence:0.95
      opening_balance:1500.00
      closing_balance:2350.00
      transaction_count:15
    }
    processing_result:{...full extraction data...}
  }
]
stats:{
  total_requests:70
  completed_requests:65
  failed_requests:5
  avg_processing_time_ms:3500
  total_data_processed_bytes:5242880
}

Get Speech-to-Text History

GET/v1/history/speech-to-textAuth: API Key

Retrieve paginated speech-to-text processing history. Shows all audio transcription requests with input/output data.

Headers

HeaderValueRequired
X-API-KeyYOUR_API_KEYRequired
Accepttext/plainOptional

Request Body

FieldTypeRequiredDescription
pageintegerOptionalPage number (default: 1)
page_sizeintegerOptionalItems per page (default: 20, max: 100)
success_onlybooleanOptionalFilter only successful requests
date_fromdatetimeOptionalFilter from date (ISO format)
date_todatetimeOptionalFilter to date (ISO format)

cURL Example

curl -X GET "http://149.102.159.66:8000/v1/history/speech-to-text?page=1&page_size=10" \
  -H "X-API-Key: ak_xxxxxxxxxxxxxxxxxxxxxx"
📮Postman Configuration
GET
http://149.102.159.66:8000/v1/history/speech-to-text
Send
Authorization
Headers
Body
Type:
Key:X-API-Key
Value:ak_xxxxxxxxxxxxxx
Add to:Header
✓KEYVALUE
✓X-API-KeyYOUR_API_KEY
✓Accepttext/plain
Enter your TOON formatted data here
Quick Steps: 1. Set method to GET → 2. URL: http://149.102.159.66:8000/v1/history/speech-to-text → 3. Params Tab:

Response Example (200 OK)

total:25
page:1
page_size:10
voice_type:"speech-to-text"
items:[
  {
    log_id:123
    request_id:"stt_abc123"
    endpoint:"speech-to-text"
    access_timestamp:"2025-01-23T10:30:00Z"
    is_success:true
    http_status_code:200
    latency_ms:1500
    processing_time_ms:1200
    file_size_bytes:256000
    input_data:{
      filename:"recording.wav"
      language:"en"
    }
    output_data:{
      text:"Transcribed text from audio..."
      confidence:0.95
    }
  }
]
stats:{
  total_requests:25
  successful_requests:23
  failed_requests:2
  avg_latency_ms:1400
}

Get Text-to-Speech History

GET/v1/history/text-to-speechAuth: API Key

Retrieve paginated text-to-speech processing history. Shows all audio generation requests with input/output data.

Headers

HeaderValueRequired
X-API-KeyYOUR_API_KEYRequired
Accepttext/plainOptional

Request Body

FieldTypeRequiredDescription
pageintegerOptionalPage number (default: 1)
page_sizeintegerOptionalItems per page (default: 20, max: 100)
success_onlybooleanOptionalFilter only successful requests
date_fromdatetimeOptionalFilter from date (ISO format)
date_todatetimeOptionalFilter to date (ISO format)

cURL Example

curl -X GET "http://149.102.159.66:8000/v1/history/text-to-speech?page=1&page_size=10" \
  -H "X-API-Key: ak_xxxxxxxxxxxxxxxxxxxxxx"
📮Postman Configuration
GET
http://149.102.159.66:8000/v1/history/text-to-speech
Send
Authorization
Headers
Body
Type:
Key:X-API-Key
Value:ak_xxxxxxxxxxxxxx
Add to:Header
✓KEYVALUE
✓X-API-KeyYOUR_API_KEY
✓Accepttext/plain
Enter your TOON formatted data here
Quick Steps: 1. Set method to GET → 2. URL: http://149.102.159.66:8000/v1/history/text-to-speech → 3. Params Tab:

Response Example (200 OK)

total:18
page:1
page_size:10
voice_type:"text-to-speech"
items:[
  {
    log_id:456
    request_id:"tts_xyz789"
    endpoint:"text-to-speech"
    access_timestamp:"2025-01-23T11:00:00Z"
    is_success:true
    http_status_code:200
    latency_ms:800
    processing_time_ms:600
    input_data:{
      text:"Hello, this is a test."
      language:"en"
    }
    output_data:{
      mimeType:"audio/mpeg"
      duration:"2.5s"
    }
  }
]
stats:{
  total_requests:18
  successful_requests:17
  failed_requests:1
  avg_latency_ms:750
}

Get History Summary

GET/v1/history/summaryAuth: API Key

Get an overview summary of all processing history including document counts by type and voice processing statistics.

Headers

HeaderValueRequired
X-API-KeyYOUR_API_KEYRequired
Accepttext/plainOptional

cURL Example

curl -X GET "http://149.102.159.66:8000/v1/history/summary" \
  -H "X-API-Key: ak_xxxxxxxxxxxxxxxxxxxxxx"
📮Postman Configuration
GET
http://149.102.159.66:8000/v1/history/summary
Send
Authorization
Headers
Type:
Key:X-API-Key
Value:ak_xxxxxxxxxxxxxx
Add to:Header
✓KEYVALUE
✓X-API-KeyYOUR_API_KEY
✓Accepttext/plain
Quick Steps: 1. Set method to GET → 2. URL: http://149.102.159.66:8000/v1/history/summary → 3. Headers Tab:

Response Example (200 OK)

document_processing:{
  by_type:{
    BankStatementPDF:25
    BankStatementImage:10
    ReceiptPDF:30
    InvoicePDF:15
  }
  total:80
  categories:{
    bank_statements:35
    receipts:30
    invoices:15
  }
}
voice_processing:{
  by_type:{
    speech-to-text:25
    text-to-speech:18
  }
  total:43
  speech_to_text:25
  text_to_speech:18
}
total_requests:123
last_request_at:"2025-01-23T11:30:00Z"

System Endpoints

Health Check

GET/healthAuth: None (Public)

Check if the API server is running and healthy. This endpoint is public and requires no authentication.

Headers

HeaderValueRequired
Acceptapplication/jsonOptional

cURL Example

curl -X GET "http://149.102.159.66:8000/health"
📮Postman Configuration
GET
http://149.102.159.66:8000/health
Send
Headers
✓KEYVALUE
✓Acceptapplication/json
Quick Steps: 1. Set method to GET → 2. URL: http://149.102.159.66:8000/health → 3. No authentication required

Response Example (200 OK)

status:"healthy"
timestamp:"2025-01-27T12:00:00Z"
version:"1.0.0"
uptime_seconds:86400

Error Codes Reference

Status CodeMeaningCommon Causes
200SuccessRequest completed successfully
201CreatedResource created successfully
400Bad RequestMissing required fields, invalid format
401UnauthorizedMissing or invalid token/API key
403ForbiddenValid auth but insufficient permissions
404Not FoundResource doesn't exist
409ConflictResource already exists (e.g., email taken)
429Rate LimitedToo many requests
500Server ErrorInternal server error
503UnavailableService temporarily unavailable
504TimeoutRequest timed out during processing

Need Help?

If you have questions or run into issues, check our support resources.