GET
/
calls
/
find_by_attribute
curl --request GET \
  --url https://api.prod.usesimple.ai/api/v1/calls/find_by_attribute \
  --header 'Authorization: <api-key>'
{
  "success": true,
  "call": {
    "id": 123,
    "simple_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "record": true,
    "language": "en",
    "from_number": "<string>",
    "to_number": "<string>",
    "status": "<string>",
    "transferred": true,
    "direction": "<string>",
    "tags": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "name": "<string>",
        "description": "<string>",
        "color": "<string>"
      }
    ],
    "voice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "background_noise": "<string>",
    "agent_speaks_first": true,
    "started_at": "2023-11-07T05:31:56Z",
    "ended_at": "2023-11-07T05:31:56Z",
    "duration": 123,
    "created_at": "2023-11-07T05:31:56Z",
    "external_identifiers": {},
    "params": {},
    "prompt": {
      "prompt_text": "<string>",
      "created_at": "2023-11-07T05:31:56Z"
    },
    "transcripts": [
      {
        "text": "<string>",
        "role": "<string>",
        "timestamp": "2023-11-07T05:31:56Z",
        "function_name": "<string>",
        "arguments": {}
      }
    ],
    "recording_presigned_url": "<string>",
    "call_prompt": "<string>",
    "answered_by": "voicemail",
    "analyzers": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "prompt": "<string>",
        "output_config": {
          "type": "string",
          "properties": {}
        }
      }
    ],
    "analysis_results": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "analyzer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "prompt": "<string>",
        "output_config": {},
        "result": {}
      }
    ],
    "summary": {}
  }
}

Overview

This endpoint allows you to find a call by searching for specific attributes in either the call’s params or external_identifiers fields. It returns the most recent call that matches your search criteria.

Search Options

You must provide at least one of the following search criteria:

Search by Parameters

  • param_key + param_value: Search for a call where the params field contains the specified key-value pair

Search by External Identifiers

  • external_identifier_key + external_identifier_value: Search for a call where the external_identifiers field contains the specified key-value pair

Example Use Cases

  1. Find a call by customer ID:

    GET /calls/find_by_attribute?external_identifier_key=customer_id&external_identifier_value=CUST-123456
  2. Find a call by appointment type:

    GET /calls/find_by_attribute?param_key=appointment_type&param_value=morning

Response

Returns a CallFindByAttributeResponse object containing:

  • success: Boolean indicating if a call was found
  • call: The full call details (same as the Get Call endpoint) if found

Notes

  • Only returns the most recent call matching the criteria
  • Searches are case-sensitive
  • Returns 404 if no matching call is found
  • Returns 422 if no search criteria are provided

Authorizations

Authorization
string
header
required

Query Parameters

param_key
string

The key to search for in the call's params field

param_value
string

The value to match for the specified param_key

external_identifier_key
string

The key to search for in the call's external_identifiers field

external_identifier_value
string

The value to match for the specified external_identifier_key

Response

200
application/json

Successful Response

The response is of type object.