> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # List all Calls GET https://YOUR_SPACE.signalwire.com/api/laml/2010-04-01/Accounts/{AccountSid}/Calls Lists the account's calls. Each call has a Call SID that cXML integrations can use for inspection or control. Use [Retrieve a Call](/docs/compatibility-api/rest/calls/retrieve-a-call) when you already have its SID; use the [Calling API](/docs/apis/rest/calls/call-commands) for SWML-driven call commands. #### Permissions The API token used to authenticate must have the following scope(s) enabled to make a successful request: _Voice_. [Learn more about API scopes](/docs/platform/your-signalwire-api-space). Reference: https://signalwire.com/docs/compatibility-api/rest/calls/list-all-calls ## Authentication - `Authorization` header (basic auth, required) — SignalWire Basic Authentication using Project ID and API Token. The client sends HTTP requests with the Authorization header containing the word Basic followed by a space and a base64-encoded string of project_id:token. The project ID will be used as the username and the API token as the password. Example: ``` Authorization: Basic base64(project_id:token) ``` ## Request ### Path parameters - `AccountSid` (string, required) — The Project ID that uniquely identifies the Account. ### Query parameters - `EndTime` (string, optional) — The time, in RFC 2822 GMT format, on which the call was terminated. - `EndTime<` (string, optional) — The time before which the call was terminated. - `EndTime>` (string, optional) — The time after which the call was terminated. - `From` (string, optional) — The address that initiated the call. - `ParentCallSid` (string, optional) — The unique identifier for the call that created this call. - `StartTime` (string, optional) — The time, in RFC 2822 GMT format, on which the call began. - `StartTime<` (string, optional) — The time before which the call began. - `StartTime>` (string, optional) — The time after which the call began. - `Status` (enum, optional) — The status of the call. - Allowed values: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `busy`, `failed`, `no-answer` - `To` (string, optional) — The address that received the call. - `Page` (integer, optional, default: 0) — The page number to retrieve. Page numbers are zero-indexed, so the first page is 0. - `PageSize` (integer, optional, default: 50) — The number of results to return per page. The default is 50, and the maximum is 1000. - `PageToken` (string, optional) — A token used to retrieve a specific page of results. Must start with PA or PB. ## Response ### 200 The request has succeeded. - `uri` (string, required) — The URI of the current page. - `first_page_uri` (string, required) — The URI of the first page. - `next_page_uri` (string, required, nullable) — The URI of the next page. - `previous_page_uri` (string, required, nullable) — The URI of the previous page. - `page` (integer, required) — The current page number. - `page_size` (integer, required) — The number of items per page. - `calls` (list of Call, required) — List of calls. ## Errors ### 400 Bad Request Error The request was invalid or cannot be processed. Check the error details for more information. - `code` (integer, required) — Error code. - `message` (string, required) — Error message. - `more_info` (string, required) — URL for more information about the error. - `status` (integer, required) — HTTP status code. ### 401 Unauthorized Error Authentication failed. Please verify your credentials and try again. - `code` (integer, required) — Error code. - `message` (string, required) — Error message. - `more_info` (string, required) — URL for more information about the error. - `status` (integer, required) — HTTP status code. ### 422 Unprocessable Entity Error The request could not be processed due to validation errors. Check the error details for more information. - `code` (integer, required) — Error code. - `message` (string, required) — Error message. - `more_info` (string, required) — URL for more information about the error. - `status` (integer, required) — HTTP status code. ## Types ### Call Call model representing a voice call. - `sid` (string, required) — The unique identifier for the call. - `account_sid` (string, required) — The unique identifier for the account that created this call. - `date_created` (string, required) — The date, in RFC 2822 GMT format, this call was created. - `date_updated` (string, required) — The date, in RFC 2822 GMT format, this call was updated. - `parent_call_sid` (string, required, nullable) — The unique identifier for the call that created this call. - `to` (string, required) — The address that received the call. - `formatted_to` (string, required) — The formatted number that received the call. - `to_formatted` (string, required) — The formatted number that received the call. Alias for formatted_to. - `from` (string, required) — The address that initiated the call. - `formatted_from` (string, required) — The formatted number that initiated the call. - `from_formatted` (string, required) — The formatted number that initiated the call. Alias for formatted_from. - `phone_number_sid` (string, required, nullable) — The unique identifier for the phone number. - `status` (enum, required) — The status of the call. - Allowed values: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `busy`, `failed`, `no-answer` - `start_time` (string, required, nullable) — The time, in RFC 2822 GMT format, on which the call began. - `end_time` (string, required, nullable) — The time, in RFC 2822 GMT format, on which the call was terminated. - `duration` (integer, required) — The duration, in seconds, of the call. - `price` (float, required, nullable) — The charge for the call. - `price_unit` (string, required) — The currency, in ISO 4127 format, for the price of the call. - `direction` (enum, required) — The direction of the call. - Allowed values: `inbound`, `outbound` - `answered_by` (enum, required, nullable) — Who/what the call was answered by. - Allowed values: `human`, `machine` - `api_version` (string, required) — The version of the SignalWire API. - `forwarded_from` (string, required, nullable) — The number this call was forwarded from. Always null. - `caller_name` (string, required, nullable) — The caller name. Always null. - `uri` (string, required) — The URI for the call. - `subresource_uris` (CallSubresourceUris, required) — A Map of available sub-resources. - `annotation` (string, required, nullable) — The annotation for the call. Always null. - `group_sid` (string, required, nullable) — The group SID for the call. Always null. - `audio_in_mos` (float, required, nullable) — The Mean Opinion Score for audio quality (1.0-5.0). - `sip_result_code` (string, required, nullable) — The SIP result code for the call. - `audio_rtt_avg` (integer, required, nullable) — The average round-trip time for audio in milliseconds. - `audio_rtt_min` (integer, required, nullable) — The minimum round-trip time for audio in milliseconds. - `audio_rtt_max` (integer, required, nullable) — The maximum round-trip time for audio in milliseconds. - `audio_out_jitter_min` (integer, required, nullable) — The minimum outbound audio jitter in milliseconds. - `audio_out_jitter_max` (integer, required, nullable) — The maximum outbound audio jitter in milliseconds. - `audio_out_jitter_avg` (integer, required, nullable) — The average outbound audio jitter in milliseconds. - `audio_out_lost` (integer, required, nullable) — The number of outbound audio packets lost. ### CallSubresourceUris Call subresource URIs. - `notifications` (string, required, nullable) — The URI for notifications. Always null. - `recordings` (string, required) — The URI for recordings. ## Examples **Response** ```json { "uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls?Page=0&PageSize=50", "first_page_uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls?Page=0&PageSize=50", "next_page_uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls?Page=1&PageSize=50&PageToken=PAxxxxxxxxxx", "previous_page_uri": null, "page": 0, "page_size": 50, "calls": [ { "sid": "b3877c40-da60-4998-90ad-b792e98472ca", "account_sid": "b3877c40-da60-4998-90ad-b792e98472af", "date_created": "Wed, 19 Sep 2018 20:00:00 +0000", "date_updated": "Wed, 19 Sep 2018 21:00:00 +0000", "parent_call_sid": "b3877c40-da60-4998-90ad-b792e98472af", "to": "+13105678901", "formatted_to": "(310) 567-8901", "to_formatted": "(310) 567-8901", "from": "+13103384645", "formatted_from": "(310) 338-4645", "from_formatted": "(310) 338-4645", "phone_number_sid": "b3877c40-da60-4998-90ad-b792e98472pn", "status": "queued", "start_time": "Wed, 19 Sep 2018 20:00:01 +0000", "end_time": "Fri, 21 Sep 2018 10:00:00 +0000", "duration": 20, "price": 0.003, "price_unit": "USD", "direction": "inbound", "answered_by": "human", "api_version": "2010-04-01", "forwarded_from": null, "caller_name": null, "uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls/b3877c40-da60-4998-90ad-b792e98472ca.json", "subresource_uris": { "notifications": null, "recordings": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls/b3877c40-da60-4998-90ad-b792e98472ca/Recordings.json" }, "annotation": null, "group_sid": null, "audio_in_mos": 4.5, "sip_result_code": "200", "audio_rtt_avg": 50, "audio_rtt_min": 20, "audio_rtt_max": 100, "audio_out_jitter_min": 1, "audio_out_jitter_max": 10, "audio_out_jitter_avg": 5, "audio_out_lost": 0 } ] } ``` **SDK Code** ```python import requests url = "https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/Calls" response = requests.get(url, auth=("", "")) print(response.json()) ``` ```javascript const url = 'https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/Calls'; const credentials = btoa(":"); const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/Calls" req, _ := http.NewRequest("GET", url, nil) req.SetBasicAuth("", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/Calls") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request.basic_auth("", "") response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/Calls") .basicAuth("", "") .asString(); ``` ```php request('GET', 'https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/Calls', [ 'headers' => [ ], 'auth' => ['', ''], ]); echo $response->getBody(); ``` ```csharp using RestSharp; using RestSharp.Authenticators; var client = new RestClient("https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/Calls"); client.Authenticator = new HttpBasicAuthenticator("", ""); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let credentials = Data(":".utf8).base64EncodedString() let headers = ["Authorization": "Basic \(credentials)"] let request = NSMutableURLRequest(url: NSURL(string: "https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/Calls")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```