Skip to main content

Getting Started

Welcome to the Flow API! This guide will help you make your first API call.

Prerequisites

  • A Flow account (sign up)
  • An API key (create one in Settings → Developer)

Your First API Call

Let's list your posts:

curl https://api.flowsocial.app/v1/posts \
-H "Authorization: Bearer flow_sk_live_abc12345_xyz789..."

Response:

[
{
"id": "post_abc123",
"userId": "user_xyz",
"channelId": "channel_123",
"content": "Hello, world!",
"scheduledFor": 1703123456000,
"status": "queued",
"createdAt": 1703000000000
}
]

Creating a Post

Schedule a post for the future:

curl -X POST https://api.flowsocial.app/v1/posts \
-H "Authorization: Bearer flow_sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"channelId": "channel_123",
"content": "Scheduled via API!",
"scheduledFor": "2024-12-25T10:00:00Z"
}'

Response:

{
"id": "post_new123",
"userId": "user_xyz",
"channelId": "channel_123",
"content": "Scheduled via API!",
"scheduledFor": 1735128000000,
"status": "queued",
"createdAt": 1703123456000
}

Using the SDK

The Flow TypeScript SDK makes it even easier:

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

const flow = new Flow('flow_sk_live_...');

// Create a post
const post = await flow.posts.create({
channelId: 'channel_123',
content: 'Hello from the SDK!',
scheduledFor: new Date('2024-12-25T10:00:00Z'),
});

console.log('Post created:', post.id);

Next Steps

Need Help?