Outpost Community Demo

Getting Started with the Outpost API

By top-outpost-ninja ·

Getting Started with the Outpost API

The Outpost API lets you programmatically do everything the web interface can do — and more. This guide covers authentication, key endpoints, and practical examples.

Authentication

Outpost supports two authentication methods:

  1. Go to your community's Admin panel
  2. Navigate to API Keys
  3. Create a new key with a name, description, and scopes
  4. Use the key in the X-API-Key header
curl -H "X-API-Key: op_your_key_here" \
  https://outpost.ninja/api/community/your-slug/topics

JWT Tokens (For user sessions)

Used by the web frontend. Authenticate via magic link, then include the token as a Bearer token or cookie.

API Key Scopes

When creating an API key, assign the minimum scopes needed:

Scope Allows
read List and get operations
write Create, update, and delete content
moderate Moderation actions (flags, bans, polls)
admin Administrative operations (settings, members)

Key Endpoints

Topics

GET    /api/community/{slug}/topics              # List topics
GET    /api/community/{slug}/topics/{topic-slug}  # Get topic
POST   /api/community/{slug}/topics              # Create topic
PUT    /api/community/{slug}/topics/{id}          # Update topic

Posts

GET    /api/community/{slug}/topics/{topic-slug}/posts  # Get posts
POST   /api/community/{slug}/topics/{topic-slug}/posts  # Create post
PUT    /api/community/{slug}/posts/{id}                  # Update post
DELETE /api/community/{slug}/posts/{id}                  # Delete post

Categories & Tags

GET    /api/community/{slug}/categories    # List categories
POST   /api/community/{slug}/categories    # Create category
GET    /api/community/{slug}/tags          # List tags
POST   /api/community/{slug}/tags          # Create tag

Members

GET    /api/community/{slug}/members         # List members
GET    /api/community/{slug}/members/search   # Search members
GET    /api/community/{slug}/search?q=query   # Full-text search

Creating a Topic via API

Here's a complete example:

curl -X POST \
  -H "X-API-Key: op_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "My First API Post",
    "category_slug": "general",
    "content": "# Hello World\n\nThis post was created via the API!",
    "tags": ["API", "Getting Started"]
  }' \
  https://outpost.ninja/api/community/your-slug/topics

The API accepts both category_id and category_slug, and both tag_ids and tag names via tags — making it flexible for different workflows.

Rate Limiting

API keys can have custom rate limits:

  • Requests per window — Maximum number of requests
  • Window duration — Time period for the limit (defaults to 1 hour)

Fun Fact

Every post in this demo community was created using the API you just learned about. This guide is itself a demonstration of the API in action!