Skip to main content

Quick Start Guide

Get up and running with the Flow API in 5 minutes.

Prerequisites

  • A Flow account (Sign up)
  • An API key (create one in Settings → API Keys)
  • Node.js 18+ (for TypeScript/JavaScript) or Python 3.8+ (for Python)

Step 1: Install the SDK

TypeScript/JavaScript

npm install @flowdev/sdk
# or
yarn add @flowdev/sdk

Python

pip install flow-sdk

Go

go get github.com/flowdev/go-sdk

Step 2: Get Your API Key

  1. Log in to your Flow dashboard
  2. Navigate to SettingsAPI Keys
  3. Click Create API Key
  4. Give it a name (e.g., "Production" or "Development")
  5. Copy the key immediately - you won't be able to see it again!

Your API key format: flow_sk_live_<prefix>_<secret>

Step 3: Create Your First Post

TypeScript/JavaScript

import { Flow } from '@flowdev/sdk';

// Initialize the client
const flow = new Flow('flow_sk_live_abc12345_xyz789...');

// Create a channel (if you don't have one)
const channel = await flow.channels.create({
name: 'My First Channel',
color: '#3B82F6',
});

// Create a post
const post = await flow.posts.create({
channelId: channel.id,
content: 'Hello from Flow! 🚀',
scheduledFor: new Date('2024-12-25T10:00:00Z'), // Schedule for future
// Or omit scheduledFor to post immediately
});

console.log('Post created:', post.id);
console.log('Status:', post.status); // 'queued' or 'flowing'

Python

from flow_sdk import Flow
from datetime import datetime

# Initialize the client
flow = Flow(api_key='flow_sk_live_abc12345_xyz789...')

# Create a channel (if you don't have one)
channel = flow.channels.create(
name='My First Channel',
color='#3B82F6'
)

# Create a post
post = flow.posts.create(
channel_id=channel.id,
content='Hello from Flow! 🚀',
scheduled_for=datetime(2024, 12, 25, 10, 0, 0) # Schedule for future
# Or omit scheduled_for to post immediately
)

print(f'Post created: {post.id}')
print(f'Status: {post.status}') # 'queued' or 'flowing'

Go

package main

import (
"fmt"
"time"
"github.com/flowdev/go-sdk"
)

func main() {
// Initialize the client
client := flow.NewClient("flow_sk_live_abc12345_xyz789...")

// Create a channel (if you don't have one)
channel, err := client.Channels.Create(&flow.CreateChannelRequest{
Name: "My First Channel",
Color: "#3B82F6",
})
if err != nil {
panic(err)
}

// Create a post
post, err := client.Posts.Create(&flow.CreatePostRequest{
ChannelID: channel.ID,
Content: "Hello from Flow! 🚀",
ScheduledFor: time.Date(2024, 12, 25, 10, 0, 0, 0, time.UTC),
})
if err != nil {
panic(err)
}

fmt.Printf("Post created: %s\n", post.ID)
fmt.Printf("Status: %s\n", post.Status) // 'queued' or 'flowing'
}

Using cURL (No SDK)

# Create a post
curl -X POST https://api.flow.dev/v1/posts \
-H "Authorization: Bearer flow_sk_live_abc12345_xyz789..." \
-H "Content-Type: application/json" \
-d '{
"channelId": "channel_123",
"content": "Hello from Flow! 🚀",
"scheduledFor": "2024-12-25T10:00:00Z"
}'

Step 4: Connect a Platform

Before your posts can be published, you need to connect a social media platform:

  1. Via Dashboard: Go to Settings → Connections and connect your accounts
  2. Via API: Use the OAuth flow (see Connections Guide)

Step 5: Check Post Status

// Get post details
const post = await flow.posts.get(postId);
console.log('Status:', post.status); // 'queued', 'flowing', 'done', or 'blocked'

// List all posts
const posts = await flow.posts.list({
status: 'queued', // Filter by status
channelId: 'channel_123', // Filter by channel
});

Try It Out

Want to test the API without writing code? Use our Interactive API Reference to make live requests from your browser.

Next Steps

Common Tasks

Schedule a Post for Later

const post = await flow.posts.create({
channelId: 'channel_123',
content: 'This will post tomorrow at 9 AM',
scheduledFor: new Date('2024-12-26T09:00:00Z'),
});

Post Immediately

const post = await flow.posts.create({
channelId: 'channel_123',
content: 'This posts right away!',
// Omit scheduledFor to post immediately
});

Update a Scheduled Post

// Only works if post is still 'queued'
await flow.posts.update(postId, {
content: 'Updated content',
scheduledFor: new Date('2024-12-27T10:00:00Z'),
});

Cancel a Post

await flow.posts.delete(postId);

Upload Media

// Upload an image
const media = await flow.media.upload({
file: fs.readFileSync('image.jpg'),
filename: 'image.jpg',
});

// Use in a post
const post = await flow.posts.create({
channelId: 'channel_123',
content: 'Check out this image!',
mediaKeys: [media.key],
});

Need Help?