# Request 1: Activate a draft campaign
curl -X PATCH "https://app.talkover.ai/api/v1/campaigns/campaign-uuid-1/status" \
-H "Authorization: Bearer talq_your_environment_token_here" \
-H "Content-Type: application/json" \
-d '{
"status": "active"
}'
// Request 1: Activate a draft campaign
const response = await fetch('https://app.talkover.ai/api/v1/campaigns/campaign-uuid-1/status', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer talq_your_environment_token_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
status: 'active'
})
});
const result = await response.json();
console.log(result);
{
"success": true,
"message": "Campaign status updated successfully",
"data": {
"id": "campaign-uuid-1",
"status": "active",
"updated_at": "2024-01-01T12:00:00Z"
}
}
Calls & Campaigns
Update Campaign Status
Update the status of a campaign (draft, active, paused, completed, cancelled)
PATCH
/
api
/
v1
/
campaigns
/
{campaign_id}
/
status
# Request 1: Activate a draft campaign
curl -X PATCH "https://app.talkover.ai/api/v1/campaigns/campaign-uuid-1/status" \
-H "Authorization: Bearer talq_your_environment_token_here" \
-H "Content-Type: application/json" \
-d '{
"status": "active"
}'
// Request 1: Activate a draft campaign
const response = await fetch('https://app.talkover.ai/api/v1/campaigns/campaign-uuid-1/status', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer talq_your_environment_token_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
status: 'active'
})
});
const result = await response.json();
console.log(result);
{
"success": true,
"message": "Campaign status updated successfully",
"data": {
"id": "campaign-uuid-1",
"status": "active",
"updated_at": "2024-01-01T12:00:00Z"
}
}
Update Campaign Status
Update the status of a campaign to control its lifecycle. Activates , pause, complete, or cancel campaigns.Endpoint
PATCH /api/v1/campaigns/{campaign_id}/status
Path parameters
string
required
The unique identifier of the campaign.
Request headers
string
required
Bearer token for authentication. Format:
Bearer talq_your_environment_token_herestring
required
Application JSON. Format:
application/jsonRequest body
string
required
New status for the campaign. Options:
draft, active, paused, completed, cancelled.Valid Status Values
| Status | Description |
|---|---|
draft | Campaign is in draft mode and not yet active |
active | Campaign is running and making calls |
paused | Campaign is paused and not making new calls |
completed | Campaign has finished all scheduled calls |
cancelled | Campaign was cancelled and will not make more calls |
Example requests
# Request 1: Activate a draft campaign
curl -X PATCH "https://app.talkover.ai/api/v1/campaigns/campaign-uuid-1/status" \
-H "Authorization: Bearer talq_your_environment_token_here" \
-H "Content-Type: application/json" \
-d '{
"status": "active"
}'
// Request 1: Activate a draft campaign
const response = await fetch('https://app.talkover.ai/api/v1/campaigns/campaign-uuid-1/status', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer talq_your_environment_token_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
status: 'active'
})
});
const result = await response.json();
console.log(result);
# Request 2: Pause an active campaign
curl -X PATCH "https://app.talkover.ai/api/v1/campaigns/campaign-uuid-1/status" \
-H "Authorization: Bearer talq_your_environment_token_here" \
-H "Content-Type: application/json" \
-d '{
"status": "paused"
}'
// Request 2: Pause an active campaign
const response = await fetch('https://app.talkover.ai/api/v1/campaigns/campaign-uuid-1/status', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer talq_your_environment_token_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
status: 'paused'
})
});
const result = await response.json();
console.log(result);
# Request 3: Cancel a campaign
curl -X PATCH "https://app.talkover.ai/api/v1/campaigns/campaign-uuid-1/status" \
-H "Authorization: Bearer talq_your_environment_token_here" \
-H "Content-Type: application/json" \
-d '{
"status": "cancelled"
}'
// Request 3: Cancel a campaign
const response = await fetch('https://app.talkover.ai/api/v1/campaigns/campaign-uuid-1/status', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer talq_your_environment_token_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
status: 'cancelled'
})
});
const result = await response.json();
console.log(result);
Response
Success Response (200 OK)
{
"success": true,
"message": "Campaign status updated successfully",
"data": {
"id": "campaign-uuid-1",
"status": "active",
"updated_at": "2024-01-01T12:00:00Z"
}
}
Response fields
boolean
required
Indicates if the operation was successful.
string
required
Success message describing the operation.
object
required
Error responses
404 Not Found
{
"success": false,
"message": "Campaign not found"
}
422 Validation Error
{
"success": false,
"message": "The given data was invalid.",
"errors": {
"status": [
"The selected status is invalid."
]
}
}
400 Bad Request
{
"success": false,
"message": "Cannot transition from active to draft status"
}
401 Unauthorized
{
"success": false,
"message": "Unauthorized"
}
403 Forbidden
{
"success": false,
"message": "Cannot update campaign status"
}
500 Server Error
{
"success": false,
"message": "Internal server error."
}
Error codes
| Code | Description | HTTP Status |
|---|---|---|
CAMPAIGN_NOT_FOUND | Specified campaign does not exist | 404 |
VALIDATION_ERROR | Invalid status value provided | 422 |
INVALID_TRANSITION | Invalid status transition attempted | 400 |
INVALID_TOKEN | Authentication token is invalid or missing | 401 |
FORBIDDEN | Cannot update campaign status | 403 |
SERVER_ERROR | Internal server error occurred | 500 |
Status Transition Rules
| Current Status | Allowed Transitions |
|---|---|
draft | active, cancelled |
active | paused, completed, cancelled |
paused | active, completed, cancelled |
completed | None (final state) |
cancelled | None (final state) |
Important notes
Status transitions. Not all status transitions are allowed. See the transition rules above.
Final states. Once a campaign reaches
completed or cancelled status, it cannot be changed.Active campaigns. Activating a campaign will start making calls according to the schedule.
Paused campaigns. Pausing a campaign stops new calls but doesn’t affect calls already in progress.
Cancelled campaigns. Cancelling a campaign stops all future calls and cannot be undone.
Related endpoints
- Get Campaign:
GET /api/v1/campaigns/{campaign_id} - Update Campaign:
PUT /api/v1/campaigns/{campaign_id} - Create Campaign:
POST /api/v1/campaigns - Delete Campaign:
DELETE /api/v1/campaigns/{campaign_id} - List Campaigns:
GET /api/v1/campaigns
Was this page helpful?