Skip to main content

Get SMS Extraction

Retrieve AI-extracted data from an SMS conversation thread.
Extraction happens automatically when the AI analyzes conversations. Configure extraction fields on your SMS agent to specify what data to extract.

Endpoint

GET /v1/sms/extractions/{thread_id}

Authentication

X-API-Key
string
required
Your API key

Path Parameters

thread_id
string
required
The conversation thread ID. Format: {phone_number}_{campaign_id}Example: +15551234567_camp_abc123

Response

success
boolean
Whether the request was successful
extraction
object
The extraction data (null if no extraction found)

Example Request

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

Example Response

Extraction Found

{
  "success": true,
  "extraction": {
    "thread_id": "+15551234567_camp_abc123",
    "phone_number": "+15551234567",
    "extracted_fields": {
      "credit_score": "730",
      "loan_amount": "250000",
      "interested": "yes",
      "timeline": "3 months"
    },
    "lead_outcome": "qualified",
    "objective_met": true,
    "do_not_message": false,
    "call_transferred": false,
    "call_scheduled": true,
    "call_scheduled_time": "2026-01-25T14:00:00Z",
    "extracted_at": "2026-01-23T19:30:00Z",
    "campaign_id": "camp_abc123"
  },
  "powered_by": "Teli"
}

No Extraction Found

{
  "success": true,
  "extraction": null,
  "message": "No extraction found for this thread",
  "powered_by": "Teli"
}

Configuring Extraction Fields

Extraction fields are configured on your SMS Agent. When creating or updating an SMS agent, specify the fields you want to extract:
curl -X POST "https://partner.teli.ai/api/proxy/v1/agents" \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_type": "sms",
    "agent_name": "Mortgage Lead Qualifier",
    "prompt": "You are a mortgage specialist...",
    "extraction_fields": [
      "credit_score",
      "loan_amount", 
      "property_value",
      "annual_income",
      "interested",
      "timeline"
    ],
    "organization_id": "org_xxx",
    "user_id": "user_xxx"
  }'
The AI will automatically extract these fields from the conversation and store them for retrieval.

Best Practices

  1. Use descriptive field names: credit_score is better than cs
  2. Keep fields focused: Extract specific data points, not entire paragraphs
  3. Configure relevant fields: Only extract what you need for your workflow
  4. Check lead_outcome: Use this to prioritize follow-ups