curl -X PATCH "https://server.smartlead.ai/api/v1/campaigns/123/prompt-template/789?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"categories": [1, 2, 3, 6, 7]}'
import requests
response = requests.patch(
"https://server.smartlead.ai/api/v1/campaigns/123/prompt-template/789",
params={"api_key": "YOUR_API_KEY"},
json={"categories": [1, 2, 3, 6, 7]}
)
print(response.json())
{
"success": true,
"data": {
"id": 789
}
}
{
"error": "Campaign not found - Invalid campaign_id."
}
{
"error": "Prompt template not found - Invalid template_id."
}
Campaign Management
Update Campaign AI Prompt Template
Update the AI reply-categorisation prompt, lead categories or active state of a campaign’s template
PATCH
/
api
/
v1
/
campaigns
/
{campaign_id}
/
prompt-template
/
{template_id}
curl -X PATCH "https://server.smartlead.ai/api/v1/campaigns/123/prompt-template/789?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"categories": [1, 2, 3, 6, 7]}'
import requests
response = requests.patch(
"https://server.smartlead.ai/api/v1/campaigns/123/prompt-template/789",
params={"api_key": "YOUR_API_KEY"},
json={"categories": [1, 2, 3, 6, 7]}
)
print(response.json())
{
"success": true,
"data": {
"id": 789
}
}
{
"error": "Campaign not found - Invalid campaign_id."
}
{
"error": "Prompt template not found - Invalid template_id."
}
Send at least one field. Only the fields you send are changed. Get
template_id from Get Campaign AI Prompt Template.Path Parameters
number
required
Campaign ID
number
required
Prompt template ID
Query Parameters
string
required
Your SmartLead API key
Request Body
string
The categorisation prompt (at least 1 character)
number[]
Lead category IDs the AI can assign to replies (replaces the current list)
boolean
Whether the template is active
curl -X PATCH "https://server.smartlead.ai/api/v1/campaigns/123/prompt-template/789?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"categories": [1, 2, 3, 6, 7]}'
import requests
response = requests.patch(
"https://server.smartlead.ai/api/v1/campaigns/123/prompt-template/789",
params={"api_key": "YOUR_API_KEY"},
json={"categories": [1, 2, 3, 6, 7]}
)
print(response.json())
Response Example
{
"success": true,
"data": {
"id": 789
}
}
{
"error": "Campaign not found - Invalid campaign_id."
}
{
"error": "Prompt template not found - Invalid template_id."
}
