For a complete page index, fetch https://docs.synthflow.ai/llms.txt. For full documentation content, fetch https://docs.synthflow.ai/llms-full.txt.

# List calls

GET https://api.synthflow.ai/v2/calls

Returns a paginated list of calls for the specified model. You can optionally filter by time window, status, duration range, or phone number.

Reference: https://docs.synthflow.ai/api-reference/platform-api/calls/list-calls

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Synthflow APIs
  version: 1.0.0
paths:
  /calls:
    get:
      operationId: list-calls
      summary: List calls
      description: >-
        Returns a paginated list of calls for the specified model. You can
        optionally filter by time window, status, duration range, or phone
        number.
      tags:
        - ''
      parameters:
        - name: model_id
          in: query
          description: The calls for the specified model ID will be returned
          required: true
          schema:
            type: string
        - name: limit
          in: query
          description: How many calls will be displayed in every page, default is 20
          required: false
          schema:
            type: integer
        - name: offset
          in: query
          description: Index of the first call to be returned.
          required: false
          schema:
            type: integer
        - name: from_date
          in: query
          description: >-
            Begin timestamp (milliseconds since epoch) of the call. Available
            after the call starts. Example: 1732546200000
          required: false
          schema:
            type: integer
            format: int64
        - name: to_date
          in: query
          description: >-
            End timestamp (milliseconds since epoch) of the call. Available
            after the call ends. Example: 1732546200000
          required: false
          schema:
            type: integer
            format: int64
        - name: call_status
          in: query
          description: Status of call.
          required: false
          schema:
            type: string
        - name: duration_min
          in: query
          description: >-
            Only retrieve calls with duration greater than or equal to this
            value (seconds).
          required: false
          schema:
            type: integer
        - name: duration_max
          in: query
          description: >-
            Only retrieve calls with duration less than or equal to this value
            (seconds).
          required: false
          schema:
            type: integer
        - name: lead_phone_number
          in: query
          description: >-
            Phone number of the caller or callee (E.164 format preferred) and
            URL-encode the leading "+" (e.g. %2B14155552671)
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list-calls_Response_200'
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/List-callsRequestBadRequestError'
servers:
  - url: https://api.synthflow.ai/v2
  - url: https://api.us.synthflow.ai/v2
