Skip to main content
PATCH
/
v1
/
agents
/
{agent_id}
Update SMS Agent
curl --request PATCH \
  --url https://api.example.com/v1/agents/{agent_id} \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <x-api-key>' \
  --data '
{
  "agent_name": "<string>",
  "starting_message": "<string>",
  "prompt": "<string>",
  "extraction_fields": [
    {}
  ],
  "drip_schedule": [
    {}
  ]
}
'
{
  "success": true,
  "agent_id": "agent_abc123",
  "message": "Agent updated successfully"
}

Overview

Update an existing SMS agent’s configuration. Modify the agent name, starting message, AI prompt, and automated drip message sequences.
This endpoint is for SMS agents only. For voice agents, see Update Voice Agent.

Authentication

X-API-Key
string
required
Your Teli API key

Path Parameters

agent_id
string
required
The unique identifier of the SMS agent to update

Request Body

All fields are optional. Only include the fields you want to update.

Basic Settings

agent_name
string
Display name for the agent
starting_message
string
First message sent to leads. Supports variables: {{first_name}}, {{last_name}}, {{company}}
prompt
string
AI behavior instructions defining personality, goals, and conversation guidelines

Data Extraction

extraction_fields
array
Fields to extract from conversations using AI.Example: ["credit_score", "loan_amount", "interested", "timeline"]

Drip Schedule

drip_schedule
array
Automated follow-up message sequence. Each message is sent after a delay if the lead hasn’t responded.

Drip Schedule Object

FieldTypeDescription
delay_hoursnumberHours to wait before sending
typestring"ai" for AI-generated or "custom" for fixed message
messagestringThe follow-up message (required if type is "custom")

Request Examples

Update Basic Settings

curl -X PATCH "https://api.teli.ai/v1/agents/agent_abc123" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_name": "Updated Sales Agent",
    "starting_message": "Hi {{first_name}}! Ready to learn more about our services?",
    "prompt": "You are a friendly sales representative. Your goal is to qualify leads and schedule demos. Be helpful and not pushy."
  }'

Update Extraction Fields

curl -X PATCH "https://api.teli.ai/v1/agents/agent_abc123" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "extraction_fields": ["credit_score", "loan_amount", "annual_income", "interested", "timeline"]
  }'

Update Drip Schedule

curl -X PATCH "https://api.teli.ai/v1/agents/agent_abc123" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "drip_schedule": [
      {
        "delay_hours": 4,
        "type": "ai"
      },
      {
        "delay_hours": 24,
        "type": "custom",
        "message": "Hi {{first_name}}, just checking in!"
      },
      {
        "delay_hours": 72,
        "type": "custom",
        "message": "Last follow-up {{first_name}} - let me know if interested!"
      }
    ]
  }'

Disable Drip Messages

Send an empty array to disable automated follow-ups:
{
  "drip_schedule": []
}

Response

Success Response

{
  "success": true,
  "agent_id": "agent_abc123",
  "message": "Agent updated successfully"
}
success
boolean
Indicates successful update
agent_id
string
The updated agent’s unique identifier
message
string
Success confirmation message

Error Responses

{
  "success": false,
  "error": "Agent not found"
}

Dynamic Variables

Personalize messages with lead data:
VariableDescription
{{first_name}}Lead’s first name
{{last_name}}Lead’s last name
{{phone_number}}Lead’s phone number
{{email}}Lead’s email address
{{company}}Lead’s company name
Example:
{
  "starting_message": "Hi {{first_name}} from {{company}}! I'd love to chat about your needs."
}

Best Practices

Test first: Update a test agent before modifying production agents
Use personalization: Include {{first_name}} for better engagement
Keep drips concise: 2-4 follow-up messages work best
Space out drips: Give leads time to respond between messages
Clear prompts: Specific AI instructions produce better conversations

Notes

  • Drip schedule update: Resets the drip timer for all active leads in campaigns using this agent
  • Agent type: Cannot be changed from SMS to Voice
  • Active campaigns: Changes take effect for new conversations immediately