curl -X POST "https://server.smartlead.ai/api/v1/campaigns/assign-client?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"campaignId": 123, "clientId": 456, "applyClientDNC": true}'
import requests
response = requests.post(
"https://server.smartlead.ai/api/v1/campaigns/assign-client",
params={"api_key": "YOUR_API_KEY"},
json={"campaignId": 123, "clientId": 456, "applyClientDNC": True}
)
print(response.json())
{
"ok": true,
"message": "success",
"client": {
"id": 456,
"email": "client@example.com"
}
}
{
"ok": true,
"message": "success",
"client": null
}
{
"message": "Invalid client Id!"
}
Campaign Management
Assign Client to Campaign
Assign a campaign to a client (or remove its client), optionally applying the client’s DNC list
POST
/
api
/
v1
/
campaigns
/
assign-client
curl -X POST "https://server.smartlead.ai/api/v1/campaigns/assign-client?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"campaignId": 123, "clientId": 456, "applyClientDNC": true}'
import requests
response = requests.post(
"https://server.smartlead.ai/api/v1/campaigns/assign-client",
params={"api_key": "YOUR_API_KEY"},
json={"campaignId": 123, "clientId": 456, "applyClientDNC": True}
)
print(response.json())
{
"ok": true,
"message": "success",
"client": {
"id": 456,
"email": "client@example.com"
}
}
{
"ok": true,
"message": "success",
"client": null
}
{
"message": "Invalid client Id!"
}
Requires your own API key. Client API keys get
401.Assigning a client also:- replaces the campaign’s SmartServer assignments with the new client’s SmartServers
- sets the client on the campaign and its subsequences
- shares the campaign’s leads with the new client
Query Parameters
string
required
Your SmartLead API key
Request Body
number
required
Campaign ID
number | null
Client ID to assign. Use
null to remove the campaign’s client.boolean | null
When
true and clientId is set, the client’s DNC (block list) is applied to the campaigncurl -X POST "https://server.smartlead.ai/api/v1/campaigns/assign-client?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"campaignId": 123, "clientId": 456, "applyClientDNC": true}'
import requests
response = requests.post(
"https://server.smartlead.ai/api/v1/campaigns/assign-client",
params={"api_key": "YOUR_API_KEY"},
json={"campaignId": 123, "clientId": 456, "applyClientDNC": True}
)
print(response.json())
Response Example
{
"ok": true,
"message": "success",
"client": {
"id": 456,
"email": "client@example.com"
}
}
{
"ok": true,
"message": "success",
"client": null
}
{
"message": "Invalid client Id!"
}
message values on error: Invalid campaign Id!, Cannot assign client to a sub sequence!, Cannot assign the same client to the campaign, Invalid client Id!.