Trigger campaign
Trigger a webhook campaign for its configured audience. The campaign id is workspace-agnostic in the path, but the body's workspace_id is required and must match the API key's workspace. Requires the campaigns:trigger permission.
Only campaigns with trigger_type: webhook in active status can be triggered this way — anything else is a 400. The audience comes from the campaign's own configuration; you cannot pass user ids or filters here.
curl -X POST "https://api.flameup.ai/api/v1/campaigns/example_string/trigger" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"workspace_id": "example_string",
"trigger_data": {}
}'
import requests
import json
url = "https://api.flameup.ai/api/v1/campaigns/example_string/trigger"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"workspace_id": "example_string",
"trigger_data": {}
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.flameup.ai/api/v1/campaigns/example_string/trigger", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"workspace_id": "example_string",
"trigger_data": {}
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"workspace_id": "example_string",
"trigger_data": {}
}`)
req, err := http.NewRequest("POST", "https://api.flameup.ai/api/v1/campaigns/example_string/trigger", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.flameup.ai/api/v1/campaigns/example_string/trigger')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"workspace_id": "example_string",
"trigger_data": {}
}'
response = http.request(request)
puts response.body
{
"success": true,
"campaign_id": "example_string",
"people_queued": 42,
"audience_truncated": true,
"status": "processing",
"triggered_at": "2024-12-25T10:00:00Z",
"message": "example_string"
}
{
"success": false,
"error": "Person not found",
"code": "example_string"
}
{
"error": "Unauthorized",
"message": "Invalid or expired API key",
"details": "Please provide a valid API key in the Authorization header: Bearer <your_api_key>"
}
{
"success": false,
"error": {
"code": "example_string",
"message": "example_string",
"details": {}
}
}
{
"success": false,
"error": "Person not found",
"code": "example_string"
}
{
"error": "Unauthorized",
"message": "Invalid or expired API key",
"details": "Please provide a valid API key in the Authorization header: Bearer <your_api_key>"
}
{
"success": false,
"error": {
"code": "example_string",
"message": "example_string",
"details": {}
}
}
{
"success": false,
"error": "Person not found",
"code": "example_string"
}
{
"error": "Unauthorized",
"message": "Invalid or expired API key",
"details": "Please provide a valid API key in the Authorization header: Bearer <your_api_key>"
}
{
"success": false,
"error": {
"code": "example_string",
"message": "example_string",
"details": {}
}
}
/campaigns/{campaignId}/triggerTarget server for requests. Edit to use your own host.
Your Flameup API key (passed as Bearer token)
Campaign ID
The media type of the request body
Must equal the workspace the API key belongs to; any other value is a 403.
Optional context data passed into the workflow execution for this trigger.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. Your Flameup API key (passed as Bearer token)
Path Parameters
Campaign ID
Body
Must equal the workspace the API key belongs to; any other value is a 403.
Optional context data passed into the workflow execution for this trigger.