Campaigns
Create campaign
Create a new campaign.
curl -X POST "https://api.flameup.ai/api/v1/workspaces/example_string/campaigns" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"name": "John Doe",
"trigger_type": "event",
"trigger_config": {},
"messages": [
{
"type": "push",
"template": {
"title": "example_string",
"body": "example_string",
"data": {}
}
}
]
}'
import requests
import json
url = "https://api.flameup.ai/api/v1/workspaces/example_string/campaigns"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"name": "John Doe",
"trigger_type": "event",
"trigger_config": {},
"messages": [
{
"type": "push",
"template": {
"title": "example_string",
"body": "example_string",
"data": {}
}
}
]
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.flameup.ai/api/v1/workspaces/example_string/campaigns", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"name": "John Doe",
"trigger_type": "event",
"trigger_config": {},
"messages": [
{
"type": "push",
"template": {
"title": "example_string",
"body": "example_string",
"data": {}
}
}
]
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"name": "John Doe",
"trigger_type": "event",
"trigger_config": {},
"messages": [
{
"type": "push",
"template": {
"title": "example_string",
"body": "example_string",
"data": {}
}
}
]
}`)
req, err := http.NewRequest("POST", "https://api.flameup.ai/api/v1/workspaces/example_string/campaigns", 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/workspaces/example_string/campaigns')
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 = '{
"name": "John Doe",
"trigger_type": "event",
"trigger_config": {},
"messages": [
{
"type": "push",
"template": {
"title": "example_string",
"body": "example_string",
"data": {}
}
}
]
}'
response = http.request(request)
puts response.body
{
"id": "example_string",
"workspace_id": "example_string",
"name": "John Doe",
"status": "draft",
"trigger_type": "event",
"trigger_config": {},
"audience_config": {},
"created_at": "2024-12-25T10:00:00Z",
"updated_at": "2024-12-25T10:00:00Z"
}
POST
/workspaces/{workspaceId}/campaignsPOST
Security Scheme
Bearer Token
Bearer Tokenstring
RequiredYour Flameup API key (passed as Bearer token)
Your Flameup API key (passed as Bearer token)
path
workspaceIdstring
RequiredWorkspace ID
Content-Typestring
RequiredThe media type of the request body
Options: application/json
trigger_typestring
RequiredOptions: event, webhook, schedule, dynamic_schedule
Request Preview
Response
Response will appear here after sending the request
Authentication
BearerAuth
header
Authorizationstring
RequiredBearer token. Your Flameup API key (passed as Bearer token)
Path Parameters
workspaceIdstring
RequiredWorkspace ID
Responses
Was this page helpful?
Built with Documentation.AI
Last updated today