Update Campaign
This endpoint allows you to update specific attributes of an existing campaign, such as its status, start time, or end time. You can selectively update fields by providing values for them; any omitted
HTTP Method and URL
Method: POST
URL: https://www.tabbly.io/dashboard/agents/endpoints/update-campaign
Request Headers
Content-Type
application/json
Yes
Request Body
The request body is a JSON object containing the following fields:
api_key
string
Your API key for authentication.
Yes
organization_id
integer
The ID of the organization owning the campaign.
Yes
id
integer
The unique ID of the campaign to update.
Yes
current_status
string (optional)
The new status for the campaign (e.g., "Active", "Paused", "Completed").
No
start_time
string (optional)
The new start time in format YYYY-MM-DD HH:MM:SS (e.g., "2025-01-09 19:30:00").
No
end_time
string (optional)
The new end time in format YYYY-MM-DD HH:MM:SS (e.g., "2025-01-10 19:30:00").
No
Notes on Optional Fields:
Only provide values for the fields you wish to update. Empty or omitted fields (e.g., "" or absent keys) will be ignored, and the campaign's existing values for those fields will remain unchanged.
Valid values for current_status depend on your system's configuration (e.g., "Active", "Inactive", etc.). Check your dashboard for supported statuses.
Example cURL Request
bash
In this example:
The campaign's status is updated to "Active".
The start and end times are set to the specified values.
If you wanted to update only the status (ignoring times), you could omit start_time and end_time or set them to empty strings.
Response
Success (200 OK): Returns a JSON object confirming the update, e.g., {"success": true, "message": "Campaign updated successfully", "updated_campaign": {...}}.
Error (4xx/5xx): Returns a JSON error object, e.g., {"error": "Invalid API key"}. Common errors include invalid authentication, non-existent campaign ID, or malformed dates.
For full error codes and troubleshooting, refer to the API Error Handling Guide. If you encounter issues, ensure your times are in UTC and match the required format.
Last updated