Marketing API

Marketing API

The marketing API (/api/v1) manages the same lists, contacts and campaigns you see in the app. Use it to add sign-ups from your own forms, sync customers from your system, or start campaigns from code. For sending individual emails from your app, use the email API instead.

Authentication

Find your account’s API token in the app under Developers › Campaign API, and send it as a Bearer token:

Authorization: Bearer <your API token>

This token is different from the email API’s rb_live_ keys.

Common requests

MethodPathWhat it does
GET/api/v1/listsYour lists
POST/api/v1/listsCreate a list
GET/api/v1/lists/{uid}One list
POST/api/v1/lists/{uid}/add-fieldAdd a custom field to a list
GET/api/v1/subscribers?list_uid={uid}Contacts in a list, paginated (per_page, page)
POST/api/v1/subscribersAdd a contact to a list
GET/api/v1/subscribers/{uid}One contact
GET/api/v1/subscribers/email/{email}Find a contact by email
PATCH/api/v1/subscribers/{uid}Update a contact
POST/api/v1/subscribers/{uid}/add-tagAdd tags to a contact
PATCH/api/v1/lists/{list_uid}/subscribers/{uid}/subscribeSubscribe a contact again
PATCH/api/v1/lists/{list_uid}/subscribers/{uid}/unsubscribeUnsubscribe a contact
DELETE/api/v1/subscribers/{uid}Delete a contact
GET/api/v1/campaignsYour campaigns
POST/api/v1/campaigns/{uid}/runSend a campaign
POST/api/v1/campaigns/{uid}/pausePause a sending campaign
POST/api/v1/campaigns/{uid}/resumeResume a paused campaign

Add a contact to a list

Send the list’s list_uid, the contact’s fields by their tag (EMAIL, FIRST_NAME, LAST_NAME or any custom field tag), and optional comma-separated tags:

curl -X POST https://robustemail.com/api/v1/subscribers \
  -H "Authorization: Bearer $ROBUSTEMAIL_API_TOKEN" \
  -H "Accept: application/json" \
  -d list_uid=5f8a1c2b3d4e5 \
  -d EMAIL=jane@example.com \
  -d FIRST_NAME=Jane \
  -d tag=newsletter,website
{
  "status": 1,
  "message": "Subscriber was successfully created",
  "subscriber_uid": "6adc790429faf"
}

If the list uses double opt-in, the contact receives a confirmation email first. Welcome automations on the list start for new contacts.

Start an automation from your code

Automations with the API trigger show their own call URL in the automation’s trigger settings. Calling it for a contact starts the automation for them, which is useful for product events your app knows about, such as “finished onboarding”.