Create / update campaign (wizard step)
Overview
Create or advance a review-solicitation campaign through the 4-step setup wizard, branching on the step field. Step 1 updateOrCreates a draft campaign (owner = authenticated user, company_id = user's company). Step 2 toggles the SMS/Email channels (only when the store's active plan enables the matching solicitation feature). Step 3 stores the scheduling config; step 4 finalizes the campaign to scheduled and computes next_execution_time. Side effects: writes to rs_campaigns and campaign_channels (soft-delete/restore on channel toggles).
Prerequisites
- A bearer token in the
Authorizationheader.
Base URL
| Environment | URL |
|---|---|
| Production | https://production-api.shoutaboutus.com |
| Development | https://development-api.shoutaboutus.com |
Endpoint
POST /api/v1/campaign/create
Authentication
-
Requires a bearer token in the
Authorization: Bearer <bearer-token>header. -
Account — authentication, ACCOUNT-scope group.
store_idmust sit inside your own account tree (must belong to the caller's company); the campaign recordsuser_idand the caller'sperson.company_id.
Rate limit
- No rate limit.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
store_id | integer | Required | an ownership check — must belong to the caller's company. |
step | integer | Required | Wizard step; one of 1,2,3,4. Controls which other fields are required. |
campaign_id | integer | Conditional | Nullable on step 1 (create-new); required on steps 2–4. Must be an existing campaign. |
name | string | Required (step 1) | max 255. |
channel_sms | boolean | Required (step 2) | required_without_all:channel_email. Creates/restores or soft-deletes the SMS channel (only applied when the plan enables review_solicitation_sms). |
channel_email | boolean | Required (step 2) | required_without_all:channel_sms. Creates/restores or soft-deletes the Email channel (only applied when the plan enables review_solicitation_email). |
per_day_request | integer | Required (step 3) | 1–50. Returned in the campaign object as request_per_day. |
request_frequency | integer | Required (step 3) | one of 0,1,2,3,4. Returned with the same field name. |
delay_request | integer | Required (step 3) | 0–60 (days). Returned in the campaign object as request_delay. |
request_after_time_pst | string | Optional (step 3) | H:i:s; defaults 14:00:00. Returned in the campaign object as request_after_time. |
send_immediately | boolean | Optional (step 3) | nullable. When true, step 4 sets next_execution_time to now. |
type | string | Optional (step 3) | one of bulk_upload, automation, kiosk. |
{
"store_id": 123,
"step": 1,
"campaign_id": null,
"name": "Summer Review Campaign"
}How it works
- 200 on every successful step. The response envelope carries
status,message,campaign_id, and the full re-loaded campaign underdata. - 400 (
badRequestResponse) for invalid state transitions: editing a non-draftcampaign on step 2. Missing solicitation feature on the plan; audience/automation not set up on steps 3–4; file still processing on step 4. - 404 when you supply
campaign_idon steps ≥2 but does not resolve. - 422 on validation failure.
Response
200 OK · 200
200{
"data": {
"status": "success",
"message": "Campaign has been saved successfully",
"campaign_id": 1,
"data": {
"id": 1,
"name": "Summer Review Campaign",
"description": null,
"status": "draft",
"current_step": 1,
"store_id": 123,
"scheduled_at": null,
"started_at": null,
"completed_at": null,
"total_audience": 0,
"request_per_day": 0,
"request_frequency": 0,
"request_delay": 0,
"request_after_time": "14:00:00",
"next_execution_time": null,
"request_file_status": "pending",
"request_file_name": null,
"send_immediately": false,
"request_file_path": null,
"type": null,
"channels": [],
"email_requests": [],
"sms_requests": [],
"file_header": null
}
}
}422 Validation · 422
422{
"message": "The name field is required.",
"errors": {
"name": [
"The name field is required."
]
}
}Errors
| Status | Meaning |
|---|---|
400 | The request was rejected — the response explains why |
401 | The bearer token is missing, expired or invalid |
404 | Returned when you supply campaign_id on steps ≥2 but does not resolve |
422 | Validation |
500 | Unexpected server error |
Example request
curl --request POST \
--url "https://production-api.shoutaboutus.com/api/v1/campaign/create" \
--header 'Authorization: Bearer <bearer-token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"store_id": 123, "step": 1, "campaign_id": null, "name": "Summer Review Campaign"}'Updated 11 days ago