components:
  schemas:
    status:
      type: string
      description: Whether the request was successful.
      title: status
    CallsGetResponsesContentApplicationJsonSchemaResponsePagination:
      type: object
      properties:
        total_records:
          type: integer
          description: Total number of call records
        limit:
          type: integer
          description: Maximum number of records per page
        offset:
          type: integer
          description: Starting index for the current page
      description: Pagination information for the response
      title: CallsGetResponsesContentApplicationJsonSchemaResponsePagination
    call_id:
      type: string
      description: Call ID. You can find it on the logs page in your dashboard.
      title: call_id
    model_id:
      type: string
      description: Agent ID. You can find it on the agent’s page in your dashboard.
      title: model_id
    CallsGetResponsesContentApplicationJsonSchemaResponseCallsItemsExecutedActions:
      type: object
      properties: {}
      description: Actions executed during the call
      title: >-
        CallsGetResponsesContentApplicationJsonSchemaResponseCallsItemsExecutedActions
    CallsGetResponsesContentApplicationJsonSchemaResponseCallsItemsTelephonyHangup:
      type: string
      enum:
        - caller
        - callee
      title: >-
        CallsGetResponsesContentApplicationJsonSchemaResponseCallsItemsTelephonyHangup
    CallsGetResponsesContentApplicationJsonSchemaResponseCallsItemsTelephonyDisconnectReason:
      type: string
      enum:
        - unknown
        - callee_hangup
        - caller_hangup
        - error
        - forbidden
      title: >-
        CallsGetResponsesContentApplicationJsonSchemaResponseCallsItemsTelephonyDisconnectReason
    CallsGetResponsesContentApplicationJsonSchemaResponseCallsItemsCollectedVariables:
      type: object
      properties:
        value:
          description: >-
            The collected value of the variable (string, number, boolean, or
            null if not collected).
        collected:
          type: boolean
          description: Whether this variable was successfully collected.
      title: >-
        CallsGetResponsesContentApplicationJsonSchemaResponseCallsItemsCollectedVariables
    CallsGetResponsesContentApplicationJsonSchemaResponseCallsItems:
      type: object
      properties:
        call_id:
          $ref: '#/components/schemas/call_id'
        model_id:
          $ref: '#/components/schemas/model_id'
        duration:
          type: integer
          description: Duration of the call in seconds
        end_call_reason:
          type: string
          description: Reason why the call ended
        judge_results:
          oneOf:
            - description: Any type
            - type: 'null'
          description: Results from call quality judging
        lead_phone_number:
          type: string
          description: Phone number of the lead
        agents_used:
          type: array
          items:
            type: string
          description: List of agents used during the call
        executed_actions:
          $ref: >-
            #/components/schemas/CallsGetResponsesContentApplicationJsonSchemaResponseCallsItemsExecutedActions
          description: Actions executed during the call
        recording_url:
          type:
            - string
            - 'null'
        type_of_call:
          type: string
          description: Type of call (inbound or outbound)
        recording_duration:
          type:
            - string
            - 'null'
          description: Duration of the recording
        transcript:
          type:
            - string
            - 'null'
        error_message:
          type:
            - string
            - 'null'
          description: Error message if the call failed
        call_status:
          type: string
          description: Status of the call
        start_time:
          type: string
          description: Timestamp when the call started (milliseconds since epoch)
        lead_name:
          type:
            - string
            - 'null'
          description: Name of the lead
        name:
          type:
            - string
            - 'null'
          description: Name of the call recipient
        labels:
          type: array
          items:
            type: string
          description: Labels associated with the call
        agent_phone_number:
          type: string
          description: Phone number used by the agent
        deployment_type:
          type:
            - string
            - 'null'
          description: Type of deployment
        timezone:
          type:
            - string
            - 'null'
          description: Timezone for the call
        telephony_hangup:
          oneOf:
            - $ref: >-
                #/components/schemas/CallsGetResponsesContentApplicationJsonSchemaResponseCallsItemsTelephonyHangup
            - type: 'null'
        telephony_disconnect_reason:
          oneOf:
            - $ref: >-
                #/components/schemas/CallsGetResponsesContentApplicationJsonSchemaResponseCallsItemsTelephonyDisconnectReason
            - type: 'null'
        telephony_duration:
          type:
            - integer
            - 'null'
        telephony_start:
          type:
            - string
            - 'null'
          format: date
        telephony_end:
          type:
            - string
            - 'null'
          format: date
        campaign_type:
          type: string
        phone_number_from:
          type: string
        phone_number_to:
          type: string
        collected_variables:
          type: object
          additionalProperties:
            type: object
            additionalProperties:
              $ref: >-
                #/components/schemas/CallsGetResponsesContentApplicationJsonSchemaResponseCallsItemsCollectedVariables
          description: >-
            Collected variables (slots) from the conversation flow, keyed by
            agent ID. May be null if not available.
      title: CallsGetResponsesContentApplicationJsonSchemaResponseCallsItems
    CallsGetResponsesContentApplicationJsonSchemaResponse:
      type: object
      properties:
        pagination:
          $ref: >-
            #/components/schemas/CallsGetResponsesContentApplicationJsonSchemaResponsePagination
          description: Pagination information for the response
        calls:
          type: array
          items:
            $ref: >-
              #/components/schemas/CallsGetResponsesContentApplicationJsonSchemaResponseCallsItems
      title: CallsGetResponsesContentApplicationJsonSchemaResponse
    list-calls_Response_200:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/status'
        response:
          $ref: >-
            #/components/schemas/CallsGetResponsesContentApplicationJsonSchemaResponse
      title: list-calls_Response_200
    List-callsRequestBadRequestError:
      type: object
      properties: {}
      title: List-callsRequestBadRequestError
  securitySchemes:
    sec0:
      type: http
      scheme: bearer

```

## SDK Code Examples

```python
import requests

url = "https://api.synthflow.ai/v2/calls"

querystring = {"model_id":"model_id"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.synthflow.ai/v2/calls?model_id=model_id"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	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://api.synthflow.ai/v2/calls?model_id=model_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.synthflow.ai/v2/calls?model_id=model_id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.synthflow.ai/v2/calls?model_id=model_id");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.synthflow.ai/v2/calls?model_id=model_id")! 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()
```