# Listing Calls

A Call represents a connection between a phone or user agent and the platform. This may be inbound or outbound. The Calls list resource represents the set of phone calls originated and terminated from an account. This section will focus on only using HTTP POST functions.

## Section URI

{% hint style="info" %}
List all calls&#x20;

**/call/2012-04-24/Accounts/{AccountSid}/ListCalls**
{% endhint %}

**or**

{% hint style="info" %}
List an individual call&#x20;

**/call/2012-04-24/Accounts/{AccountSid}/ListCalls/{CallSid}**
{% endhint %}

## Standard Request Parameters

<table><thead><tr><th width="154">Parameter</th><th width="129">Required</th><th>Description</th></tr></thead><tbody><tr><td>From</td><td>no</td><td>The source or from phone number</td></tr><tr><td>To</td><td>no</td><td>The destination or to phone number</td></tr></tbody></table>

## Pagination Request Parameters

None of the pagination requests are required

<table><thead><tr><th width="164">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Page</strong></td><td>The current page number. Zero-indexed, so the first page is 0. 0-20000</td></tr><tr><td><strong>PageSize</strong></td><td>How many items are on each page 0-2000</td></tr><tr><td><strong>StartTime</strong></td><td><p>Only show recordings that were made on this date/time or later EndTime value examples allowed: </p><p>2024-04-01T10:10:10 </p><p>2024-04-01 10:10:10 </p><p>2024-04-01</p></td></tr><tr><td><strong>EndTime</strong></td><td><p>Only show recordings that were made on this date/time or earlier EndTime value examples allowed: </p><p>2024-04-01T10:10:10 </p><p>2024-04-01 10:10:10 </p><p>2024-04-01</p></td></tr><tr><td><strong>CallSid</strong></td><td>Only show recordings that have been started from this CallSid Value: CallSid=h923fh2h32fj23f2</td></tr><tr><td><strong>SortBy</strong></td><td>Sort by the date created instead of the most recent on top Value: DateCreated <strong>or</strong> DateAsc</td></tr></tbody></table>

## POST or GET Requests

Send us a request to list the calls for today or search for specific calls

Searching your calls can include POST or GET variables From, To, Sid or Limit.

{% tabs %}
{% tab title="Search List" %}

```php
curl -X POST https://v1.api19.com/call/2012-04-24/Accounts/AC021d7d7d49d3234r34t3ea3769b9ed7/ListCalls \
   -d 'From=17207741111' \
   -d 'To=13038927627' \
   -d 'PageSize=1000 \
   -u '239h2g-23h9-239f23hf:AC021d7d7d49d3234r34t3ea3769b9ed7'
```

{% endtab %}

{% tab title="List Last" %}

```javascript
curl https://v1.api19.com/call/2012-04-24/Accounts/AC021d7d7d49d3234r34t3ea3769b9ed7/ListCalls \
   -u '239h2g-23h9-239f23hf:AC021d7d7d49d3234r34t3ea3769b9ed7'
```

{% endtab %}

{% tab title="List Individual Call" %}

```javascript
curl https://v1.api19.com/call/2012-04-24/Accounts/AC021d7d7d49d3234r34t3ea3769b9ed7/ListCalls/ID13eeaa83f4c34aa28a9a7210995e1cbd-CA0257edff74b345b1b63076ef12a93b \
   -u '239h2g-23h9-239f23hf:AC021d7d7d49d3234r34t3ea3769b9ed7'
```

{% endtab %}
{% endtabs %}

## Calls Attributes in Response

| Attribute      | Description                                                                                                                                               |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Sid            | A string that uniquely identifies a call.                                                                                                                 |
| ParentCallSid  | A string that uniquely identifies the call that created this leg.                                                                                         |
| DateCreated    | The date that this call was created.                                                                                                                      |
| DateUpdated    | The date that this call was last updated.                                                                                                                 |
| AccountSid     | The unique id of the Account that created this call.                                                                                                      |
| To             | The phone number or identifier that will be the recipient of this call.                                                                                   |
| From           | The phone number or identifier that originated this call.                                                                                                 |
| PhoneNumberSid | If the call was inbound, this is the Sid of the IncomingPhoneNumber that received the call.                                                               |
| Status         | A string representing the status of the call. Possible values are queued, ringing, in-progress, completed, failed, busy and no-answer.                    |
| StartTime      | The start time of the call. Empty if the call has not yet been started.                                                                                   |
| EndTime        | The end time of the call. Empty if the call has not ended.                                                                                                |
| Duration       | The length of the call in seconds.                                                                                                                        |
| Price          | The charge for this call, in the currency associated with the account. Populated after the call is completed.                                             |
| Direction      | A string describing the direction of the call. Possible values are inbound, outbound-api, and outbound-dial                                               |
| AnsweredBy     | If this call was initiated with answering machine detection, either human or machine. Empty otherwise.                                                    |
| ApiVersion     | Displays the current API version                                                                                                                          |
| ForwardFrom    | If this call was an incoming call forwarded from another number, the forwarding phone number (depends on carrier supporting forwarding). Empty otherwise. |
| CallerName     | If this call was an incoming call, the caller’s name. Empty otherwise.                                                                                    |
| Uri            | <p>The URI for this account, relative to<br><https://v1.api19.com/call/2012-04-24/Accounts></p>                                                           |

