Docs / Developers / API Reference
Back to FastMode

API Reference

Access Fast Mode programmatically with our REST API. Manage CMS content, retrieve collection items, and handle form submissions.

Overview

The Fast Mode External API allows you to:

  • Read and write CMS collection items

  • List collections and their fields

  • Retrieve and create form submissions

  • Integrate with external services and automation tools

Base URL

https://api.fastmode.ai/external

All API endpoints are prefixed with /external.


Authentication

API Keys

Generate an API key in your Fast Mode dashboard:

  1. Go to SettingsAPI Keys

  2. Click Generate API Key

  3. Copy and securely store your key (it won't be shown again)

Using Your API Key

Include the API key in the X-Api-Key header for all requests:

curl https://api.fastmode.ai/external/collections \
  -H "X-Api-Key: YOUR_API_KEY"

Required Headers

HeaderDescriptionX-Api-KeyYour API key (required for all requests)Content-Typeapplication/json (required for POST/PUT requests)

Note: The API key is tied to your project. You don't need to specify a tenant/site ID - it's automatically determined from your API key.


Response Format

Success Response

{
  "success": true,
  "data": { ... }
}

Error Response

{
  "success": false,
  "error": "Error message describing what went wrong"
}

HTTP Status Codes

StatusDescription200Success201Created successfully400Bad request (validation error)401Unauthorized (invalid or missing API key)404Resource not found500Internal server error


Collections Endpoints

Collections are the core of your CMS - they contain your structured content like blog posts, team members, products, etc.

List All Collections

Get all collections in your project with their fields and item counts.

GET /external/collections

Example Request:

curl https://api.fastmode.ai/external/collections \
  -H "X-Api-Key: YOUR_API_KEY"

Response:

{
  "success": true,
  "data": [
    {
      "id": "abc123",
      "slug": "blog",
      "name": "Blog Posts",
      "nameSingular": "Blog Post",
      "description": "Articles and news",
      "hasSlug": true,
      "fields": [...],
      "_count": { "items": 15 }
    }
  ]
}

Get Collection by Slug

GET /external/collections/{collectionSlug}

Example:

curl https://api.fastmode.ai/external/collections/blog \
  -H "X-Api-Key: YOUR_API_KEY"

List Items in a Collection

GET /external/collections/{collectionSlug}/items

Query Parameters:

ParameterTypeDescriptionpublishedstringFilter: true (published only), false (drafts only), or omit for all

Example - Published Only:

curl "https://api.fastmode.ai/external/collections/blog/items?published=true" \
  -H "X-Api-Key: YOUR_API_KEY"

Response:

{
  "success": true,
  "data": [
    {
      "id": "item123",
      "name": "Getting Started with Fast Mode",
      "slug": "getting-started-with-fast-mode",
      "data": {
        "content": "<p>Welcome to Fast Mode...</p>",
        "excerpt": "Learn the basics"
      },
      "publishedAt": "2024-01-15T12:00:00.000Z",
      "createdAt": "2024-01-14T10:00:00.000Z",
      "updatedAt": "2024-01-15T12:00:00.000Z"
    }
  ]
}

Important: Custom fields are returned in the data object, not at the root level.


Get Single Item

GET /external/collections/{collectionSlug}/items/{itemSlug}

Example:

curl https://api.fastmode.ai/external/collections/blog/items/getting-started \
  -H "X-Api-Key: YOUR_API_KEY"

Create Item

POST /external/collections/{collectionSlug}/items

Request Body:

FieldTypeRequiredDescriptionnamestringYesDisplay name/title for the itemslugstringNoURL-friendly slug (auto-generated if not provided)dataobjectYesObject containing all custom field valuespublishedAtstringNoISO 8601 date. Set to publish, omit for draftordernumberNoSort order (default: 0)

Example:

curl -X POST https://api.fastmode.ai/external/collections/blog/items \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My New Blog Post",
    "data": {
      "content": "<p>This is my new article...</p>",
      "excerpt": "A brief summary"
    },
    "publishedAt": "2024-01-20T12:00:00.000Z"
  }'

Update Item

PUT /external/collections/{collectionSlug}/items/{itemSlug}

Only include fields you want to change.

Example - Update Content:

curl -X PUT https://api.fastmode.ai/external/collections/blog/items/my-post \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Title",
    "data": {
      "content": "<p>Updated content...</p>"
    }
  }'

Example - Unpublish:

curl -X PUT https://api.fastmode.ai/external/collections/blog/items/my-post \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "publishedAt": null }'

Note: When updating data, you must include ALL fields - it replaces the entire data object.


Delete Item

DELETE /external/collections/{collectionSlug}/items/{itemSlug}

Example:

curl -X DELETE https://api.fastmode.ai/external/collections/blog/items/my-old-post \
  -H "X-Api-Key: YOUR_API_KEY"

Warning: This action is permanent and cannot be undone.


Forms Endpoints

Submit a Form

