curl "https://server.smartlead.ai/api/v1/campaigns/123/prompt-template?api_key=YOUR_KEY"
import requests
response = requests.get(
"https://server.smartlead.ai/api/v1/campaigns/123/prompt-template",
params={"api_key": "YOUR_API_KEY"}
)
template = response.json()["data"]["template"]
print("Has AI prompt" if template else "No AI prompt")
{
"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
}
}
}
{
"success": true,
"data": {
"template": null
}
}
{
"error": "Campaign not found - Invalid campaign_id."
}
Campaign Management
Get Campaign AI Prompt Template
Fetch the AI reply-categorisation prompt and lead categories configured on a campaign
GET
/
api
/
v1
/
campaigns
/
{campaign_id}
/
prompt-template
curl "https://server.smartlead.ai/api/v1/campaigns/123/prompt-template?api_key=YOUR_KEY"
import requests
response = requests.get(
"https://server.smartlead.ai/api/v1/campaigns/123/prompt-template",
params={"api_key": "YOUR_API_KEY"}
)
template = response.json()["data"]["template"]
print("Has AI prompt" if template else "No AI prompt")
{
"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
}
}
}
{
"success": true,
"data": {
"template": null
}
}
{
"error": "Campaign not found - Invalid campaign_id."
}
Use this to check whether a campaign already has an AI prompt:
data.template is null when none is configured.Path Parameters
number
required
Campaign ID
Query Parameters
string
required
Your SmartLead API key
curl "https://server.smartlead.ai/api/v1/campaigns/123/prompt-template?api_key=YOUR_KEY"
import requests
response = requests.get(
"https://server.smartlead.ai/api/v1/campaigns/123/prompt-template",
params={"api_key": "YOUR_API_KEY"}
)
template = response.json()["data"]["template"]
print("Has AI prompt" if template else "No AI prompt")
Response
object | null
{
"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
}
}
}
{
"success": true,
"data": {
"template": null
}
}
{
"error": "Campaign not found - Invalid campaign_id."
}
