Create Campaign

Updated on October 2, 2024

This API allows you to create a custom campaign in Releva. You can then use this campaign, a custom email, and a segment run, to send emails via API.

Request Parameters #

You may perform requests to the API using the following curl equivalent:

curl -H 'content-type: application/json' -H 'authorization: Bearer <secretKey>' -XPOST 'https://releva.ai/api/v0/campaigns' -d'{"name": "custom campaign test", "emailId": <id>, "segmentId": <id>, "tags": ["active_users", "draft"]}'

Request Body #

Field Type Description
name String The name of the campaign.
emailId Integer The id of the custom email to bind to this campaign. Should be obtained using the Create Email API
segmentId Integer The id of the segment to bind to this campaign. Reach out to support@releva.ai to obtain one.
tags Array of String (Optional) Tags to tag this campaign.

Response Format #

A successful response will return HTTP Status 200 and a JSON body with the following structure. You will need the campaignId in order to send emails.

{
  "campaignId": <number>,
}

An error response will return a HTTP 4xx or 5xx status code and have the following structure:

{
  "message": "A description of the error and how to fix it, if it's a client error."
}