POST /external/forms/{formName}/submit

Request Body:

{
  "pagePath": "/contact",
  "payload": {
    "name": "John Doe",
    "email": "[email protected]",
    "message": "Hello!"
  }
}

Get Form Submissions

GET /external/forms/submissions

Query Parameters:

ParameterTypeDescriptionformNamestringFilter by form namelimitnumberMax results (default: 50)

Example:

curl "https://api.fastmode.ai/external/forms/submissions?formName=contact" \
  -H "X-Api-Key: YOUR_API_KEY"

Media Upload

POST /external/media/upload

Upload images and files to your site's media library.

Request: Multipart form data with a file field.

Example:

curl -X POST https://api.fastmode.ai/external/media/upload \
  -H "X-Api-Key: YOUR_API_KEY" \
  -F "file=@/path/to/image.jpg"

Response:

{
  "success": true,
  "data": {
    "url": "https://cdn.fastmode.ai/tenants/.../image.jpg",
    "filename": "image.jpg",
    "size": 125000,
    "mimeType": "image/jpeg"
  }
}

Webhooks

The API automatically triggers webhooks when items are created, updated, or deleted.

Webhook Events

EventDescription{collection}.createdNew item added (e.g., blog.created){collection}.updatedItem modified (e.g., team.updated){collection}.deletedItem removed (e.g., products.deleted)form.submittedForm submission received

See the Webhooks documentation for setup details.


Field Types Reference

When creating or updating items, the data object should match your collection's field schema:

Field TypeValue FormatExampletextString"Hello World"richTextHTML string"<p>Formatted <strong>content</strong></p>"numberNumber42 or 3.14emailEmail string"[email protected]"urlURL string"https://example.com"dateISO 8601 date"2024-01-20"booleanBooleantrue or falseselectString (option)"option1"multiSelectArray of strings["option1", "option2"]imageURL string"https://cdn.example.com/image.jpg"fileURL string"https://cdn.example.com/doc.pdf"relationItem slug or ID"related-item-slug"


Rate Limiting

  • 100 requests per minute per API key

  • Exceeding limits returns 429 Too Many Requests

If you need higher limits, contact support.


Troubleshooting

401 Unauthorized

{"success": false, "error": "Invalid API key"}
  • Verify your API key is correct

  • Check that the key hasn't been revoked in Settings → API Keys

  • Ensure you're using X-Api-Key header (not Authorization: Bearer)

404 Not Found

{"success": false, "error": "Collection not found"}
  • Verify the collection slug exists

  • Collection slugs are case-sensitive and lowercase

400 Bad Request

{"success": false, "error": "Title is required"}
  • Check that all required fields are included in data

  • Verify JSON is properly formatted


Code Examples

JavaScript / Node.js

const API_KEY = 'your_api_key';

async function apiRequest(endpoint, options = {}) {
  const response = await fetch(`https://api.fastmode.ai/external${endpoint}`, {
    ...options,
    headers: {
      'X-Api-Key': API_KEY,
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });
  const result = await response.json();
  if (!result.success) throw new Error(result.error);
  return result.data;
}

// Get all blog posts
const posts = await apiRequest('/collections/blog/items?published=true');

// Create a new post
const newPost = await apiRequest('/collections/blog/items', {
  method: 'POST',
  body: JSON.stringify({
    name: 'Hello World',
    data: { content: '<p>My first API post!</p>' },
    publishedAt: new Date().toISOString(),
  }),
});

Python

import requests

API_KEY = 'your_api_key'
headers = {
    'X-Api-Key': API_KEY,
    'Content-Type': 'application/json'
}

# Get published blog posts
response = requests.get(
    'https://api.fastmode.ai/external/collections/blog/items?published=true',
    headers=headers
)
posts = response.json()['data']

# Create a new post
response = requests.post(
    'https://api.fastmode.ai/external/collections/blog/items',
    headers=headers,
    json={
        'name': 'Hello from Python',
        'data': {'content': '<p>API-created content!</p>'},
        'publishedAt': '2024-01-20T12:00:00.000Z'
    }
)

cURL Cheat Sheet

# Set your API key
export API_KEY="your_api_key"

# List all collections
curl https://api.fastmode.ai/external/collections \
  -H "X-Api-Key: $API_KEY"

# Get published blog posts
curl "https://api.fastmode.ai/external/collections/blog/items?published=true" \
  -H "X-Api-Key: $API_KEY"

# Create a post
curl -X POST https://api.fastmode.ai/external/collections/blog/items \
  -H "X-Api-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "New Post", "data": {"content": "<p>Hello!</p>"}}'

# Update a post
curl -X PUT https://api.fastmode.ai/external/collections/blog/items/my-post \
  -H "X-Api-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Updated Title"}'

# Delete a post
curl -X DELETE https://api.fastmode.ai/external/collections/blog/items/my-post \
  -H "X-Api-Key: $API_KEY"

Built in Fast Mode