REST API Reference

Complete reference for all JagCall API endpoints. Manage agents, calls, phone numbers, SMS, and billing programmatically.

Base URL: https://jagcall.com/v1/ — All endpoints require an Authorization: Bearer header. See the Getting Started guide.

Agents

GET/v1/agents

List all agents in the organization.

Response

{ "data": [{ "id": "agt_xxx", "name": "Sales Agent", "status": "active", "phone_number": "+14155551234", "voice_id": "rachel", "created_at": "2025-11-01T08:30:00Z" }], "pagination": { "page": 1, "per_page": 20, "total": 3 } }

Example

curl -X GET https://jagcall.com/v1/agents \
  -H "Authorization: Bearer jc_live_xxx"
POST/v1/agents

Create a new agent.

Request Body

{ "name": "Support Agent", "system_prompt": "You are a helpful support agent...", "voice_id": "rachel", "language": "en" }

Response

{ "id": "agt_xxx", "name": "Support Agent", "status": "active", "created_at": "2025-11-01T09:00:00Z" }

Example

curl -X POST https://jagcall.com/v1/agents \
  -H "Authorization: Bearer jc_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Support Agent", "system_prompt": "You are a helpful support agent...", "voice_id": "rachel" }'
PUT/v1/agents/:id

Update an existing agent by ID.

Request Body

{ "name": "Updated Agent Name", "system_prompt": "Updated prompt..." }

Response

{ "id": "agt_xxx", "name": "Updated Agent Name", "status": "active", "updated_at": "2025-11-02T10:00:00Z" }

Example

curl -X PUT https://jagcall.com/v1/agents/agt_xxx \
  -H "Authorization: Bearer jc_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Updated Agent Name" }'
DELETE/v1/agents/:id

Delete an agent by ID. This action is irreversible.

Response

{ "deleted": true, "id": "agt_xxx" }

Example

curl -X DELETE https://jagcall.com/v1/agents/agt_xxx \
  -H "Authorization: Bearer jc_live_xxx"

Calls

GET/v1/calls

List all calls with optional filters for agent, status, and date range.

Response

{ "data": [{ "id": "call_xxx", "agent_id": "agt_xxx", "to": "+14155559876", "from": "+14155551234", "status": "completed", "duration_seconds": 142, "started_at": "2025-11-01T14:30:00Z" }], "pagination": { "page": 1, "per_page": 20, "total": 56 } }

Example

curl -X GET "https://jagcall.com/v1/calls?agent_id=agt_xxx&status=completed" \
  -H "Authorization: Bearer jc_live_xxx"
POST/v1/calls

Initiate an outbound call from an agent to a phone number.

Request Body

{ "agent_id": "agt_xxx", "to": "+14155559876", "metadata": { "lead_id": "lead_123" } }

Response

{ "id": "call_xxx", "status": "queued", "agent_id": "agt_xxx", "to": "+14155559876", "created_at": "2025-11-01T14:30:00Z" }

Example

curl -X POST https://jagcall.com/v1/calls \
  -H "Authorization: Bearer jc_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{ "agent_id": "agt_xxx", "to": "+14155559876" }'
GET/v1/calls/:id/transcript

Retrieve the full transcript for a completed call.

Response

{ "call_id": "call_xxx", "transcript": [{ "role": "agent", "text": "Hi, this is JagCall...", "timestamp": 0.5 }, { "role": "user", "text": "Hello, I am interested in...", "timestamp": 3.2 }] }

Example

curl -X GET https://jagcall.com/v1/calls/call_xxx/transcript \
  -H "Authorization: Bearer jc_live_xxx"
GET/v1/calls/:id/recording

Get a signed URL for the call recording audio file.

Response

{ "call_id": "call_xxx", "recording_url": "https://storage.jagcall.com/recordings/call_xxx.wav?sig=...", "expires_at": "2025-11-01T15:30:00Z" }

Example

curl -X GET https://jagcall.com/v1/calls/call_xxx/recording \
  -H "Authorization: Bearer jc_live_xxx"

