GET — Get Leg Details
Description
Fetches the current details of a Leg using its leg_sid. This is useful to:
- Check the leg state (created / ringing / connected / terminal)
- Fetch timestamps (created / start / end)
- Pull additional runtime statuses (bridge / recording / play / gather / hold, etc.) via fields
Endpoint
GET
Full URL
Authentication
- Type: HTTP Basic Authentication
- Username: API Key
- Password: API Token
Request Headers
Path Parameters
Parameter | Type | Required | Description |
|---|---|---|---|
account_sid | string | Yes | Exotel Account SID (from Exotel dashboard) |
leg_sid | string | Yes | Leg SID returned by Create a Leg |
Query Parameters (Optional)
fields
Use fields to request additional runtime statuses in the response.
Type: comma-separated string
Example
Field | Description |
|---|---|
bridge_status | Whether the leg is bridged or not |
recording_status | Whether recording is active |
tx_audio_status | Transmit audio status (muted/normal) |
rx_audio_status | Receive audio status (muted/normal) |
hold_status | Whether leg is on hold |
gather_status | Whether DTMF gather is active |
play_status | Whether audio playback is active |
Tip: If you don’t pass fields, the API returns the standard leg object without the additional_info section.
Example Request
Basic request
Request with fields
Success Response
HTTP 200 – OK
Response Fields
Core Fields
Field | Description |
|---|---|
leg_sid | Unique identifier for the leg |
account_sid | Exotel account identifier |
contact_uri | Destination of the leg (phone/SIP URI) |
exophone | Caller ID / Exotel number used |
caller_id | Resolved caller ID presented |
direction | inbound or outbound |
network_type | pstn or voip |
time_limit | Max time allowed for the leg |
state | Current leg state (example: connected, terminal) |
date_created | When leg was created |
date_updated | Last update time |
start_time | When leg connected/started (if applicable) |
additional_info (only if fields requested)
Field | Description |
|---|---|
recording_status | Recording status |
hold_status | Hold status |
gather_status | DTMF gather status |
play_status | Playback status |
bridge_status | Bridge connection status |
tx_audio_status | Transmit audio status (if requested) |
rx_audio_status | Receive audio status (if requested) |
Error Responses
HTTP Code | Meaning | Description |
|---|---|---|
400 | Bad Request | Invalid fields value or malformed request |
401 | Unauthorized | Invalid API Key / Token |
403 | Forbidden | Access not allowed for this account |
404 | Not Found | Leg SID not found |
429 | Too Many Requests | Rate limit exceeded |
500 | Server Error | Internal error |
Notes & Best Practices
- Use Get Leg Details for polling only when needed — prefer events for real-time status
- Always log request_id for debugging
- If you need runtime action statuses (play/record/bridge/hold), always pass fields