API Reference¶
Comprehensive documentation of all Subscribe Flow API endpoints.
Interactive Documentation¶
| Format | URL | Description |
|---|---|---|
| Swagger UI | /docs | Interactive API exploration with try-it-out |
| ReDoc | /redoc | Clear reference documentation |
| OpenAPI | /openapi.json | OpenAPI 3.1 Specification |
Base URL¶
| Environment | URL |
|---|---|
| Production | https://api.subscribeflow.net |
| Local | http://localhost:8000 |
Authentication¶
Subscribe Flow supports dual authentication: API key OR session cookie. Every /api/v1/* endpoint accepts either method.
API Key (Programmatic Access)¶
All admin endpoints (/api/v1/*) accept API key authentication:
| Bash | |
|---|---|
API keys are organization-scoped. Each key belongs to exactly one organization.
Scopes:
| Scope | Description |
|---|---|
subscribers:read | Read subscribers |
subscribers:write | Create/update subscribers |
subscribers:delete | Delete subscribers |
tags:read | Read tags |
tags:write | Create/update/delete tags |
webhooks:manage | Manage webhook endpoints |
Session Cookie (Dashboard Access)¶
Dashboard users authenticate via magic link, which sets an HTTP-only sf_session cookie. Organization context is provided via the X-Organization-Id header:
| Bash | |
|---|---|
Token (Preference Center)¶
Preference Center endpoints use JWT tokens as query parameters:
| Bash | |
|---|---|
Auth API¶
Endpoints for magic link login, session management, and organization management. These endpoints do not require API key auth.
Request Magic Link¶
| HTTP | |
|---|---|
Request Body:
Response (200 OK):
Anti-Enumeration
Always returns 200 regardless of whether the email exists.
Verify Magic Link¶
Verifies the token and sets an HTTP-only session cookie (sf_session, 7 days).
| HTTP | |
|---|---|
Response (200 OK):
| JSON | |
|---|---|
Errors:
| Status | Error | Description |
|---|---|---|
| 401 | magic_link_expired | Token has expired |
| 401 | magic_link_already_used | Token was already used |
| 401 | invalid_token | Token not found or invalid |
Create Organization¶
Requires session auth (cookie). The calling user becomes the owner.
| HTTP | |
|---|---|
Request Body:
Response (200 OK):
| JSON | |
|---|---|
List Organizations¶
Requires session auth. Returns all organizations the current user belongs to.
| HTTP | |
|---|---|
Response (200 OK):
| JSON | |
|---|---|
Logout¶
Clears the session cookie.
| HTTP | |
|---|---|
Response (200 OK):
Subscribers API¶
Create Subscriber¶
Creates a new subscriber with optional tag subscriptions.
| HTTP | |
|---|---|
Auth: API Key or Session
Request Body:
| JSON | |
|---|---|
Response (201 Created):
Errors:
| Status | Error | Description |
|---|---|---|
| 400 | validation_error | Invalid email address |
| 402 | limit_exceeded | Subscriber limit reached for current plan |
| 409 | conflict | Email already exists |
List Subscribers¶
Lists subscribers with pagination and filtering.
| HTTP | |
|---|---|
Auth: API Key or Session
Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
cursor | string | - | Cursor for the next page |
limit | integer | 50 | Max. results (1-100) |
status | string | - | Filter: active, unsubscribed, bounced, complained |
tag | string | - | Filter by tag ID |
sort | string | created_at | Sort by: created_at, updated_at, email |
order | string | desc | Direction: asc, desc |
Response (200 OK):
| JSON | |
|---|---|
Response Headers:
| Header | Description |
|---|---|
X-Total-Count | Total number of subscribers |
Link | Pagination links (RFC 5988) |
Get Subscriber¶
| HTTP | |
|---|---|
Auth: API Key or Session
Get Subscriber by Email¶
| HTTP | |
|---|---|
Auth: API Key or Session
Update Subscriber¶
| HTTP | |
|---|---|
Auth: API Key or Session
Request Body:
Response (200 OK): Updated subscriber
Delete Subscriber¶
Permanently deletes a subscriber.
| HTTP | |
|---|---|
Auth: API Key or Session
Response: 204 No Content
Manage Subscriber Tags¶
Add Tags¶
| HTTP | |
|---|---|
Auth: API Key or Session
Request Body:
Remove Tag¶
| HTTP | |
|---|---|
Auth: API Key or Session
Get Subscriber Tags¶
| HTTP | |
|---|---|
Auth: API Key or Session
Tags API¶
Create Tag¶
| HTTP | |
|---|---|
Auth: API Key or Session
Request Body:
| JSON | |
|---|---|
Response (201 Created):
| JSON | |
|---|---|
List Tags¶
| HTTP | |
|---|---|
Auth: API Key or Session
Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
cursor | string | - | Cursor for the next page |
limit | integer | 50 | Max. results (1-100) |
sort | string | name | Sort by: name, created_at, subscriber_count |
order | string | asc | Direction: asc, desc |
Get Tag¶
| HTTP | |
|---|---|
Auth: API Key or Session
Get Tag by Name¶
| HTTP | |
|---|---|
Auth: API Key or Session
Update Tag¶
| HTTP | |
|---|---|
Auth: API Key or Session
Request Body:
Delete Tag¶
| HTTP | |
|---|---|
Auth: API Key or Session
Response: 204 No Content
Impact on Subscribers
Deleting a tag automatically removes all subscriber associations.
Templates API¶
Create Template¶
| HTTP | |
|---|---|
Auth: API Key or Session
List Templates¶
| HTTP | |
|---|---|
Auth: API Key or Session
Get Template¶
| HTTP | |
|---|---|
Auth: API Key or Session
Update Template¶
| HTTP | |
|---|---|
Auth: API Key or Session
Delete Template¶
| HTTP | |
|---|---|
Auth: API Key or Session
Preview Template¶
| HTTP | |
|---|---|
Auth: API Key or Session
Emails API¶
Send Email¶
| HTTP | |
|---|---|
Auth: API Key or Session
Errors:
| Status | Error | Description |
|---|---|---|
| 402 | limit_exceeded | Monthly email limit reached for current plan |
Campaigns API¶
Create Campaign¶
| HTTP | |
|---|---|
Auth: API Key or Session
List Campaigns¶
| HTTP | |
|---|---|
Auth: API Key or Session
Get Campaign¶
| HTTP | |
|---|---|
Auth: API Key or Session
Update Campaign¶
| HTTP | |
|---|---|
Auth: API Key or Session
Send Campaign¶
| HTTP | |
|---|---|
Auth: API Key or Session
Cancel Campaign¶
| HTTP | |
|---|---|
Auth: API Key or Session
Retry Campaign¶
| HTTP | |
|---|---|
Auth: API Key or Session
Duplicate Campaign¶
| HTTP | |
|---|---|
Auth: API Key or Session
Count Campaign Recipients¶
| HTTP | |
|---|---|
Auth: API Key or Session
Email Triggers API¶
Create Trigger¶
| HTTP | |
|---|---|
Auth: API Key or Session
List Triggers¶
| HTTP | |
|---|---|
Auth: API Key or Session
Get Trigger¶
| HTTP | |
|---|---|
Auth: API Key or Session
Update Trigger¶
| HTTP | |
|---|---|
Auth: API Key or Session
Delete Trigger¶
| HTTP | |
|---|---|
Auth: API Key or Session
Outgoing Webhooks API¶
Create Webhook Endpoint¶
| HTTP | |
|---|---|
Auth: API Key or Session
Request Body:
| JSON | |
|---|---|
Response (201 Created):
Signing Secret
The signing_secret is only returned upon creation. Store it securely for signature verification.
Available Events:
| Event | Description |
|---|---|
subscriber.created | New subscriber created |
subscriber.updated | Subscriber updated |
subscriber.deleted | Subscriber deleted |
tag.subscribed | Tag subscribed |
tag.unsubscribed | Tag unsubscribed |
subscriber.note_added | Note added to subscriber |
List Webhooks¶
| HTTP | |
|---|---|
Auth: API Key or Session
Get Webhook¶
| HTTP | |
|---|---|
Auth: API Key or Session
Update Webhook¶
| HTTP | |
|---|---|
Auth: API Key or Session
Delete Webhook¶
| HTTP | |
|---|---|
Auth: API Key or Session
Test Webhook¶
Sends a test event to the webhook endpoint.
| HTTP | |
|---|---|
Auth: API Key or Session
Response (200 OK):
Regenerate Webhook Secret¶
| HTTP | |
|---|---|
Auth: API Key or Session
List Webhook Deliveries¶
| HTTP | |
|---|---|
Auth: API Key or Session
Retry Webhook Delivery¶
| HTTP | |
|---|---|
Auth: API Key or Session
Get Webhook Stats¶
| HTTP | |
|---|---|
Auth: API Key or Session
Get Global Webhook Stats¶
| HTTP | |
|---|---|
Auth: API Key or Session
List Webhook Event Types¶
| HTTP | |
|---|---|
Auth: API Key or Session
Subscriber Notes API¶
Create Note¶
| HTTP | |
|---|---|
Auth: API Key or Session
List Notes¶
| HTTP | |
|---|---|
Auth: API Key or Session
Get Note¶
| HTTP | |
|---|---|
Auth: API Key or Session
Update Note¶
| HTTP | |
|---|---|
Auth: API Key or Session
Delete Note¶
| HTTP | |
|---|---|
Auth: API Key or Session
API Keys API¶
List Available Scopes¶
| HTTP | |
|---|---|
Auth: API Key or Session
Create API Key¶
| HTTP | |
|---|---|
Auth: API Key or Session
Request Body:
| JSON | |
|---|---|
Response (201 Created):
| JSON | |
|---|---|
API Key Storage
The full API key is only displayed once upon creation. Store it securely -- it cannot be recovered.
List API Keys¶
| HTTP | |
|---|---|
Auth: API Key or Session
Get API Key¶
| HTTP | |
|---|---|
Auth: API Key or Session
Update API Key¶
| HTTP | |
|---|---|
Auth: API Key or Session
Rotate API Key¶
| HTTP | |
|---|---|
Auth: API Key or Session
Delete API Key¶
| HTTP | |
|---|---|
Auth: API Key or Session
Preference Center API¶
Public endpoints for subscriber self-service. These endpoints use token-based authentication (JWT in query parameter).
Get Preferences¶
| HTTP | |
|---|---|
Response:
Subscribe to Tag¶
| HTTP | |
|---|---|
Unsubscribe from Tag¶
| HTTP | |
|---|---|
Request Data Export (GDPR)¶
| HTTP | |
|---|---|
Request Account Deletion (GDPR)¶
| HTTP | |
|---|---|
Billing API¶
Endpoints for subscription management and Stripe integration.
Get Current Subscription¶
| HTTP | |
|---|---|
Auth: API Key or Session (Owner only)
Response (200 OK):
| JSON | |
|---|---|
Create Checkout Session¶
Creates a Stripe Checkout session for upgrading the subscription.
| HTTP | |
|---|---|
Auth: API Key or Session (Owner only)
Request Body:
Response (200 OK):
Customer Portal¶
Opens the Stripe Customer Portal for managing payment methods and invoices.
| HTTP | |
|---|---|
Auth: API Key or Session (Owner only)
Response (200 OK):
Sync Subscription¶
Manually syncs the subscription status from Stripe.
| HTTP | |
|---|---|
Auth: API Key or Session (Owner only)
Email Settings API¶
Endpoints for managing organization email sending configuration.
Get Email Settings¶
| HTTP | |
|---|---|
Auth: API Key or Session
Response (200 OK):
| JSON | |
|---|---|
Update Email Settings¶
Update from_name (all tiers) or from_address (requires verified custom domain).
| HTTP | |
|---|---|
Auth: API Key or Session
Request Body:
Add Custom Domain¶
Start domain verification via Resend API. Professional tier only.
| HTTP | |
|---|---|
Auth: API Key or Session
Request Body:
Response (201 Created):
| JSON | |
|---|---|
Check Domain Verification¶
| HTTP | |
|---|---|
Auth: API Key or Session
Remove Custom Domain¶
| HTTP | |
|---|---|
Auth: API Key or Session
Response: 204 No Content
Platform Admin API¶
Endpoints for platform-level administration. Only accessible by organizations with is_platform_admin = true (currently only Talent Factory GmbH).
All endpoints require the RequirePlatformAdmin dependency, which verifies the requesting organization has platform admin privileges.
List Organizations¶
| HTTP | |
|---|---|
Auth: API Key or Session (Platform Admin only)
Get Organization¶
| HTTP | |
|---|---|
Auth: API Key or Session (Platform Admin only)
Update Organization¶
| HTTP | |
|---|---|
Auth: API Key or Session (Platform Admin only)
Delete Organization¶
| HTTP | |
|---|---|
Auth: API Key or Session (Platform Admin only)
List Users¶
| HTTP | |
|---|---|
Auth: API Key or Session (Platform Admin only)
Get User¶
| HTTP | |
|---|---|
Auth: API Key or Session (Platform Admin only)
List Members of Organization¶
| HTTP | |
|---|---|
Auth: API Key or Session (Platform Admin only)
Add Member to Organization¶
| HTTP | |
|---|---|
Auth: API Key or Session (Platform Admin only)
Remove Member from Organization¶
| HTTP | |
|---|---|
Auth: API Key or Session (Platform Admin only)
Incoming Webhooks¶
Resend Webhook¶
Receives webhook events from Resend (contact and email events).
| HTTP | |
|---|---|
Auth: HMAC SHA-256 signature (X-Resend-Signature header)
No API key required. Signature-verified only.
Stripe Webhook¶
Receives webhook events from Stripe (checkout, subscription, payment events).
| HTTP | |
|---|---|
Auth: Stripe webhook signature
No API key required. Signature-verified only.
Health Endpoints¶
Basic Health Check¶
| HTTP | |
|---|---|
Response (200 OK):
Readiness Check¶
Checks database connection and Redis.
| HTTP | |
|---|---|
Response (200 OK):
Error Responses¶
All errors follow the RFC 7807 Problem Details format:
| JSON | |
|---|---|
See Error Codes Reference for the complete list.
SDKs¶
Python¶
| Python | |
|---|---|
TypeScript¶
| TypeScript | |
|---|---|
See SDK Setup Guide for details.