HTTP API

Fanar exposes a local HTTP server. Any language, script, or tool that can make HTTP requests can send payloads — no client library required.

Base URL

http://localhost:23517

CORS is fully open. All origins are allowed.

POST /api/payloads

Send a payload. It appears in the desktop app instantly.

curl -X POST http://localhost:23517/api/payloads \
  -H "Content-Type: application/json" \
  -d '{"type":"log","label":"hello","content":""world""}'

Returns 201 Created on success.

Payload schema

FieldTypeRequiredDescription
typestringyesOne of: log, object, exception, query, measure, request
contentstringyesJSON-encoded value. For log, a quoted string. For object, any JSON value.
labelstringnoDisplay name shown in the header row
idstringnoUnique ID. Auto-generated if omitted.
requestIdstringnoGroups related payloads (e.g. all payloads for one HTTP request)
projectstringnoProject name shown as a tag — useful when multiple apps send to the same Fanar instance
colorstringnoHex color for the label row (e.g. #4ade80)
originobjectnoSource location — enables clickable file:line in the app
origin.filestringnoAbsolute or relative file path
origin.linenumbernoLine number
origin.functionstringnoFunction or method name

Full example

{
  "id": "req-abc-001",
  "requestId": "req-abc",
  "type": "object",
  "label": "user lookup",
  "color": "#a78bfa",
  "content": "{\"id\": 42, \"name\": \"Alice\", \"role\": \"admin\"}",
  "origin": {
    "file": "/app/services/user.ts",
    "line": 87,
    "function": "findById"
  }
}

Payload types

Typecontent formatRendered as
logJSON string ("hello")Plain text log line
objectAny JSON valueExpandable JSON tree
exceptionJSON with name, message, stack (string)Stack trace with clickable frames
queryJSON with sql, bindings, durationSyntax-highlighted SQL + timing
measureJSON with durationElapsed time
requestJSON with method, path, status, durationHTTP request summary row

GET /api/payloads

Returns all stored payloads as a JSON array, ordered by timestamp ascending. Fanar keeps the last 1,000 payloads.

curl http://localhost:23517/api/payloads

DELETE /api/payloads

Clears all stored payloads. Equivalent to pressing ⌘K in the app.

curl -X DELETE http://localhost:23517/api/payloads

Returns 204 No Content.