Skip to content

Quickstart

Send your first email in 5 minutes.

1. Get your API key

Sign up at subscribeflow.net, open the Dashboard, and create an API key. Copy it immediately -- it is only shown once.

Your key starts with sf_live_ for production or sf_test_ for testing.

2. Install the SDK

pip install subscribeflow
npm install @subscribeflow/sdk

No installation needed. You only need curl and your API key.

3. Create a subscriber

import asyncio
from subscribeflow import SubscribeFlowClient

async def main():
    async with SubscribeFlowClient(api_key="sf_live_...") as client:
        subscriber = await client.subscribers.create(
            email="user@example.com",
            metadata={"source": "website"},
        )
        print(f"Created: {subscriber.id}")

asyncio.run(main())
import { SubscribeFlowClient } from '@subscribeflow/sdk';

const client = new SubscribeFlowClient({
  apiKey: 'sf_live_...',
});

const subscriber = await client.subscribers.create({
  email: 'user@example.com',
  metadata: { source: 'website' },
});

console.log('Created:', subscriber.id);
curl -X POST https://api.subscribeflow.net/api/v1/subscribers \
  -H "X-API-Key: sf_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "metadata": {"source": "website"}
  }'

4. Add a tag

tag = await client.tags.create(
    name="Product Updates",
    description="Get notified about new features",
)
print(f"Tag created: {tag.name}")
const tag = await client.tags.create({
  name: 'Product Updates',
  description: 'Get notified about new features',
});

console.log('Tag created:', tag.name);
curl -X POST https://api.subscribeflow.net/api/v1/tags \
  -H "X-API-Key: sf_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Product Updates",
    "description": "Get notified about new features"
  }'

5. Send an email

result = await client.emails.send(
    template_slug="welcome-email",
    to="user@example.com",
    variables={"company": "Acme Inc"},
)
print(f"Email queued: {result.id}")
const result = await client.emails.send({
  template_slug: 'welcome-email',
  to: 'user@example.com',
  variables: { company: 'Acme Inc' },
});

console.log('Email queued:', result.id);
curl -X POST https://api.subscribeflow.net/api/v1/emails/send \
  -H "X-API-Key: sf_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "template_slug": "welcome-email",
    "to": "user@example.com",
    "variables": {"company": "Acme Inc"}
  }'

Next steps