Call Legs

List Call Legs

GET
/v1/CallLegs

Returns the list of Call Legs, optionally filtered by parameters. This method supports pagination.

AuthorizationBasic <token>

Basic Authorization header using the BASIC scheme. Use a pair companySid:token to access the API.

In: header

Query Parameters

CallSid?string

Call Sid.

Match^(CA)[0-9a-f]{48}$
Status?string

Call Leg status.

Value in

  • "Ringing"
  • "Answered"
  • "Completed"
LegDirection?string

Call Leg direction.

Value in

  • "Inbound"
  • "Outbound"
From?string

Originating (caller) Phone Number or SIP URI.

If it is a SIP URI, it must start with the sip: or sips: prefix, and must be formatted according to RFC 3261 standard. Examples of valid SIP URI:

  • sip:user@server.com:5060
  • sip:user@server.com;transport=TLS
  • sip:user@server.com?header1=value1&header2=value2
  • sip:user@server.com:5060;transport=TCP?header=value
Lengthlength <= 256
To?string

Terminating (callee) Phone Number or SIP URI.

If it is a SIP URI, it must start with the sip: or sips: prefix, and must be formatted according to RFC 3261 standard. Examples of valid SIP URI:

  • sip:user@server.com:5060
  • sip:user@server.com;transport=TLS
  • sip:user@server.com?header1=value1&header2=value2
  • sip:user@server.com:5060;transport=TCP?header=value
Lengthlength <= 256
CreatedOnFrom?string

Date and time, that Call Leg creation date should be greater than or equal to.

Must have ISO format (e.g. yyyy-MM-dd'T'HH:mm:ss).

Formatdate-time
CreatedOnTo?string

Date and time, that Call Leg creation date should be less than.

Must have ISO format (e.g. yyyy-MM-dd'T'HH:mm:ss).

Formatdate-time
PageSize?integer
Formatint32
Range1 <= value <= 10000
OrderByDirection?string

Possible values:

  • Ascending

  • Descending

Value in

  • "Ascending"
  • "Descending"
SearchId?string
includeFees?boolean

If true, fees are included into result.

Response Body

curl -X GET "https://example.com/v1/CallLegs"
{  "items": [    {      "sid": "string",      "callSid": "string",      "from": "+12145678900",      "to": "+19876543210",      "status": "Ringing",      "direction": "Inbound",      "duration": "string",      "createdOn": "2023-09-09T15:00:00.000Z",      "rangOn": "2023-09-09T15:00:00.000Z",      "answeredOn": "2023-09-09T15:00:00.000Z",      "completedOn": "2023-09-09T15:00:00.000Z",      "fees": [        {          "count": 0,          "feePerUnit": 0,          "total": 0        }      ]    }  ],  "searchId": "string"}
{  "errors": {    "Name": [      "The Name field is required."    ]  },  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",  "title": "One or more validation errors occurred.",  "status": 400,  "detail": "Some detailed message",  "traceId": "|4ef17786-b103-420e-89c0-cc425ac14809.edfcbee9_"}