[POST] .../v1/campaign/setstatus
Sets the campaign status Use this workflow method when an external campaign handler or scheduler reports campaign lifecycle progress. The method changes the campaign status, writes an action log record and sends internal notifications for Progress, Completed or Error states. Status transitions are validated as New to Waiting, Waiting to Progress, Progress to Completed, while Error can be set from any state; error_message should be provided for Error and is stored with the campaign error details. The caller must have marketing campaign edit permission; missing body, denied access, missing campaign, invalid transition, unknown status, no affected row, database failures and action-log or notification errors are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| error_message | String | Optional | Error message, stored up to 1000 characters. |
| id | Int64 | Required | Campaign ID. |
| status | String | Required | Mailing status: New - mailing is created but not started yet, Waiting - mailing is waiting for its scheduled time, Progress - mailing has started but is not completed, Completed - mailing is completed, Error - mailing completed with an error. Allowed values: Default, New, Waiting, Progress, Completed, Error. |
Request Example
{
"id": 1,
"status": "Error",
"error_message": "SMS gateway rejected the campaign."
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Update | Update operation result. |
Response Example
{
"ok": true,
"result": {
"row_affected": 1,
"ids": null
}
}