API Reference
Complete REST API reference for the Trunx telecom platform.
Base URL
https://api.trunx.ioAll endpoints are prefixed with /api/. Requests require an API key passed in the Authorization header as a Bearer token. See Authentication for details.
SMS
| Method | Path | Description |
|---|---|---|
POST | /api/sms | Send an SMS message |
See SMS for request/response details.
Voice
| Method | Path | Description |
|---|---|---|
POST | /api/voice | Create a call (plain or AI) |
GET | /api/voice/:id | Get call details |
DELETE | /api/voice/:id | End a call |
See Voice for request/response details.
Phone Verification
| Method | Path | Description |
|---|---|---|
GET | /api/verifications/services | List available services |
POST | /api/verifications | Request a temp phone number |
GET | /api/verifications/:id | Get verification status + OTP |
GET | /api/verifications/:id/code | Poll for OTP code (15s wait) |
POST | /api/verifications/:id/cancel | Cancel a verification |
See Phone Verification for request/response details.
Campaigns
| Method | Path | Description |
|---|---|---|
POST | /api/campaigns | Create a campaign |
GET | /api/campaigns | List campaigns |
GET | /api/campaigns/:id | Get campaign details |
POST | /api/campaigns/:id/start | Start a campaign |
POST | /api/campaigns/:id/pause | Pause a campaign |
POST | /api/campaigns/:id/resume | Resume a campaign |
POST | /api/campaigns/:id/cancel | Cancel a campaign |
POST | /api/campaigns/:id/prospects | Add prospects |
GET | /api/campaigns/:id/prospects | List prospects |
GET | /api/campaigns/:id/stats | Campaign stats |
See Campaigns for request/response details.
DIDs
| Method | Path | Description |
|---|---|---|
GET | /api/dids | List DIDs |
GET | /api/dids/search | Search available DIDs |
POST | /api/dids/purchase | Purchase DIDs |
DELETE | /api/dids/:number | Release a DID |
PATCH | /api/dids/:number | Configure a DID |
GET | /api/dids/:number/health | DID health score |
POST | /api/dids/:number/cooldown | Cooldown a DID |
POST | /api/dids/:number/activate | Activate a DID |
POST | /api/dids/:number/burn | Burn a DID |
See DIDs for request/response details.
IVR
| Method | Path | Description |
|---|---|---|
POST | /api/ivr | Create an IVR |
GET | /api/ivr | List IVRs |
DELETE | /api/ivr/:id | Delete an IVR |
POST | /api/ivr/:id/assign | Assign IVR to a DID |
See IVR for request/response details.
Audio
| Method | Path | Description |
|---|---|---|
POST | /api/audio | Generate TTS audio |
GET | /api/audio | List audio files |
DELETE | /api/audio/:id | Delete an audio file |
Events
| Method | Path | Description |
|---|---|---|
POST | /api/events | SSE stream (GET with token param) |
See Events for request/response details.
Webhooks
| Method | Path | Description |
|---|---|---|
POST | /api/webhooks | Register a webhook |
GET | /api/webhooks | List webhooks |
DELETE | /api/webhooks/:id | Delete a webhook |
GET | /api/webhooks/:id/logs | Delivery logs |
See Webhooks for request/response details.
Billing
| Method | Path | Description |
|---|---|---|
GET | /api/billing/usage | Usage summary |
GET | /api/billing/portal | Billing portal URL |
See Billing for request/response details.
API Keys
| Method | Path | Description |
|---|---|---|
POST | /api/keys | Create an API key |
GET | /api/keys | List API keys |
DELETE | /api/keys/:id | Revoke a key |
Reputation
| Method | Path | Description |
|---|---|---|
GET | /api/reputation/:number | Check DID reputation |
GET | /api/reputation | List reputation data |
POST | /api/reputation/audit | Trigger a reputation audit |
Compliance (10DLC)
| Method | Path | Description |
|---|---|---|
POST | /api/compliance/brands | Register a brand |
GET | /api/compliance/brands | List brands |
MCP
| Method | Path | Description |
|---|---|---|
POST | /api/mcp | MCP streamable HTTP endpoint |
The MCP endpoint uses the same API key authentication as the REST API. Connect your AI agent directly using any MCP-compatible client. See MCP for details.
Error Format
All error responses follow the RFC 7807 Problem Details format. See Errors for details.
{
"type": "https://api.trunx.io/errors/not-found",
"title": "Not Found",
"status": 404,
"detail": "The requested resource was not found."
}Interactive Documentation
Full interactive API documentation with request/response examples is available at api.trunx.io/docs, powered by Scalar.