Create campaign with a new agent
/api/v1/ext/dbr-campaigns/new-agent
A campaign plus a new AI agent written for it. Answers 202 with a job.
Describe the business, the offer and how a conversation should close; a new draft AI agent is written for this campaign. That takes 1–3 minutes, so the answer is 202 with a job_id: poll Get campaign creation job until status is done — it then carries the campaign.
close is how the agent finishes: book_appointment (needs calendar_id, from List calendars), send_link (needs booking_url), or collect_enquiry (take the details for your team).
Nothing is sent to anyone. The next step is Preview campaign; going live, test messages and launching the list are done on the Campaigns page.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| workspace_id | body | number | yes | A workspace of the installer. |
| business_description | body | string | yes | What the business does. |
| offer | body | string | yes | What the campaign offers the old leads. |
| close | body | enum | yes | How a conversation ends. |
| calendar_id | body | string | no | For book_appointment: a calendar id. |
| calendar_provider | body | string | no | Where that calendar is: native (default, the Calendar page), google or ghl. |
| booking_url | body | string | no | For send_link: the link to send. |
| business_name | body | string | no | The business's name. |
| sender_name | body | string | no | The name the agent signs as. |
| agent_name | body | string | no | Name of the new agent. |
| campaign_name | body | string | no | Name of the campaign. |
| tone | body | string | no | e.g. Friendly, Professional. |
| qualifying_questions | body | string | no | Questions to ask before closing, one per line. |
| follow_ups | body | boolean | no | Write follow-ups for contacts who do not reply. |
| offer_end_date | body | string | no | When the offer ends. |
| link_or_coupon | body | string | no | A link or coupon code to mention. |
| closing_message | body | string | no | What to say once the conversation is closed. |
| list_size_estimate | body | number | no | About how many contacts are on the list (sets the pacing). |
| missed_call_first | body | boolean | no | Ring each contact with a missed call before the opener. |
| timezone | body | string | no | IANA timezone for the sending hours, e.g. Australia/Sydney. |
| website_url | body | string | no | The business's website. |
| session_id | body | string | no | The session_id from Research a website. |
| research_id | body | string | no | The research_id from Research a website. |
Responses
| Status | When |
|---|---|
202 | Accepted — poll the job |
400 | Missing or invalid field |
400 | Refused by the campaign service, e.g. the workspace is not ready (see Preflight). Its code and message are passed on. |
401 | Missing or invalid token |
403 | Missing scope |
404 | workspace_id does not exist or is not the installer's (same response for both) |
502 | The campaign service could not be reached |
curl -X POST "https://backend.mysmsgateway.app/api/v1/ext/dbr-campaigns/new-agent" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"workspace_id": 7,
"business_name": "Harbour Dental",
"business_description": "Family dental clinic in Sydney: check-ups, cleaning and whitening.",
"offer": "A free check-up for patients we have not seen in a year",
"close": "book_appointment",
"calendar_id": "12",
"tone": "Friendly",
"list_size_estimate": 400,
"timezone": "Australia/Sydney"
}'{
"success": true,
"message": "Writing the campaign's AI agent. Poll GET /dbr-campaigns/jobs/{job_id} until status is done (usually 1–3 minutes).",
"data": {
"job_id": "job_5e2f…",
"status": "queued"
}
}« Research a website
Get campaign creation job »
