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
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | yes | One of: log, object, exception, query, measure, request |
| content | string | yes | JSON-encoded value. For log, a quoted string. For object, any JSON value. |
| label | string | no | Display name shown in the header row |
| id | string | no | Unique ID. Auto-generated if omitted. |
| requestId | string | no | Groups related payloads (e.g. all payloads for one HTTP request) |
| project | string | no | Project name shown as a tag — useful when multiple apps send to the same Fanar instance |
| color | string | no | Hex color for the label row (e.g. #4ade80) |
| origin | object | no | Source location — enables clickable file:line in the app |
| origin.file | string | no | Absolute or relative file path |
| origin.line | number | no | Line number |
| origin.function | string | no | Function 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
| Type | content format | Rendered as |
|---|---|---|
| log | JSON string ("hello") | Plain text log line |
| object | Any JSON value | Expandable JSON tree |
| exception | JSON with name, message, stack (string) | Stack trace with clickable frames |
| query | JSON with sql, bindings, duration | Syntax-highlighted SQL + timing |
| measure | JSON with duration | Elapsed time |
| request | JSON with method, path, status, duration | HTTP 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.