Skip to main content

Retrieve call records

Retrieve call records

GET
https://api.agora.io/api/conversational-ai-agent/v2/projects/{appid}/call

Use this endpoint to query historical call records for a specified appid based on the filter criteria.

Request

Path parameters

appid stringrequired

The App ID of the project.

Query parameters

number stringnullable

Filter by phone number. Can be either the calling number or the called number.

from_time integernullable

Default: 60 days ago

Query list start timestamp (in seconds).

to_time integernullable

Default: Current time

Query list end timestamp (in seconds).

type stringnullable

Possible values: inbound, outbound

Call type filter:

  • inbound: Inbound call.
  • outbound: Outbound call.

If not specified, all call types are returned.

limit integernullable

Default: 20

Maximum number of items returned in a single page.

cursor stringnullable

Pagination cursor. Use the agent_id from the previous page as the cursor for the next page.

Response

  • If the returned status code is 200, the request was successful. The response body contains the result of the request.

    Response Body
    • data object

      Call data object.

      Show propertiesHide properties
      • count integer

        The number of calls returned in this response.

      • list array

        A list of calls that meet the criteria.

        Show propertiesHide properties
        • to_number string

          The number called.

        • from_number string

          Caller ID.

        • pipeline_id string

          The unique ID of a published project in AI Studio. Can be obtained in AI Studio - Project - Release Management.

        • type string

          Possible values: inbound, outbound

          Call type:

          • inbound: Inbound call.
          • outbound: Outbound call.
        • agent_id string

          A unique identifier for the call session.

        • channel string

          RTC channel name.

        • create_ts integer

          Call creation timestamp (in seconds).

        • state string

          Possible values: answered, hangup

          Call status:

          • answered: The call was answered.
          • hangup: The call was disconnected.
        • stop_ts integer

          Call end timestamp (in seconds). Returns 0 or null if the call has not ended.

    • meta object

      Metadata about the list.

      Show propertiesHide properties
      • cursor string

        Pagination cursor for the next page.

      • total integer

        The total number of calls that meet the query criteria.

    • status string

      Request status.

  • If the returned status code is not 200, the request failed. The response body includes the error code and description. Refer to status codes to understand the possible reasons for failure.

    Error Response
    • error_type string

      The type of error that occurred.

    • description string

      A detailed description of the error.

Authorization

This endpoint requires Basic Auth.

Request example


_3
curl --request GET \
_3
--url 'https://api.agora.io/api/conversational-ai-agent/v2/projects/:appid/call?limit=20' \
_3
--header 'Authorization: Basic <credentials>'

Response example


_23
{
_23
"data": {
_23
"count": 1,
_23
"list": [
_23
{
_23
"to_number": "2222",
_23
"from_number": "111",
_23
"pipeline_id": "28",
_23
"type": "inbound",
_23
"agent_id": "A42AA22ATxxxxx4RH76AM92W",
_23
"channel": "channel_1111",
_23
"create_ts": 1758498988,
_23
"state": "answered",
_23
"stop_ts": null
_23
}
_23
]
_23
},
_23
"meta": {
_23
"cursor": "A42AA22AT45LDxxxxxH76AM92W",
_23
"total": 1
_23
},
_23
"status": "ok"
_23
}