API Reference

Integrate FlowCMS into your applications using our RESTful API. All requests must be made over HTTPS and return JSON responses.

â„šī¸
The FlowCMS API is versioned. The current stable version is v1. Base URL for all production requests is https://api.flowcms.io/v1.

Authentication

FlowCMS uses API keys to authenticate requests. You can generate and manage your API keys in the FlowCMS Dashboard under Settings → API Keys.

Header
Authorization: Bearer sk_live_51MzK9j2eZvKYlo2C8xYzPqR7
âš ī¸
Never expose your secret API keys in client-side code or public repositories. Use environment variables or secure vaults.

Base URL & Versioning

All API requests should be made to the following base URL:

Base URL
https://api.flowcms.io/v1

API responses are returned as JSON objects. Successful requests return appropriate HTTP status codes (200, 201, etc.).

Content Management

GET /content/posts
200 401

Retrieve a paginated list of published or draft posts. Supports filtering by status, category, and date range.

Query Parameters

Parameter Type Description
page integer Page number for pagination (default: 1)
limit integer Number of items per page (default: 20, max: 100)
status string Filter by status: published, draft, archived
sort string Sort field: created_at, updated_at, title

Example Request

cURL
curl -X GET "https://api.flowcms.io/v1/content/posts?page=1&limit=10&status=published" \\
  -H "Authorization: Bearer sk_live_your_api_key"

Example Response

JSON
{
  "data: [
    {
      "id: "post_123abc",
      "title: "Getting Started with FlowCMS",
      "slug: "getting-started-with-flowcms",
      "status: "published",
      "author_id: "usr_456xyz",
      "created_at: "2024-03-15T10:30:00Z",
      "updated_at: "2024-03-16T14:22:00Z
    }
  ],
  "meta: {
    "current_page: 1,
    "total_pages: 5,
    "total_items: 48
  }
}
POST /content/posts
201 400

Create a new post. Draft posts are automatically saved unless publish: true is specified.

Request Body

Field Type Required Description
title string Required Post title (max 200 characters)
content string Required Markdown or HTML content body
slug string Optional URL-friendly identifier (auto-generated if omitted)
publish boolean Optional Publish immediately (default: false)

Example Request

JSON
{
  "title: "Advanced API Integration Guide",
  "content: "# FlowCMS API Guide\n\nLearn how to...\n",
  "slug: "advanced-api-guide",
  "publish: true
}
DELETE /content/posts/{id}
204 404

Permanently delete a post. This action cannot be undone. Returns 204 No Content on success.

Path Parameters

ParameterTypeDescription
idstringThe unique post identifier

Webhooks

Receive real-time notifications when content is created, updated, or published. Configure webhook endpoints in your dashboard.

Webhook Payload Example
{
  "event: "content.published",
  "timestamp: "2024-03-15T10:30:00Z",
  "data: {
    "type: "post,
    "id: "post_123abc,
    "action: "published
  }
}

Error Handling

FlowCMS uses standard HTTP status codes to indicate success or failure. Errors include a structured response with codes and messages.

Status Code Meaning
200Success
201Created
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Insufficient permissions
404Not Found - Resource does not exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error