Quickstart — Your First API Call

Create your first internal newsletter programmatically in under 5 minutes. Generate an API key, create content blocks, and assemble a newsletter.

Get from zero to a working newsletter in 5 minutes.

1. Generate an API key

Go to Team Settings → API Keys and create a new key with read and write scopes. Copy the key — it starts with inl_ and won't be shown again.

2. Check your team info

curl -s https://your-app.com/api/v1/team \\
  -H "Authorization: Bearer inl_your_key" | json_pp

This returns your team name, brand colour, plan, and current usage.

3. Create a content block

curl -s https://your-app.com/api/v1/content_blocks \\
  -X POST \\
  -H "Authorization: Bearer inl_your_key" \\
  -H "Content-Type: application/json" \\
  -d '{
    "title": "Welcome to Q1",
    "body": "<p>Great start to the year. Here are the highlights...</p>",
    "block_type": "ceo_update",
    "status": "ready"
  }' | json_pp

Note the id in the response — you'll need it next.

4. Create a newsletter and add the block

# Create the newsletter
curl -s https://your-app.com/api/v1/newsletters \\
  -X POST \\
  -H "Authorization: Bearer inl_your_key" \\
  -H "Content-Type: application/json" \\
  -d '{
    "title": "Weekly Update — January 6",
    "subject_line": "Your weekly update is here",
    "template_slug": "clean"
  }' | json_pp

# Add the content block (use IDs from previous responses)
curl -s https://your-app.com/api/v1/newsletters/NEWSLETTER_ID/blocks \\
  -X POST \\
  -H "Authorization: Bearer inl_your_key" \\
  -H "Content-Type: application/json" \\
  -d '{"content_block_id": "BLOCK_ID"}'

5. Preview the result

curl -s https://your-app.com/api/v1/newsletters/NEWSLETTER_ID/preview \\
  -H "Authorization: Bearer inl_your_key" | json_pp

This returns the fully rendered HTML — styled, branded, and email-client compatible.

6. Use AI to draft content (optional)

curl -s https://your-app.com/api/v1/content_blocks/ai_draft \\
  -X POST \\
  -H "Authorization: Bearer inl_your_key" \\
  -H "Content-Type: application/json" \\
  -d '{"context": "Write a team spotlight about the engineering team shipping the new mobile app ahead of schedule"}'

The AI generates a fully typed content block (with title, body, and block type) that's ready to add to a newsletter.

Next steps