Subscribe to a Flow

Subscribe a recipient to an email flow. If the recipient does not already exist, they will be created automatically.

POST https://api.notifiedby.com/v1/flows/subscribe/

Request Body:

{
    "flow_trigger": "WELCOME_SIGNUP",
    "email": "user@example.com",
    "first_name": "John",
    "last_name": "Doe",
    "flags": ["new_user", "free_plan"]
}

Field

Required

Description

flow_trigger

Yes

The trigger keyword of the flow to subscribe to.

email

Yes

The recipient’s email address.

first_name

No

The recipient’s first name, used for personalisation in templates.

last_name

No

The recipient’s last name, used for personalisation in templates.

flags

No

A list of flags to set on the recipient.

Success Response (201):

{
    "detail": "Recipient 'user@example.com' successfully subscribed to flow 'Welcome Signup Flow'.",
    "subscription_id": 42
}

Error Response (400):

Returned when the flow is not found, the recipient is already subscribed, or the flow has no steps.

{
    "detail": "Flow with trigger 'WELCOME_SIGNUP' not found."
}

Example with curl:

curl -X POST https://api.notifiedby.com/v1/flows/subscribe/ \
    -H "Authorization: Api-Key YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"flow_trigger": "WELCOME_SIGNUP", "email": "user@example.com", "first_name": "John"}'