Data Exports
Create Data Export
Stream events and subscriber snapshots to your bucket
POST
/
api
/
v1
/
data-exports
Create Data Export
curl --request POST \
--url https://api.sequenzy.com/api/v1/data-exports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"provider": "<string>",
"bucket": "<string>",
"region": {},
"endpoint": {},
"pathPrefix": {},
"accessKeyId": "<string>",
"secretAccessKey": "<string>",
"datasets": [
"<string>"
],
"frequency": "<string>",
"startFrom": {}
}
'import requests
url = "https://api.sequenzy.com/api/v1/data-exports"
payload = {
"name": "<string>",
"provider": "<string>",
"bucket": "<string>",
"region": {},
"endpoint": {},
"pathPrefix": {},
"accessKeyId": "<string>",
"secretAccessKey": "<string>",
"datasets": ["<string>"],
"frequency": "<string>",
"startFrom": {}
}
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({
name: '<string>',
provider: '<string>',
bucket: '<string>',
region: {},
endpoint: {},
pathPrefix: {},
accessKeyId: '<string>',
secretAccessKey: '<string>',
datasets: ['<string>'],
frequency: '<string>',
startFrom: {}
})
};
fetch('https://api.sequenzy.com/api/v1/data-exports', 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/data-exports",
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([
'name' => '<string>',
'provider' => '<string>',
'bucket' => '<string>',
'region' => [
],
'endpoint' => [
],
'pathPrefix' => [
],
'accessKeyId' => '<string>',
'secretAccessKey' => '<string>',
'datasets' => [
'<string>'
],
'frequency' => '<string>',
'startFrom' => [
]
]),
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/data-exports"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"provider\": \"<string>\",\n \"bucket\": \"<string>\",\n \"region\": {},\n \"endpoint\": {},\n \"pathPrefix\": {},\n \"accessKeyId\": \"<string>\",\n \"secretAccessKey\": \"<string>\",\n \"datasets\": [\n \"<string>\"\n ],\n \"frequency\": \"<string>\",\n \"startFrom\": {}\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/data-exports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"provider\": \"<string>\",\n \"bucket\": \"<string>\",\n \"region\": {},\n \"endpoint\": {},\n \"pathPrefix\": {},\n \"accessKeyId\": \"<string>\",\n \"secretAccessKey\": \"<string>\",\n \"datasets\": [\n \"<string>\"\n ],\n \"frequency\": \"<string>\",\n \"startFrom\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/data-exports")
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 \"name\": \"<string>\",\n \"provider\": \"<string>\",\n \"bucket\": \"<string>\",\n \"region\": {},\n \"endpoint\": {},\n \"pathPrefix\": {},\n \"accessKeyId\": \"<string>\",\n \"secretAccessKey\": \"<string>\",\n \"datasets\": [\n \"<string>\"\n ],\n \"frequency\": \"<string>\",\n \"startFrom\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"dataExport": {
"id": "exp_abc123",
"name": "Analytics lake",
"provider": "s3",
"bucket": "acme-exports",
"region": "us-east-1",
"endpoint": null,
"pathPrefix": "sequenzy",
"accessKeyId": "AKIA…WXYZ",
"datasets": ["email_events", "custom_events", "subscribers"],
"frequency": "every_15_minutes",
"isEnabled": true,
"status": "queued",
"startFrom": "2026-09-30T12:00:00.000Z",
"exportedThrough": {
"email_events": null,
"custom_events": null,
"subscribers": null
},
"nextRunAt": "2026-09-30T12:00:00.000Z",
"lastRunAt": null,
"lastSuccessAt": null,
"lastError": null,
"lastErrorAt": null,
"consecutiveFailures": 0,
"totalRowsExported": 0,
"createdAt": "2026-09-30T12:00:00.000Z",
"updatedAt": "2026-09-30T12:00:00.000Z"
}
}
{
"success": false,
"code": "connection_failed",
"error": "Access denied writing to \"acme-exports\". Grant the key permission to put objects under the configured path."
}
{
"success": false,
"code": "invalid_input",
"error": "Region is required for Amazon S3 (for example us-east-1)."
}
{
"success": false,
"error": "API key is missing required scopes: subscribers:read, analytics:read"
}
Adds a bucket as a data export destination. Before saving, Sequenzy writes a small test file to
<pathPrefix>/_sequenzy/connection-test.json. If that write fails, nothing is saved and the response explains why. The first export starts immediately.
Requires data_exports:write, subscribers:read and analytics:read, because the destination receives subscriber and engagement data.
See Data exports for the file layout, row schemas and warehouse loading recipes.
Request
string
required
Display name, up to 255 characters.
string
required
s3 for Amazon S3 or any S3-compatible service, gcs for Google Cloud
Storage.string
required
Bucket name, not a URL.
string | null
Bucket region, for example
us-east-1. Required for Amazon S3 without a
custom endpoint. Defaults to auto for GCS and custom endpoints.string | null
HTTPS origin of an S3-compatible service such as Cloudflare R2, MinIO or
Backblaze B2. It must resolve to a public address. Not allowed with
gcs.string | null
default:""
Folder inside the bucket. Leading and trailing slashes are removed. Letters,
numbers,
/ and ! _ . * ' ( ) = - are allowed; .. segments are rejected.string
required
Access key ID. For GCS, the HMAC access ID.
string
required
Secret access key (GCS: HMAC secret). Stored encrypted and never returned.
string[]
Any of
email_events, sms_events, custom_events, subscribers. Unknown
values return 422.string
default:"every_15_minutes"
every_5_minutes, every_15_minutes, hourly or daily.string | null
ISO timestamp, at most 30 days ago, to include events recorded since then.
Defaults to now. The subscriber snapshot always reflects current data.
curl -X POST "https://api.sequenzy.com/api/v1/data-exports" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Analytics lake",
"provider": "s3",
"bucket": "acme-exports",
"region": "us-east-1",
"pathPrefix": "sequenzy",
"accessKeyId": "AKIA...",
"secretAccessKey": "...",
"datasets": ["email_events", "custom_events", "subscribers"],
"frequency": "every_15_minutes"
}'
{
"success": true,
"dataExport": {
"id": "exp_abc123",
"name": "Analytics lake",
"provider": "s3",
"bucket": "acme-exports",
"region": "us-east-1",
"endpoint": null,
"pathPrefix": "sequenzy",
"accessKeyId": "AKIA…WXYZ",
"datasets": ["email_events", "custom_events", "subscribers"],
"frequency": "every_15_minutes",
"isEnabled": true,
"status": "queued",
"startFrom": "2026-09-30T12:00:00.000Z",
"exportedThrough": {
"email_events": null,
"custom_events": null,
"subscribers": null
},
"nextRunAt": "2026-09-30T12:00:00.000Z",
"lastRunAt": null,
"lastSuccessAt": null,
"lastError": null,
"lastErrorAt": null,
"consecutiveFailures": 0,
"totalRowsExported": 0,
"createdAt": "2026-09-30T12:00:00.000Z",
"updatedAt": "2026-09-30T12:00:00.000Z"
}
}
{
"success": false,
"code": "connection_failed",
"error": "Access denied writing to \"acme-exports\". Grant the key permission to put objects under the configured path."
}
{
"success": false,
"code": "invalid_input",
"error": "Region is required for Amazon S3 (for example us-east-1)."
}
{
"success": false,
"error": "API key is missing required scopes: subscribers:read, analytics:read"
}
⌘I
Create Data Export
curl --request POST \
--url https://api.sequenzy.com/api/v1/data-exports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"provider": "<string>",
"bucket": "<string>",
"region": {},
"endpoint": {},
"pathPrefix": {},
"accessKeyId": "<string>",
"secretAccessKey": "<string>",
"datasets": [
"<string>"
],
"frequency": "<string>",
"startFrom": {}
}
'import requests
url = "https://api.sequenzy.com/api/v1/data-exports"
payload = {
"name": "<string>",
"provider": "<string>",
"bucket": "<string>",
"region": {},
"endpoint": {},
"pathPrefix": {},
"accessKeyId": "<string>",
"secretAccessKey": "<string>",
"datasets": ["<string>"],
"frequency": "<string>",
"startFrom": {}
}
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({
name: '<string>',
provider: '<string>',
bucket: '<string>',
region: {},
endpoint: {},
pathPrefix: {},
accessKeyId: '<string>',
secretAccessKey: '<string>',
datasets: ['<string>'],
frequency: '<string>',
startFrom: {}
})
};
fetch('https://api.sequenzy.com/api/v1/data-exports', 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/data-exports",
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([
'name' => '<string>',
'provider' => '<string>',
'bucket' => '<string>',
'region' => [
],
'endpoint' => [
],
'pathPrefix' => [
],
'accessKeyId' => '<string>',
'secretAccessKey' => '<string>',
'datasets' => [
'<string>'
],
'frequency' => '<string>',
'startFrom' => [
]
]),
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/data-exports"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"provider\": \"<string>\",\n \"bucket\": \"<string>\",\n \"region\": {},\n \"endpoint\": {},\n \"pathPrefix\": {},\n \"accessKeyId\": \"<string>\",\n \"secretAccessKey\": \"<string>\",\n \"datasets\": [\n \"<string>\"\n ],\n \"frequency\": \"<string>\",\n \"startFrom\": {}\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/data-exports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"provider\": \"<string>\",\n \"bucket\": \"<string>\",\n \"region\": {},\n \"endpoint\": {},\n \"pathPrefix\": {},\n \"accessKeyId\": \"<string>\",\n \"secretAccessKey\": \"<string>\",\n \"datasets\": [\n \"<string>\"\n ],\n \"frequency\": \"<string>\",\n \"startFrom\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/data-exports")
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 \"name\": \"<string>\",\n \"provider\": \"<string>\",\n \"bucket\": \"<string>\",\n \"region\": {},\n \"endpoint\": {},\n \"pathPrefix\": {},\n \"accessKeyId\": \"<string>\",\n \"secretAccessKey\": \"<string>\",\n \"datasets\": [\n \"<string>\"\n ],\n \"frequency\": \"<string>\",\n \"startFrom\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"dataExport": {
"id": "exp_abc123",
"name": "Analytics lake",
"provider": "s3",
"bucket": "acme-exports",
"region": "us-east-1",
"endpoint": null,
"pathPrefix": "sequenzy",
"accessKeyId": "AKIA…WXYZ",
"datasets": ["email_events", "custom_events", "subscribers"],
"frequency": "every_15_minutes",
"isEnabled": true,
"status": "queued",
"startFrom": "2026-09-30T12:00:00.000Z",
"exportedThrough": {
"email_events": null,
"custom_events": null,
"subscribers": null
},
"nextRunAt": "2026-09-30T12:00:00.000Z",
"lastRunAt": null,
"lastSuccessAt": null,
"lastError": null,
"lastErrorAt": null,
"consecutiveFailures": 0,
"totalRowsExported": 0,
"createdAt": "2026-09-30T12:00:00.000Z",
"updatedAt": "2026-09-30T12:00:00.000Z"
}
}
{
"success": false,
"code": "connection_failed",
"error": "Access denied writing to \"acme-exports\". Grant the key permission to put objects under the configured path."
}
{
"success": false,
"code": "invalid_input",
"error": "Region is required for Amazon S3 (for example us-east-1)."
}
{
"success": false,
"error": "API key is missing required scopes: subscribers:read, analytics:read"
}