curl -X POST "https://server.smartlead.ai/api/v1/campaigns/123/prompt-template?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt_content": "Categorise the reply into one of the following categories...",
"categories": [1, 2, 3, 6]
}'
import requests
response = requests.post(
"https://server.smartlead.ai/api/v1/campaigns/123/prompt-template",
params={"api_key": "YOUR_API_KEY"},
json={
"prompt_content": "Categorise the reply into one of the following categories...",
"categories": [1, 2, 3, 6]
}
)
print(response.json())
{
"success": true,
"data": {
"template": {
"id": 789,
"categories": [1, 2, 3, 6],
"prompt_content": "Categorise the reply into one of the following categories...",
"is_active": true
}
}
}
{
"error": "Campaign not found - Invalid campaign_id."
}
Campaign Management
Create Campaign AI Prompt Template
Add an AI reply-categorisation prompt and lead categories to a campaign
POST
/
api
/
v1
/
campaigns
/
{campaign_id}
/
prompt-template
curl -X POST "https://server.smartlead.ai/api/v1/campaigns/123/prompt-template?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt_content": "Categorise the reply into one of the following categories...",
"categories": [1, 2, 3, 6]
}'
import requests
response = requests.post(
"https://server.smartlead.ai/api/v1/campaigns/123/prompt-template",
params={"api_key": "YOUR_API_KEY"},
json={
"prompt_content": "Categorise the reply into one of the following categories...",
"categories": [1, 2, 3, 6]
}
)
print(response.json())
{
"success": true,
"data": {
"template": {
"id": 789,
"categories": [1, 2, 3, 6],
"prompt_content": "Categorise the reply into one of the following categories...",
"is_active": true
}
}
}
{
"error": "Campaign not found - Invalid campaign_id."
}
The new template is created active (
is_active: true). To change an existing template, use Update Campaign AI Prompt Template.Path Parameters
number
required
Campaign ID
Query Parameters
string
required
Your SmartLead API key
Request Body
string
required
The categorisation prompt (at least 1 character)
number[]
required
Lead category IDs the AI can assign to replies. Get IDs from Get Lead Categories.
curl -X POST "https://server.smartlead.ai/api/v1/campaigns/123/prompt-template?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt_content": "Categorise the reply into one of the following categories...",
"categories": [1, 2, 3, 6]
}'
import requests
response = requests.post(
"https://server.smartlead.ai/api/v1/campaigns/123/prompt-template",
params={"api_key": "YOUR_API_KEY"},
json={
"prompt_content": "Categorise the reply into one of the following categories...",
"categories": [1, 2, 3, 6]
}
)
print(response.json())
Response Example
{
"success": true,
"data": {
"template": {
"id": 789,
"categories": [1, 2, 3, 6],
"prompt_content": "Categorise the reply into one of the following categories...",
"is_active": true
}
}
}
{
"error": "Campaign not found - Invalid campaign_id."
}
