> For the complete documentation index, see [llms.txt](https://twentytwo.documentationai.com/llms.txt).
> Use it to discover all available pages before exploring further.

# List Calls

Returns a list of all calls made from your workspace, newest first.




<PlaygroundComponent />

<AuthParams schemes={["basicAuth"]}>
<AuthType scheme="basicAuth">
<ParamField header="Authorization" param-type="string" required="true">
Basic authentication credentials. Base64-encode your credentials in the format `api_key:api_key_secret`
and pass the result in the `Authorization` header:

```http
Authorization: Basic BASE64(api_key:api_key_secret)
```
Generate your API Key and Secret from **Profile → Integrations →
Build with Twenty2 API → Create new**.

</ParamField>
</AuthType>
</AuthParams>

### Headers

<ParamField showLocation="false" header="x-workspace-id" param-type="string" required="true" examples-b64="W3sibmFtZSI6ImV4YW1wbGUiLCJ2YWx1ZSI6IjY5OWVkM2I5MWVlNWJlZTM4OWRjYjZhMyJ9XQ==">
Your Twenty2 Workspace ID. To find it, click the copy icon next to
**Switch Workspace** at the bottom-left of the platform and select
**Copy workspace ID**.

</ParamField>

<Request tabs="curl,python,javascript,go,ruby">

```bash
curl -X GET "https://api.twentytwo.in/api/call/logs" \
  -H "Content-Type: application/json" \
  -H "x-workspace-id: 699ed3b91ee5bee389dcb6a3" \
  -H "Authorization: Basic YOUR_CREDENTIALS"
```

```python
import requests
import json

url = "https://api.twentytwo.in/api/call/logs"
headers = {
  "Content-Type": "application/json",
  "x-workspace-id": "699ed3b91ee5bee389dcb6a3",
  "Authorization": "Basic YOUR_CREDENTIALS"
}

response = requests.get(url, headers=headers)
print(response.json())
```

```javascript
const response = await fetch("https://api.twentytwo.in/api/call/logs", {
  method: "GET",
  headers: {
  "Content-Type": "application/json",
  "x-workspace-id": "699ed3b91ee5bee389dcb6a3",
  "Authorization": "Basic YOUR_CREDENTIALS"
}
});

const data = await response.json();
console.log(data);
```

```go
package main

import (
    "fmt"
    "net/http"
)

func main() {

    req, err := http.NewRequest("GET", "https://api.twentytwo.in/api/call/logs", nil)
    if err != nil {
        panic(err)
    }

    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("x-workspace-id", "699ed3b91ee5bee389dcb6a3")
    req.Header.Set("Authorization", "Basic YOUR_CREDENTIALS")

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    fmt.Println("Response Status:", resp.Status)
}
```

```ruby
require 'net/http'
require 'json'

uri = URI('https://api.twentytwo.in/api/call/logs')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Get.new(uri)
request['Content-Type'] = 'application/json'
request['x-workspace-id'] = '699ed3b91ee5bee389dcb6a3'
request['Authorization'] = 'Basic YOUR_CREDENTIALS'

response = http.request(request)
puts response.body
```

</Request>

### Responses

<div data-component="ResponsesCollection"><Expandable title="200 - List of calls returned successfully." default-open="true">

<ResponseField name="success" field-type="boolean" required="false">

</ResponseField>

<ResponseField name="statusCode" field-type="integer" required="false">

</ResponseField>

<ResponseField name="data" field-type="array" required="false">
Array of call objects, newest first.

<Expandable title="Array Items" default-open="false">

<ResponseField name="id" field-type="string" required="false">
Unique identifier for the call.
</ResponseField>

<ResponseField name="called_at" field-type="string" required="false">
Timestamp of when the call was placed.
`null` if the call has not been placed yet.

</ResponseField>

<ResponseField name="callee_number" field-type="string" required="false">
The phone number that was called.
</ResponseField>

<ResponseField name="caller_number" field-type="string" required="false">
The phone number the call was placed from.
</ResponseField>

<ResponseField name="campaign_id" field-type="string" required="false">
ID of the campaign this call belongs to.
`null` if triggered directly via API.

</ResponseField>

<ResponseField name="campaign_name" field-type="string" required="false">
Name of the campaign. `null` if triggered
directly via API.

</ResponseField>

<ResponseField name="agent_id" field-type="string" required="false">
ID of the assistant that handled the call.
</ResponseField>

<ResponseField name="agent_name" field-type="string" required="false">
Display name of the assistant.
</ResponseField>

<ResponseField name="status" field-type="string" required="false" enum="scheduled,initiated,connected,completed,not_connected,failed">
Current or final status of the call.
</ResponseField>

<ResponseField name="cost" field-type="number" required="false">
Cost of the call in rupees. `0` if the call
has not yet been billed.

</ResponseField>

<ResponseField name="call_type" field-type="string" required="false" enum="outbound">

</ResponseField>

<ResponseField name="call_hungup_by" field-type="string" required="false" enum="caller,callee">
Who ended the call — `caller` or `callee`.
`null` if the call has not yet ended.

</ResponseField>

<ResponseField name="should_charge" field-type="boolean" required="false">
Whether this call will be charged to your wallet.
</ResponseField>

</Expandable>
</ResponseField>

</Expandable>

</div>

<Response tabs="200">

```json
{
  "success": true,
  "statusCode": 200,
  "data": [
    {
      "id": "6a339ffbd2bbdb6b4d040c29",
      "called_at": null,
      "callee_number": "9871530000",
      "caller_number": "8071387279",
      "campaign_id": null,
      "campaign_name": null,
      "agent_id": "6a3129fa52acd1721552a434",
      "agent_name": "Customer Support Agent",
      "status": "scheduled",
      "cost": 0,
      "call_type": "outbound",
      "call_hungup_by": null,
      "should_charge": false
    }
  ]
}
```

</Response>

