Documentation
API Reference

API Overview

Flapjack REST API reference. Base URL, authentication, error format, and request conventions.

The Flapjack REST API lets you manage agents, threads, knowledge, MCP servers, and API keys programmatically.

Base URL

https://api.flapjack.dev

All endpoints are prefixed with /api/.

Authentication

Include your API key as a Bearer token:

Authorization: Bearer fj_live_...

API keys are created at flapjack.chatKeys.

Request Format

  • Content-Type: application/json for all non-upload endpoints
  • Uploads: multipart/form-data for file uploads (knowledge)
  • IDs: All resource IDs are UUIDs

Response Format

Successful responses return JSON:

{
  "id": "abc-123",
  "name": "My Agent",
  "created_at": "2026-03-28T12:00:00Z"
}

List endpoints return JSON arrays:

[
  { "id": "abc-123", "name": "Agent 1" },
  { "id": "def-456", "name": "Agent 2" }
]

Error Format

Error responses return JSON with error and optional detail:

{
  "error": "NOT_FOUND",
  "detail": "Agent not found"
}

HTTP Status Codes

StatusMeaning
200Success
201Created
204Deleted (no content)
400Bad request (invalid body)
401Unauthorized (missing or invalid API key)
403Forbidden (no access to this resource)
404Resource not found
422Validation error
500Internal server error

Streaming Responses

The POST /api/threads/{threadId}/messages endpoint returns Server-Sent Events (SSE) instead of JSON. See Concepts: Streaming for the event format.

Endpoint Reference

SectionEndpoints
AgentsCRUD, configuration, sub-resources
ThreadsCreate threads, send messages, stop, participants
KnowledgeUpload, list, delete documents
MCP ServersMCP server management, OAuth
KeysAPI key management
ModelsSupported models and pricing
RunnersHeadless AI pipelines — CRUD, steps, triggers, runs
ComputerPersistent computer — create from template, exec, status, webhooks
SkillsSkill marketplace — browse, install, sync, attach to agents/runners
ProjectsOrganizational grouping for agents and runners

Logs / Tracing

EndpointDescription
GET /api/logsPaginated trace list (filter by agent, runner, thread, status)
GET /api/logs/{traceId}Full trace with span tree and evaluations

See Concepts: Tracing for the data model.

Additional Endpoints

These endpoints are also available but don't have dedicated reference pages yet. See the SDK Client Reference for typed wrappers.

EndpointDescription
GET/POST /api/integrationsDatabase integration CRUD
GET/DELETE /api/integrations/{id}Get or delete integration
GET/POST /api/toolsCustom tool definitions
GET/PATCH/DELETE /api/tools/{id}Custom tool CRUD
GET/POST /api/plansPlan CRUD (query by threadId)
GET/PATCH/DELETE /api/plans/{id}Individual plan management
POST /api/plans/{id}/todosAdd todos to a plan
PATCH/DELETE /api/plans/{id}/todos/{todoId}Update or delete a todo
GET /api/analyticsUsage analytics (period, agentId)
GET/PUT/DELETE /api/agents/{id}/marketplaceMarketplace profile
POST /api/agents/{id}/marketplace/avatarUpload agent avatar
GET/PUT /api/agents/{id}/multiplayerMultiplayer configuration
GET/PUT /api/agents/{id}/delegatedDelegated tools configuration
GET/PUT /api/agents/{id}/credentialsCredential resolver (BYOK) configuration
GET/POST/PUT /api/agents/{id}/suggestionsAgent improvement suggestions (PUT to dismiss/undismiss)
GET/POST /api/agents/{id}/channelsChannel adapter management
GET/PUT /api/agents/{id}/scheduled-tasksScheduled tasks configuration
GET/POST /api/agents/{id}/skillsSkill attachments — see Skills
GET/PUT /api/runners/{id}/budgetRunner budget configuration
POST /api/runners/{id}/runs/{runId}/resumeResume a budget-paused run
GET/POST /api/skillsSkill marketplace — see Skills
GET /api/skills/browseBrowse the unified skill marketplace
POST /api/skills/{id}/syncRe-sync skill source content
GET/POST /api/runners/{id}/skillsRunner skill bindings
GET/POST /api/projectsProject CRUD — see Projects
GET/PATCH/DELETE /api/projects/{id}Individual project management
GET /api/projects/{id}/membersList agents and runners in a project
GET /api/marketplace/officialOfficial marketplace agent templates
POST /api/marketplace/official/useCreate agent from official template
GET /api/mcp-registry/searchMCP server registry search
GET /api/mcp-registry/managedManaged OAuth MCP providers
Docs last updated May 11, 2026