Phone Numbers

GET/v1/phone-numbers

List all phone numbers in the organization.

Response

{ "data": [{ "id": "pn_xxx", "number": "+14155551234", "agent_id": "agt_xxx", "capabilities": ["voice", "sms"], "country": "US" }] }

Example

curl -X GET https://jagcall.com/v1/phone-numbers \
  -H "Authorization: Bearer jc_live_xxx"
POST/v1/phone-numbers/search

Search for available phone numbers by country, area code, or capabilities.

Request Body

{ "country": "US", "area_code": "415", "capabilities": ["voice", "sms"] }

Response

{ "data": [{ "number": "+14155550100", "capabilities": ["voice", "sms"], "monthly_cost": 2.00 }] }

Example

curl -X POST https://jagcall.com/v1/phone-numbers/search \
  -H "Authorization: Bearer jc_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{ "country": "US", "area_code": "415" }'
POST/v1/phone-numbers

Purchase and provision a phone number.

Request Body

{ "number": "+14155550100", "agent_id": "agt_xxx" }

Response

{ "id": "pn_xxx", "number": "+14155550100", "agent_id": "agt_xxx", "status": "active" }

Example

curl -X POST https://jagcall.com/v1/phone-numbers \
  -H "Authorization: Bearer jc_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{ "number": "+14155550100", "agent_id": "agt_xxx" }'
PUT/v1/phone-numbers/:id

Update phone number settings (e.g., reassign to a different agent).

Request Body

{ "agent_id": "agt_yyy" }

Response

{ "id": "pn_xxx", "number": "+14155550100", "agent_id": "agt_yyy", "updated_at": "2025-11-02T10:00:00Z" }

Example

curl -X PUT https://jagcall.com/v1/phone-numbers/pn_xxx \
  -H "Authorization: Bearer jc_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{ "agent_id": "agt_yyy" }'
DELETE/v1/phone-numbers/:id

Release a phone number. The number will be returned to the pool.

Response

{ "deleted": true, "id": "pn_xxx" }

Example

curl -X DELETE https://jagcall.com/v1/phone-numbers/pn_xxx \
  -H "Authorization: Bearer jc_live_xxx"

SMS

POST/v1/sms

Send an SMS message from one of your phone numbers.

Request Body

{ "from": "+14155551234", "to": "+14155559876", "body": "Hi! Your appointment is confirmed for tomorrow at 2pm." }

Response

{ "id": "sms_xxx", "status": "sent", "from": "+14155551234", "to": "+14155559876", "created_at": "2025-11-01T14:30:00Z" }

Example

curl -X POST https://jagcall.com/v1/sms \
  -H "Authorization: Bearer jc_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{ "from": "+14155551234", "to": "+14155559876", "body": "Your appointment is confirmed." }'
GET/v1/sms/conversations

List all SMS conversations grouped by contact number.

Response

{ "data": [{ "id": "conv_xxx", "contact": "+14155559876", "last_message": "Thanks!", "updated_at": "2025-11-01T14:35:00Z", "message_count": 4 }] }

Example

curl -X GET https://jagcall.com/v1/sms/conversations \
  -H "Authorization: Bearer jc_live_xxx"
GET/v1/sms/conversations/:id/messages

Get all messages in a specific conversation.

Response

{ "data": [{ "id": "sms_xxx", "direction": "outbound", "body": "Your appointment is confirmed.", "status": "delivered", "created_at": "2025-11-01T14:30:00Z" }] }

Example

curl -X GET https://jagcall.com/v1/sms/conversations/conv_xxx/messages \
  -H "Authorization: Bearer jc_live_xxx"

Billing

GET/v1/billing/balance

Get the current account balance and usage summary.

Response

{ "balance": 150.00, "currency": "USD", "usage_this_month": { "calls": 342, "call_minutes": 1205, "sms_sent": 89, "sms_received": 67 } }

Example

curl -X GET https://jagcall.com/v1/billing/balance \
  -H "Authorization: Bearer jc_live_xxx"