API Reference
osmTalk REST API endpoints for managing agents, calls, and billing.
Production: https://api.osmtalk.com
Local dev: http://localhost:4002
osmTalk uses session-based authentication via osmAPI. For widget/embed endpoints, use an API key.
All /api/* routes (except widget and webhooks) require an active session. The session token is sent as:
Authorization: Bearer <session-token>
Widget endpoints use API keys created in Dashboard → Settings → API Keys:
x-api-key: <your-api-key>
| Method | Endpoint | Auth | Description |
|---|
| GET | /api/agents | Session | List all agents |
| GET | /api/agents/:id | Session | Get agent details |
| POST | /api/agents | Session | Create agent |
| PUT | /api/agents/:id | Session | Update agent |
| DELETE | /api/agents/:id | Session | Delete agent |
| POST | /api/agents/:id/connect | Session | Start web voice call |
| GET | /api/agents/:id/stats | Session | Get agent statistics |
| Method | Endpoint | Auth | Description |
|---|
| GET | /api/calls | Session | List calls with filters |
| GET | /api/calls/:id | Session | Get call details + transcript |
| POST | /api/calls/outbound | Session | Start outbound phone call |
| POST | /api/calls/:id/transfer | Session | Transfer call to human |
| POST | /api/calls/:id/end | Session | End active call |
| Method | Endpoint | Auth | Description |
|---|
| GET | /api/billing/balance | Session | Current credit balance |
| POST | /api/billing/create-payment-intent | Session | Create Razorpay order |
| POST | /api/billing/calculate-fees | Session | Preview fees |
| GET | /api/billing/transactions | Session | Payment history |
| GET | /api/billing/usage | Session | Call cost history |
| Method | Endpoint | Auth | Description |
|---|
| POST | /api/widget/agents/:id/connect | API Key | Start voice call from widget |
| POST | /api/widget/agents/:id/chat | API Key | Send chat message |
| POST | /api/widget/calls/outbound | API Key | Outbound call (MCP) |
| GET | /api/widget/agents | API Key | List agents |
| GET | /api/widget/phone-numbers | API Key | List phone numbers |
| GET | /api/widget/calls | API Key | Call history |
| GET | /api/widget/calls/:id | API Key | Call details |
| GET | /api/widget/dashboard | API Key | Dashboard stats |
| Method | Endpoint | Auth | Description |
|---|
| GET | /api/phone-numbers | Session | List phone numbers |
| POST | /api/phone-numbers | Session | Add existing number |
| PUT | /api/phone-numbers/:id | Session | Update number |
| DELETE | /api/phone-numbers/:id | Session | Remove number |
| Method | Endpoint | Auth | Description |
|---|
| GET | /api/telephony/numbers/search | Session | Search available numbers |
| POST | /api/telephony/numbers/buy | Session | Buy a phone number |
| POST | /api/telephony/numbers/provision | Session | Provision existing number |
| GET | /api/telephony/numbers/owned | Session | List owned numbers |
| Method | Endpoint | Auth | Description |
|---|
| POST | /api/webhooks/livekit | Signature | LiveKit event webhooks |
| POST | /api/webhooks/razorpay | Signature | Razorpay payment webhooks |
| GET/POST | /api/webhooks/whatsapp | Verify token | WhatsApp webhooks |