Skip to content

API Overview

Flapjack exposes an Algolia-compatible REST API. If you’ve used Algolia’s API, you already know Flapjack’s API.

  • Self-hosted: http://localhost:7700 (or your configured address)
  • Flapjack Cloud: https://<your-ip>:7700 (shown in dashboard)

All write and search endpoints require two headers:

X-Algolia-Application-Id: flapjack
X-Algolia-API-Key: YOUR_ADMIN_KEY

The application ID is always flapjack. The API key is the admin key you configured (self-hosted) or the one shown in your dashboard (Cloud).

Unauthenticated endpoints: /health and /stats do not require auth headers.

MethodPathAuthDescription
GET/healthNoHealth check
GET/statsNoDatabase size stats
MethodPathAuthDescription
POST/1/indexes/{indexName}/queryYesSearch an index
POST/1/indexes/*/queriesYesSearch multiple indices
MethodPathAuthDescription
POST/1/indexes/{indexName}/batchYesBatch operations
POST/1/indexes/{indexName}YesAdd object
PUT/1/indexes/{indexName}/{objectID}YesUpdate object
DELETE/1/indexes/{indexName}/{objectID}YesDelete object
GET/1/indexes/{indexName}/{objectID}YesGet object
MethodPathAuthDescription
GET/1/indexesYesList indices
DELETE/1/indexes/{indexName}YesDelete index
POST/1/indexes/{indexName}/clearYesClear objects
MethodPathAuthDescription
GET/1/indexes/{indexName}/settingsYesGet settings
PUT/1/indexes/{indexName}/settingsYesUpdate settings

All endpoints return JSON. Search responses follow the Algolia format:

{
"hits": [...],
"nbHits": 100,
"page": 0,
"hitsPerPage": 20,
"nbPages": 5,
"processingTimeMS": 1,
"query": "search term"
}

Write operations return:

{
"taskID": 12345,
"objectIDs": ["id1", "id2"]
}

Errors return appropriate HTTP status codes with a JSON body:

{
"message": "Description of the error",
"status": 400
}
StatusMeaning
400Bad request (invalid JSON, missing fields)
401Unauthorized (missing or invalid API key)
404Index or object not found
500Internal server error