## Get call details

## Example JSON Responses

Here is what the JSON will look like when there are multiple calls vs a single call

{% tabs %}
{% tab title="Single Call" %}

```
{
  "sid": "IDf0cbf85b95df45deb3cb404235e7c26e-CA9a2229464e2843dd84903313b5680714",
  "InstanceId": "IDf0cbf85b95df45deb3cb404235e7c26e",
  "date_created": "Wed, 4 Sep 2024 00:26:56 +0000",
  "date_updated": "Wed, 4 Sep 2024 00:27:03 +0000",
  "account_sid": "AC025S7d7d49d7f923432552ea3769b9ed7",
  "to": "1303666627",
  "from": "1720444493",
  "status": "in-progress",
  "start_time": "2024-09-04T00:27:03.381Z",
  "duration": 0,
  "price_unit": "USD",
  "direction": "outbound-api",
  "answered_by": "1303666627",
  "api_version": "2012-04-24",
  "caller_name": "1720444493",
  "uri": "/call/2012-04-24/Accounts/AC025S7d7d49d7f923432552ea3769b9ed7/Calls/IDf0cbf85b95df45deb3cb404235e7c26e-CA9a2229464e2843dd84903313b5680714.json",
  "ring_duration": 3,
  "subresource_uris": {
    "notifications": "/call/2012-04-24/Accounts/AC025S7d7d49d7f923432552ea3769b9ed7/Calls/IDf0cbf85b95df45deb3cb404235e7c26e-CA9a2229464e2843dd84903313b5680714/Notifications.json",
    "recordings": "/call/2012-04-24/Accounts/AC025S7d7d49d7f923432552ea3769b9ed7/Calls/IDf0cbf85b95df45deb3cb404235e7c26e-CA9a2229464e2843dd84903313b5680714/Recordings.json"
  }
} 
```

{% endtab %}

{% tab title="Multiple Calls" %}

```
[
    {
        "sid": "IDc473e064b2b34acbb104ea06acee5f42-CA5a6b8264a9c24e97a30fe3721fd9e5b4",
        "InstanceID": "IDc473e064b2b34acbb104ea06acee5f42",
        "date_created": "Wed, 4 Sep 2024 01:26:54 +0000",
        "date_updated": "Wed, 4 Sep 2024 01:26:56 +0000",
        "account_sid": "AC021d7d7d49d7f95749488ea3788wj92s",
        "to": "13038144444",
        "from": "17207747777",
        "status": "canceled",
        "start_time": "Wed, 4 Sep 2024 01:26:54 +0000",
        "duration": "0",
        "price_unit": "USD",
        "direction": "outbound-api",
        "answered_by": "13038144444",
        "api_version": "2012-04-24",
        "caller_name": "17207747777",
        "uri": "/2012-04-24/Accounts/AC021d7d7d49d7f95749488ea3788wj92s/Calls/IDc473e064b2b34acbb104ea06acee5f42-CA5a6b8264a9c24e97a30fe3721fd9e5b4",
        "ring_duration": "0",
        "subresource_uris": {
            "notification": "/call/2012-04-24/Accounts/AC021d7d7d49d7f95749488ea3788wj92s/Calls/IDc473e064b2b34acbb104ea06acee5f42-CA5a6b8264a9c24e97a30fe3721fd9e5b4/Notifications.json",
            "recordings": "/call/2012-04-24/Accounts/AC021d7d7d49d7f95749488ea3788wj92s/Calls/IDc473e064b2b34acbb104ea06acee5f42-CA5a6b8264a9c24e97a30fe3721fd9e5b4/Recordings.json"
        }
    },
    {
        "sid": "IDf0cbf85b95df45deb3cb404235e7c26e-CAc991833d718849af98ac80582e3729fb",
        "InstanceID": "IDf0cbf85b95df45deb3cb404235e7c26e",
        "date_created": "Wed, 4 Sep 2024 01:25:06 +0000",
        "date_updated": "Wed, 4 Sep 2024 01:25:16 +0000",
        "account_sid": "AC021d7d7d49d7f95749488ea3788wj92s",
        "to": "13038144445",
        "from": "17207747772",
        "status": "completed",
        "start_time": "Wed, 4 Sep 2024 01:25:06 +0000",
        "duration": "5",
        "price_unit": "USD",
        "direction": "outbound-api",
        "answered_by": "13038144445",
        "api_version": "2012-04-24",
        "caller_name": "17207747772",
        "uri": "/2012-04-24/Accounts/AC021d7d7d49d7f95749488ea3788wj92s/Calls/IDf0cbf85b95df45deb3cb404235e7c26e-CAc991833d718849af98ac80582e3729fb",
        "ring_duration": "0",
        "subresource_uris": {
            "notification": "/call/2012-04-24/Accounts/AC021d7d7d49d7f95749488ea3788wj92s/Calls/IDf0cbf85b95df45deb3cb404235e7c26e-CAc991833d718849af98ac80582e3729fb/Notifications.json",
            "recordings": "/call/2012-04-24/Accounts/AC021d7d7d49d7f95749488ea3788wj92s/Calls/IDf0cbf85b95df45deb3cb404235e7c26e-CAc991833d718849af98ac80582e3729fb/Recordings.json"
        }
    }
] 
```

{% endtab %}
{% endtabs %}
