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
Query Parameters
Request Body
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."
}
