Create campaign
curl --request POST \
--url https://api.vambe.me/api/public/outreach-campaign \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"name": "<string>",
"segment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"steps": [
{
"type": "meta_template",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stage_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"variables": {
"1": "__CONTACT_NAME__",
"2": "20% off"
},
"file_url": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
segment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
steps: [
{
type: 'meta_template',
template_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
channel_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
stage_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
variables: {'1': '__CONTACT_NAME__', '2': '20% off'},
file_url: '<string>'
}
]
})
};
fetch('https://api.vambe.me/api/public/outreach-campaign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.vambe.me/api/public/outreach-campaign"
payload = {
"name": "<string>",
"segment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"steps": [
{
"type": "meta_template",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stage_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"variables": {
"1": "__CONTACT_NAME__",
"2": "20% off"
},
"file_url": "<string>"
}
]
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"segment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"audience_size": 123,
"start_at": "2023-11-07T05:31:56Z",
"batch_size": 123,
"batch_interval_minutes": 123,
"steps": [
{
"step_number": 123,
"type": "meta_template",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stage_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"wait_before": {
"amount": 2,
"unit": "minutes"
},
"ai_filled_variables": [
"<string>"
]
}
]
}Campaigns
Create campaign
Create a one-time campaign that sends up to 5 Meta templates, in order, to the contacts of a segment. A recipient who replies stops receiving the steps after it. One campaign can be created every 30 minutes per account.
POST
/
api
/
public
/
outreach-campaign
Create campaign
curl --request POST \
--url https://api.vambe.me/api/public/outreach-campaign \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"name": "<string>",
"segment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"steps": [
{
"type": "meta_template",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stage_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"variables": {
"1": "__CONTACT_NAME__",
"2": "20% off"
},
"file_url": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
segment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
steps: [
{
type: 'meta_template',
template_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
channel_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
stage_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
variables: {'1': '__CONTACT_NAME__', '2': '20% off'},
file_url: '<string>'
}
]
})
};
fetch('https://api.vambe.me/api/public/outreach-campaign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.vambe.me/api/public/outreach-campaign"
payload = {
"name": "<string>",
"segment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"steps": [
{
"type": "meta_template",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stage_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"variables": {
"1": "__CONTACT_NAME__",
"2": "20% off"
},
"file_url": "<string>"
}
]
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"segment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"audience_size": 123,
"start_at": "2023-11-07T05:31:56Z",
"batch_size": 123,
"batch_interval_minutes": 123,
"steps": [
{
"step_number": 123,
"type": "meta_template",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stage_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"wait_before": {
"amount": 2,
"unit": "minutes"
},
"ai_filled_variables": [
"<string>"
]
}
]
}Creates a one-time campaign that sends up to 5 Meta templates, in order, to the contacts of a segment.
Header and body variables you leave out are written by the AI for each recipient, from their contact information and conversation. The response lists them in
How it sends
- Audience: the segmentβs contacts are captured when the campaign is created. Contacts who join the segment later are not added.
- Steps: each step waits
wait_before(1 day by default) after the previous one. A recipient who replies stops receiving the steps after it. - Start:
start_atis"now"(the default) or a future date-time. Withoutbatch_size, everyone is released at once; withbatch_sizeandbatch_interval_minutes, the audience is released in batches until everyone has been reached.
Template variables
variables sets each template variable by its position: "1" is {{1}}, counted across header, body and buttons, in that order. A value is either fixed text or a contact placeholder resolved for each recipient:
| Placeholder | Value |
|---|---|
__CONTACT_NAME__ | Contact name |
__CONTACT_EMAIL__ | Contact email |
__CONTACT_PHONE__ | Contact phone |
ai_filled_variables. Button variables (URLs, phone numbers and button text) are required.
Limits
One campaign can be created every 30 minutes per account. A request inside that window answers429 with retry_after_seconds. Requests rejected with a 4xx before the campaign is created do not start the window.
Track the campaign with Get campaign and Get campaign recipients.Headers
API key needed to authorize the request
Body
application/json
Required string length:
1 - 255The segment to send to. Its contacts are captured when the campaign is created; contacts who join the segment later are not added.
The messages to send, in order. A recipient who replies stops receiving the steps after it.
Required array length:
1 - 5 elementsShow child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
