← Home

Documentation

Get started with the APAi intelligent travel booking engine.

Authentication

All API requests require a Bearer token. Include your API key in the Authorization header:

Authorization: Bearer ana_your_api_key_here

Get your API key by signing up or generating a sandbox key.

Base URL

https://apai.co/api/v1

Quick Start

1. Health Check

curl https://apai.co/api/v1/health \ -H "Authorization: Bearer ana_your_key"

2. Search Flights

curl -X POST https://apai.co/api/v1/search/flights \ -H "Authorization: Bearer ana_your_key" \ -H "Content-Type: application/json" \ -d '{ "origin": "JFK", "destination": "LHR", "departure_date": "2026-06-15", "adults": 1, "cabin_class": "economy" }'

3. Create Booking

curl -X POST https://apai.co/api/v1/booking/create \ -H "Authorization: Bearer ana_your_key" \ -H "Content-Type: application/json" \ -d '{ "offer_id": "off_abc123", "passengers": [{ "given_name": "John", "family_name": "Doe", "born_on": "1990-01-15", "gender": "m", "email": "john@example.com", "phone": "+1234567890" }] }'

Core Endpoints

Search

GET/api/v1/healthHealth check (no auth)
GET/api/v1/search/airportsAirport search
POST/api/v1/search/flightsSearch flights
POST/api/v1/search/resultsPoll search results
POST/api/v1/search/fare-rulesFare rules
POST/api/v1/search/seatmapSeat map

Booking

POST/api/v1/booking/createCreate booking
POST/api/v1/booking/searchSearch bookings
POST/api/v1/booking/documentGet ticket document

Chat & Assist

POST/api/v1/chatAI chat session
POST/api/v1/assistAdmin assistant

Admin

GET/api/v1/admin/configGet agency config
PUT/api/v1/admin/config/pricingUpdate pricing
PUT/api/v1/admin/config/brandingUpdate branding

Billing

GET/api/v1/billing/plansAvailable plans
GET/api/v1/billing/subscriptionCurrent subscription
GET/api/v1/billing/costCurrent usage cost

Knowledge & Intelligence

POST/api/v1/knowledge/learnTeach new knowledge
GET/api/v1/knowledge/catalogKnowledge catalog
GET/api/v1/updates/statusUpdate pipeline status

Response Format

All responses are JSON. Successful responses include the requested data. Errors include an error field:

// Success { "status": "healthy", "active_sessions": 3 } // Error { "error": "Invalid API key" }

Rate Limits

Rate limits are based on your subscription tier. The X-RateLimit-Remaining header indicates remaining requests.

Need help? Contact us at support@apai.co