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
Path Parameters
The conversation thread ID. Format: {phone_number}_{campaign_id}Example: +15551234567_camp_abc123
Response
Whether the request was successful
The extraction data (null if no extraction found)Show extraction properties
Conversation thread identifier
Contact’s phone number in E.164 format
Key-value pairs of extracted data. Keys match your configured extraction_fields.Example:{
"credit_score": "730",
"loan_amount": "250000",
"interested": "yes",
"timeline": "3 months"
}
AI-determined lead classification:
qualified - Lead expressed interest and met criteria
not_interested - Lead declined
dnc - Added to Do Not Contact list
transferred - Lead was transferred to a live agent
pending - Still in conversation
Whether the campaign objective was achieved
Whether the contact should not receive further messages
Whether the conversation was transferred to a live agent
Whether a call was scheduled
ISO 8601 timestamp of scheduled call (if applicable)
ISO 8601 timestamp when extraction occurred
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
{
"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"
}
{
"success": true,
"extraction": null,
"message": "No extraction found for this thread",
"powered_by": "Teli"
}
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
- Use descriptive field names:
credit_score is better than cs
- Keep fields focused: Extract specific data points, not entire paragraphs
- Configure relevant fields: Only extract what you need for your workflow
- Check lead_outcome: Use this to prioritize follow-ups