Events
Trigger Events (Bulk)
Trigger multiple events for a subscriber in one request
POST
/
api
/
v1
/
subscribers
/
events
/
bulk
Trigger Events (Bulk)
curl --request POST \
--url https://api.sequenzy.com/api/v1/subscribers/events/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"externalId": "<string>",
"events": [
{}
],
"events[].name": "<string>",
"events[].properties": {},
"customAttributes": {}
}
'import requests
url = "https://api.sequenzy.com/api/v1/subscribers/events/bulk"
payload = {
"email": "<string>",
"externalId": "<string>",
"events": [{}],
"events[].name": "<string>",
"events[].properties": {},
"customAttributes": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: '<string>',
externalId: '<string>',
events: [{}],
'events[].name': '<string>',
'events[].properties': {},
customAttributes: {}
})
};
fetch('https://api.sequenzy.com/api/v1/subscribers/events/bulk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sequenzy.com/api/v1/subscribers/events/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => '<string>',
'externalId' => '<string>',
'events' => [
[
]
],
'events[].name' => '<string>',
'events[].properties' => [
],
'customAttributes' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sequenzy.com/api/v1/subscribers/events/bulk"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"externalId\": \"<string>\",\n \"events\": [\n {}\n ],\n \"events[].name\": \"<string>\",\n \"events[].properties\": {},\n \"customAttributes\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sequenzy.com/api/v1/subscribers/events/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"externalId\": \"<string>\",\n \"events\": [\n {}\n ],\n \"events[].name\": \"<string>\",\n \"events[].properties\": {},\n \"customAttributes\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/subscribers/events/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\",\n \"externalId\": \"<string>\",\n \"events\": [\n {}\n ],\n \"events[].name\": \"<string>\",\n \"events[].properties\": {},\n \"customAttributes\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"subscriber": {
"id": "sub_abc123",
"email": "user@example.com",
"externalId": "user_123",
"created": false
},
"events": [
{
"id": "evt_1",
"name": "page_viewed",
"definitionCreated": false
},
{
"id": "evt_2",
"name": "feature_used",
"definitionCreated": true
}
]
}
{
"success": true,
"subscriber": {
"id": "sub_abc123",
"email": "user@example.com",
"externalId": null,
"created": true
},
"events": [
{
"id": "evt_1",
"name": "page_viewed",
"definitionCreated": false
},
{
"id": "evt_2",
"name": "feature_used",
"definitionCreated": true
}
],
"optIn": {
"required": true,
"emailQueued": true
}
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Internal server error"
}
Trigger multiple events for a subscriber in one request. Creates the subscriber and/or event definitions if they don’t exist.
New subscribers created by this endpoint follow your workspace default lists
setting.
Events are processed independently. If one event fails, previously triggered
events are not rolled back, so retry an error response as a partial success.
Request Body
string
Subscriber delivery email address. Required when creating a new subscriber.
string
Your app/customer/user ID for this subscriber. You can trigger events with
only
externalId when the subscriber already exists.array
required
Array of events to trigger
string
required
Event name
object
Event properties/metadata
object
Custom attributes to set on the subscriber.
curl -X POST "https://api.sequenzy.com/api/v1/subscribers/events/bulk" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"externalId": "user_123",
"events": [
{
"name": "page_viewed",
"properties": { "page": "/pricing", "duration": 45 }
},
{
"name": "feature_used",
"properties": { "feature": "export", "format": "csv" }
}
]
}'
Auto-Creation Behavior
This endpoint automatically creates resources if they don’t exist:| Resource | Behavior |
|---|---|
| Subscriber | Created if email doesn’t exist - active status, or pending confirmation when double opt-in is enabled |
| Event Definitions | Each event type created if new |
Double Opt-In
When the workspace has double opt-in enabled and this request creates a brand-new subscriber, the subscriber is stored pending confirmation and a single confirmation email is queued for the whole request. All events are still recorded, and sequences triggered by them wait at their trigger step until the subscriber confirms. The response then includes anoptIn object.
Responses
{
"success": true,
"subscriber": {
"id": "sub_abc123",
"email": "user@example.com",
"externalId": "user_123",
"created": false
},
"events": [
{
"id": "evt_1",
"name": "page_viewed",
"definitionCreated": false
},
{
"id": "evt_2",
"name": "feature_used",
"definitionCreated": true
}
]
}
{
"success": true,
"subscriber": {
"id": "sub_abc123",
"email": "user@example.com",
"externalId": null,
"created": true
},
"events": [
{
"id": "evt_1",
"name": "page_viewed",
"definitionCreated": false
},
{
"id": "evt_2",
"name": "feature_used",
"definitionCreated": true
}
],
"optIn": {
"required": true,
"emailQueued": true
}
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Internal server error"
}
Response Fields
| Field | Description |
|---|---|
subscriber.created | true if subscriber was created by this request |
events[].definitionCreated | true if this event type was newly defined |
events[].sideEffectFailures | Present when that event was recorded but a follow-up stage failed (e.g. apply-sync-rules) |
optIn | Present when the new subscriber requires double opt-in confirmation before becoming active |
Use Cases
Track User Session
curl -X POST "https://api.sequenzy.com/api/v1/subscribers/events/bulk" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"events": [
{ "name": "session_started" },
{ "name": "page_viewed", "properties": { "page": "/dashboard" } },
{ "name": "feature_used", "properties": { "feature": "reports" } },
{ "name": "page_viewed", "properties": { "page": "/settings" } }
]
}'
Record Funnel Progress
curl -X POST "https://api.sequenzy.com/api/v1/subscribers/events/bulk" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"events": [
{ "name": "checkout_started", "properties": { "cartValue": 149.99 } },
{ "name": "payment_method_added", "properties": { "type": "card" } },
{ "name": "checkout_completed", "properties": { "orderId": "ord_123" } }
]
}'
Batch Import Historical Events
curl -X POST "https://api.sequenzy.com/api/v1/subscribers/events/bulk" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"events": [
{ "name": "saas.purchase", "properties": { "plan": "starter" } },
{ "name": "saas.upgrade", "properties": { "from": "starter", "to": "pro" } }
],
"customAttributes": {
"currentPlan": "pro",
"lifetimeValue": 599.00
}
}'
Each event in the bulk request is processed independently. Sync rules and
automation triggers are evaluated for each event, and successful events are
not rolled back if another event in the same request fails.
⌘I
Trigger Events (Bulk)
curl --request POST \
--url https://api.sequenzy.com/api/v1/subscribers/events/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"externalId": "<string>",
"events": [
{}
],
"events[].name": "<string>",
"events[].properties": {},
"customAttributes": {}
}
'import requests
url = "https://api.sequenzy.com/api/v1/subscribers/events/bulk"
payload = {
"email": "<string>",
"externalId": "<string>",
"events": [{}],
"events[].name": "<string>",
"events[].properties": {},
"customAttributes": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: '<string>',
externalId: '<string>',
events: [{}],
'events[].name': '<string>',
'events[].properties': {},
customAttributes: {}
})
};
fetch('https://api.sequenzy.com/api/v1/subscribers/events/bulk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sequenzy.com/api/v1/subscribers/events/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => '<string>',
'externalId' => '<string>',
'events' => [
[
]
],
'events[].name' => '<string>',
'events[].properties' => [
],
'customAttributes' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sequenzy.com/api/v1/subscribers/events/bulk"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"externalId\": \"<string>\",\n \"events\": [\n {}\n ],\n \"events[].name\": \"<string>\",\n \"events[].properties\": {},\n \"customAttributes\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sequenzy.com/api/v1/subscribers/events/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"externalId\": \"<string>\",\n \"events\": [\n {}\n ],\n \"events[].name\": \"<string>\",\n \"events[].properties\": {},\n \"customAttributes\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/subscribers/events/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\",\n \"externalId\": \"<string>\",\n \"events\": [\n {}\n ],\n \"events[].name\": \"<string>\",\n \"events[].properties\": {},\n \"customAttributes\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"subscriber": {
"id": "sub_abc123",
"email": "user@example.com",
"externalId": "user_123",
"created": false
},
"events": [
{
"id": "evt_1",
"name": "page_viewed",
"definitionCreated": false
},
{
"id": "evt_2",
"name": "feature_used",
"definitionCreated": true
}
]
}
{
"success": true,
"subscriber": {
"id": "sub_abc123",
"email": "user@example.com",
"externalId": null,
"created": true
},
"events": [
{
"id": "evt_1",
"name": "page_viewed",
"definitionCreated": false
},
{
"id": "evt_2",
"name": "feature_used",
"definitionCreated": true
}
],
"optIn": {
"required": true,
"emailQueued": true
}
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Internal server error"
}