Skip to main content

API Reference

The Sequenzy API lets you programmatically manage subscribers, send emails, trigger events, and integrate email marketing into your application.

Base URL

All API requests are made to:
https://api.sequenzy.com/api/v1

Authentication

All endpoints require an API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Get your API key from Settings → API Keys in the dashboard.

Authentication Guide

Learn more about API authentication

Response Format

All responses return JSON with a consistent structure.

Success Response

{
  "success": true,
  "data": { ... }
}

Error Response

{
  "success": false,
  "error": "Human readable error message"
}

HTTP Status Codes

StatusDescription
200Success
400Bad request (validation error, missing fields, disabled resource)
401Unauthorized (invalid or missing API key)
404Resource not found
409Conflict (resource already exists)
500Internal server error

Available Endpoints

Subscribers

Manage your subscriber list.
MethodEndpointDescription
POST/subscribersCreate subscriber
GET/subscribersList subscribers
GET/subscribers/:emailGet subscriber
PATCH/subscribers/:emailUpdate subscriber
DELETE/subscribers/:emailDelete subscriber

Tags

Segment subscribers with tags.
MethodEndpointDescription
POST/subscribers/tagsAdd tag to subscriber
POST/subscribers/tags/bulkAdd multiple tags

Events

Track subscriber actions and trigger automations.
MethodEndpointDescription
POST/subscribers/eventsTrigger event
POST/subscribers/events/bulkTrigger multiple events

Transactional Emails

Send programmatic emails.
MethodEndpointDescription
POST/transactional/sendSend email
GET/transactionalList templates
GET/transactional/:slugGet template details

Auto-Creation Behavior

The API automatically creates resources when they don’t exist:
ResourceWhen Created
SubscribersWhen adding tags, triggering events, or sending transactional emails to a new email
TagsWhen adding a tag that doesn’t exist
EventsWhen triggering an event type that doesn’t exist
This makes integration seamless—you don’t need to pre-configure anything in the dashboard.

Example

# This single request will:
# 1. Create the subscriber (if new)
# 2. Create the "customer" tag (if new)
# 3. Add the tag to the subscriber

curl -X POST "https://api.sequenzy.com/api/v1/subscribers/tags" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "tag": "customer"
  }'

Rate Limiting

The API is rate limited to protect service stability:
  • Standard limit: 100 requests per minute per API key
  • Burst limit: 20 requests per second
When rate limited, you’ll receive a 429 Too Many Requests response with a Retry-After header.

Pagination

List endpoints support pagination:
ParameterTypeDefaultDescription
pageinteger1Page number
limitinteger20Items per page (max 100)

Example

curl "https://api.sequenzy.com/api/v1/subscribers?page=2&limit=50" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "success": true,
  "data": [...],
  "pagination": {
    "page": 2,
    "limit": 50,
    "total": 1250,
    "totalPages": 25
  }
}

Error Handling

Common Error Codes

ErrorDescriptionSolution
UnauthorizedInvalid or missing API keyCheck your API key
Subscriber not foundEmail doesn’t existCreate the subscriber first
Template not foundInvalid template slugCheck the slug spelling
Template disabledTemplate is deactivatedEnable in dashboard
Validation errorMissing or invalid fieldsCheck request body

Example Error Response

{
  "success": false,
  "error": "Subscriber not found"
}

SDK & Libraries

JavaScript / TypeScript

// Using fetch
async function addTag(email, tag) {
  const response = await fetch(
    "https://api.sequenzy.com/api/v1/subscribers/tags",
    {
      method: "POST",
      headers: {
        Authorization: `Bearer ${process.env.SEQUENZY_API_KEY}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({ email, tag }),
    }
  );
  return response.json();
}

Python

import requests

def add_tag(email, tag):
    response = requests.post(
        "https://api.sequenzy.com/api/v1/subscribers/tags",
        headers={
            "Authorization": f"Bearer {SEQUENZY_API_KEY}",
            "Content-Type": "application/json"
        },
        json={"email": email, "tag": tag}
    )
    return response.json()

cURL

curl -X POST "https://api.sequenzy.com/api/v1/subscribers/tags" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email": "[email protected]", "tag": "customer"}'

Need Help?