Skip to main content

List Extractions by Phone

Retrieve all AI-extracted data across campaigns for a specific phone number.

Endpoint

GET /v1/sms/extractions/phone/{phone_number}

Authentication

X-API-Key
string
required
Your API key

Path Parameters

phone_number
string
required
The contact’s phone number in E.164 format (URL encoded).Example: %2B15551234567 (URL-encoded +15551234567)

Response

success
boolean
Whether the request was successful
extractions
array
List of extraction records for this phone number, sorted by most recent first.
count
integer
Total number of extractions found

Example Request

curl -X GET "https://partner.teli.ai/api/proxy/v1/sms/extractions/phone/%2B15551234567" \
  -H "X-API-Key: your-api-key"

Example Response

{
  "success": true,
  "extractions": [
    {
      "thread_id": "+15551234567_camp_abc123",
      "phone_number": "+15551234567",
      "campaign_id": "camp_abc123",
      "extracted_fields": {
        "credit_score": "730",
        "interested": "yes"
      },
      "lead_outcome": "qualified",
      "objective_met": true,
      "extracted_at": "2026-01-23T19:30:00Z"
    },
    {
      "thread_id": "+15551234567_camp_xyz789",
      "phone_number": "+15551234567",
      "campaign_id": "camp_xyz789",
      "extracted_fields": {
        "interested": "maybe",
        "timeline": "6 months"
      },
      "lead_outcome": "pending",
      "objective_met": false,
      "extracted_at": "2026-01-20T15:45:00Z"
    }
  ],
  "count": 2,
  "powered_by": "Teli"
}

Use Cases

Build Lead History

Track a contact’s interactions across multiple campaigns to build a complete picture:
const response = await fetch(
  `https://partner.teli.ai/api/proxy/v1/sms/extractions/phone/${encodeURIComponent(phoneNumber)}`,
  { headers: { 'X-API-Key': apiKey } }
);
const data = await response.json();

// Aggregate all extracted fields across campaigns
const allFields = {};
data.extractions.forEach(ext => {
  Object.assign(allFields, ext.extracted_fields);
});

console.log('Combined lead data:', allFields);

Find Qualified Leads

const qualifiedLeads = data.extractions.filter(
  ext => ext.lead_outcome === 'qualified'
);