Phones - Calls

Query calls with filters, sorting and pagination

Retrieve call records with advanced filtering, sorting, and pagination. Access detailed call information including recordings, transcriptions, AI analysis, and call metadata.

Query Capabilities:

  • Filter by call status (completed, failed, in_progress, scheduled, etc.)
  • Filter by date range (createdAt) using matchMode: 10 (Between)
  • Search by phone numbers (destination or source)
  • Filter by agent, user, or campaign
  • Sort by any field (date, duration, status, etc.)
  • Paginate with pageSize and nextId

Filter Match Modes:

  • 1: Equal - Exact match
  • 2: NotEqual - Not equal to value
  • 3: LessThan - Less than value
  • 4: LessThanOrEqual - Less than or equal to value
  • 5: GreaterThan - Greater than value
  • 6: GreaterThanOrEqual - Greater than or equal to value
  • 7: Like - Pattern matching (SQL LIKE)
  • 8: Contains - Field contains value
  • 10: Between - Value is between range (use rangeValues with start and end)
  • 11: In - Value is in array (use values array)

Common Filter Fields:

  • createdAt: Call creation timestamp (ISO 8601 date string) - use for date range queries
  • status: Call status (answered, failed, missed, in_call, etc.)
  • phoneNumber: Destination phone number
  • agentId: AI agent that handled the call
  • callDirection: inbound or outbound
  • duration: Call duration in seconds
  • source: Call source (api, web, phone, scheduled, campaign, workflow)

Example Request: The example below shows how to query calls from January 2024 with status "answered", sorted by creation date descending.

Response Includes:

  • Call details (duration, status, timestamps)
  • Phone numbers (source and destination)
  • Contactd agent or user information
  • Recording and transcription URLs
  • AI analysis and summary
  • Dynamic variables and metadata
  • Call direction (inbound/outbound)

Common Use Cases:

  • Export call logs for reporting
  • Find all failed calls for retry
  • Get calls for a specific customer or agent
  • Retrieve calls within a date range for analytics
post/api/v1/phones/calls/query

Request

  • Base URL: https://api.voicelogica.ai
  • URL: https://api.voicelogica.ai/api/v1/phones/calls/query
  • Auth: API key in header x-api-key

Headers

x-api-keystring required

Your API key for authentication. Required for all endpoints.

x-company-idstring

Optional company ID for resellers. When provided, the API request will operate on behalf of the specified subsidiary company. The API key must have access to the specified company.

Request body

Example request

{
  "pagedListRequest": {
    "nextId": null,
    "pageSize": 50
  },
  "queryOptionsRequest": {
    "filtersRequest": [
      {
        "field": "createdAt",
        "matchMode": 10,
        "operator": 1,
        "value": null,
        "values": null,
        "rangeValues": {
          "start": "2024-01-01T00:00:00.000Z",
          "end": "2024-01-31T23:59:59.999Z"
        },
        "ignoreCase": null
      },
      {
        "field": "status",
        "matchMode": 1,
        "operator": 1,
        "value": "answered",
        "values": null,
        "rangeValues": null,
        "ignoreCase": true
      }
    ],
    "sortRequest": [
      {
        "field": "createdAt",
        "direction": 1,
        "priority": 1
      }
    ],
    "includes": [
      "agent",
      "contact",
      "voipPhone"
    ],
    "selectFields": []
  }
}

Response

Got paginated result successfully

totalinteger required

Total number of records

nextIdstring nullable

ID of the next page, if available

currentTotalinteger required

Number of records in the current response

Example response

{
  "data": [
    {}
  ],
  "total": 1,
  "nextId": null,
  "currentTotal": 1
}

Changes

No recorded changes to this operation across all 2 revisions of this API.