Skip to content

Quick Start

Quick Start

This guide will help you make your first API call in under 5 minutes.

Prerequisites

  • A Flow account with an active subscription
  • An API key (see Authentication)
  • At least one connected social account

Step 1: Install the SDK

Terminal window
npm install @flowdev/sdk

Or use the API directly with any HTTP client.

Step 2: Initialize the Client

import { Flow } from '@flowdev/sdk';
const flow = new Flow('flow_sk_live_...');

Step 3: Create a Post

// Create and schedule a post
const post = await flow.posts.create({
channel: 'your-channel-id',
content: '🚀 Hello from the Flow API!',
scheduledFor: new Date(Date.now() + 3600000).toISOString(), // 1 hour from now
});
console.log('Post created:', post.id);

Step 4: Check Post Status

// Get post details
const postDetails = await flow.posts.get(post.id);
console.log('Status:', postDetails.status);

Using cURL

If you prefer to use cURL:

Terminal window
# Create a post
curl -X POST https://api.flowsocial.app/v1/posts \
-H "Authorization: Bearer flow_sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"channel": "your-channel-id",
"content": "🚀 Hello from the Flow API!",
"scheduledFor": "2024-01-15T10:00:00Z"
}'

Next Steps