List legs
Returns a paginated list of the workspace's legs, ordered by start time descending.
The status filter selects where in the lifecycle you look, and any combination is a single page: in-flight statuses (ringing, in_progress), final ones, or both together. Omit it and you get completed legs, which is what this list has always returned.
A leg in flight carries no economics yet: duration_ms, billable_ms, ended_at, and cost are null until it ends. It keeps the same id throughout, so the same leg answers under one identity from the first ring to settlement.
Request
- Base URL: https://us1.platform.bird.com
- URL: https://us1.platform.bird.com/v1/voice/legs
- Auth: one of:
- HTTP bearer
- API key in cookie bird_session
Query parameters
Whether the call was placed from your side, by your PBX, the API, the browser or Bird dialing onward for you (outbound), or arrived from a remote party (inbound).
Return only legs in this direction.
Return only legs with one of these statuses, comma-separated. In-flight and final statuses may be combined freely.
[ "answered" ]
Return only legs belonging to this call, which is how the legs of one multi-party or transferred call are correlated.
Return only legs carried by this SIP trunk.
Return only legs placed from this calling party number, matched as a whole number rather than as a fragment. Give it in international form: +14155551234, 14155551234, and 0014155551234 all select the same legs. A number given without a country code is read as an international one, so give the country code to be sure of what you are matching. Use number instead to match part of a number, or either side of the leg.
Return only legs placed to this called party number, matched as a whole number rather than as a fragment. Give it in international form: +16505559876, 16505559876, and 0016505559876 all select the same legs. A number given without a country code is read as an international one, so give the country code to be sure of what you are matching. Use number instead to match part of a number, or either side of the leg.
Return only legs where the calling or called number contains this value. Matches a partial number, so a country or area-code prefix returns every leg to or from it. Combines with from/to, which match one side exactly.
Filter by tag. Accepts name to match any record carrying that tag name, or name:value to match a specific tag pair (for example category:welcome). Repeat the parameter to add more tags. A record must match every tag listed to be returned.
Return only legs that started at or after this instant, inclusive. RFC 3339 timestamp.
Return only legs that started at or before this instant, inclusive. RFC 3339 timestamp.
Maximum number of items to return per page.
Cursor from the next_cursor field of a previous list response. Returns items immediately after the cursor position in the current sort order.
Cursor from the prev_cursor or refresh_cursor field of a previous list response. Returns items immediately before the cursor position in the current sort order. prev_cursor returns the preceding page. refresh_cursor anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.
Headers
Workspace context for the request. Required for dashboard authentication and master keys. Workspace keys and access tokens already identify their workspace; send that workspace or omit the header. A different one is rejected.
Organization context for the request. Required for dashboard authentication. An API key or access token carries its own organization, so send either that organization or no header at all; a different one is rejected.
Response
Paginated list of leg records.
Example response
{
"data": [
{
"id": "vcl_01krdgeqcxet5s7t44vh8rt9mg",
"call_id": "vcs_01krdgeqcxet5s7t44vh8rt9mg",
"workspace_id": "ws_01krdgeqcxet5s7t44vh8rt9mg",
"direction": "outbound",
"from": "+14155551234",
"to": "+16505559876",
"actor": {
"id": "usr_01krdgeqcxet5s7t44vh8rt9mg",
"type": "user"
},
"sip_trunk_id": "spt_01krdgeqcxet5s7t44vh8rt9mg",
"sip_call_id": "3f9a1c8e7b2d4a5f@sip.example.net",
"status": "answered",
"sip_response_code": 200,
"rejection_reason": "destination_not_enabled",
"route": {
"type": "trunk"
},
"tags": [
{
"name": "category",
"value": "welcome"
}
],
"duration_ms": 65000,
"pdd_ms": 850,
"billable_ms": 60000,
"media_quality": {
"mos": 4.32,
"jitter_ms": 12,
"packet_loss_pct": 1.5,
"round_trip_time_ms": 42
},
"cost": {
"amount": "0.013000",
"currency_code": "EUR",
"outbound_amount": "0.013000"
}
}
],
"next_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE0OjAzOjEwWlwiIiwiaSI6IjAxOTJmM2IxLTRjN2UtN2EyYi05ZDYxLThmM2E1YzJlN2I0MCJ9",
"refresh_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE2OjQyOjAxWlwiIiwiaSI6IjAxOTJmM2IxLTllMDQtN2NkMy1iODE3LTJhNmY0ZDFjOGUwOSJ9"
}Changes
No recorded changes to this operation across all 2 revisions of this API.