Posts
Posts API
Create, retrieve, and manage scheduled posts.
Create Post
POST /v1/postsCreate a new scheduled post.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
channel | string | Yes | Channel ID to post to |
content | string | Yes | Post content (max 280 chars for Twitter) |
scheduledFor | string | Yes | ISO 8601 timestamp or "now" |
mediaIds | string[] | No | Array of uploaded media IDs |
Example Request
curl -X POST https://api.flowsocial.app/v1/posts \ -H "Authorization: Bearer flow_sk_live_..." \ -H "Content-Type: application/json" \ -d '{ "channel": "ch_abc123", "content": "Hello from Flow!", "scheduledFor": "2024-01-15T10:00:00Z" }'Example Response
{ "id": "post_xyz789", "channel": "ch_abc123", "content": "Hello from Flow!", "status": "scheduled", "scheduledFor": "2024-01-15T10:00:00Z", "createdAt": "2024-01-14T15:30:00Z"}Get Post
GET /v1/posts/:idRetrieve a specific post by ID.
Example Response
{ "id": "post_xyz789", "channel": "ch_abc123", "content": "Hello from Flow!", "status": "published", "scheduledFor": "2024-01-15T10:00:00Z", "publishedAt": "2024-01-15T10:00:05Z", "platformPostId": "1234567890", "createdAt": "2024-01-14T15:30:00Z"}List Posts
GET /v1/postsList posts with optional filters.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
channel | string | Filter by channel ID |
status | string | Filter by status: scheduled, published, failed |
limit | number | Results per page (default: 20, max: 100) |
cursor | string | Pagination cursor |
Example Response
{ "data": [ { "id": "post_xyz789", "channel": "ch_abc123", "content": "Hello from Flow!", "status": "scheduled", "scheduledFor": "2024-01-15T10:00:00Z", "createdAt": "2024-01-14T15:30:00Z" } ], "hasMore": true, "nextCursor": "eyJpZCI6InBvc3RfeHl6Nzg5In0"}Delete Post
DELETE /v1/posts/:idDelete a scheduled post. Only posts with status scheduled can be deleted.
Example Response
{ "deleted": true}Post Statuses
| Status | Description |
|---|---|
scheduled | Post is queued for publishing |
publishing | Post is being published |
published | Post was successfully published |
failed | Post failed to publish |