CampaignsCreate campaign

Create campaign

Create a new campaign. Message content is not set here: define it with workflow_definition or template_id, or attach per-node content with PUT /workspaces/{workspace_id}/campaigns/{campaign_id}/node-messages/{node_id} after the campaign exists.

curl -X POST "https://api.flameup.ai/api/v1/campaigns" \
  -H "Content-Type: application/json" \
  -H "X-Workspace-ID: example_string" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "name": "John Doe",
  "trigger_type": "event",
  "trigger_config": {
    "event_names": [
      "John Doe"
    ],
    "filters": [
      {
        "field": "example_string",
        "operator": "eq",
        "value": "null"
      }
    ],
    "properties": {},
    "debounce": 3.14,
    "delay_minutes": 3.14,
    "max_per_user": 42,
    "first_occurrence": true
  }
}'
{
  "success": true,
  "data": {
    "campaign": {
      "id": "example_string",
      "workspace_id": "example_string",
      "name": "John Doe",
      "status": "draft",
      "trigger_type": "event",
      "trigger_config": {
        "event_names": [
          "John Doe"
        ],
        "filters": [
          {
            "field": "example_string",
            "operator": "eq",
            "value": "null"
          }
        ],
        "properties": {},
        "debounce": 3.14,
        "delay_minutes": 3.14,
        "max_per_user": 42,
        "first_occurrence": true
      },
      "audience_config": {},
      "created_at": "2024-12-25T10:00:00Z",
      "updated_at": "2024-12-25T10:00:00Z"
    },
    "message": "example_string",
    "warnings": [
      {}
    ]
  }
}
POST
/campaigns
POST
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

A Firebase ID token from a signed-in dashboard session. Endpoints using this scheme are NOT callable with an API key and will reject one.

A Firebase ID token from a signed-in dashboard session. Endpoints using this scheme are NOT callable with an API key and will reject one.
Content-Typestring
Required

The media type of the request body

Options: application/json
header
X-Workspace-IDstring
Required

The workspace to operate on, for dashboard routes that carry no workspace_id path segment. A workspace_id query parameter is accepted as an alternative; either way the value is checked against the signed-in user's workspace membership before it is trusted.

trigger_typestring
Required
Options: event, webhook, schedule, dynamic_schedule
trigger_configstring
Required

Shape depends on trigger_type — see EventTriggerConfig, WebhookTriggerConfig and ScheduleTriggerConfig. Validation is lenient at creation (per-type required fields are enforced at activation), but known-bad keys such as event_name are rejected immediately. The key itself is required: a body without trigger_config is rejected with 400 before any per-type validation runs. An empty object {} satisfies the binding.

Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. A Firebase ID token from a signed-in dashboard session. Endpoints using this scheme are NOT callable with an API key and will reject one.

Headers

X-Workspace-IDstring
Required

The workspace to operate on, for dashboard routes that carry no workspace_id path segment. A workspace_id query parameter is accepted as an alternative; either way the value is checked against the signed-in user's workspace membership before it is trusted.

Body

application/json
trigger_typestring
Required
Allowed values:eventwebhookscheduledynamic_schedule
trigger_configstring
Required

Shape depends on trigger_type — see EventTriggerConfig, WebhookTriggerConfig and ScheduleTriggerConfig. Validation is lenient at creation (per-type required fields are enforced at activation), but known-bad keys such as event_name are rejected immediately.

The key itself is required: a body without trigger_config is rejected with 400 before any per-type validation runs. An empty object \\{\\} satisfies the binding.

Responses