API Reference
Complete reference for the HTTP API, CLI, notification payload, style properties, and environment variables.
HTTP endpoints
syncfu runs an HTTP server on port 9868 by default.
| Method | Path | Description |
|---|---|---|
POST | /notify | Send a notification. Returns {"id":"..."} |
POST | /notify/{id}/update | Update body, progress, or actions of an existing notification |
POST | /notify/{id}/action | Trigger an action button (fires webhook, dismisses) |
POST | /notify/{id}/dismiss | Dismiss a specific notification |
GET | /notify/{id}/wait | SSE stream — blocks until action or dismiss |
POST | /dismiss-all | Dismiss all active notifications |
GET | /health | Server status + active notification count |
GET | /active | List all active notifications (JSON array) |
Notification payload
POST /notify
Content-Type: application/json
{
"sender": "my-app",
"title": "Build Complete",
"body": "All 142 tests passed — coverage 87%",
"icon": "circle-check",
"font": "JetBrains Mono",
"priority": "normal",
"timeout": { "seconds": 15 },
"actions": [
{ "id": "open", "label": "Open PR", "style": "primary" },
{ "id": "dismiss", "label": "Dismiss", "style": "secondary" }
],
"progress": { "value": 0.75, "label": "3 of 4", "style": "bar" },
"group": "ci-builds",
"theme": "dark",
"sound": "success",
"callback_url": "http://localhost:8080/callback",
"style": {
"accentColor": "#22c55e",
"cardBg": "rgba(10, 40, 20, 0.96)"
}
}Field reference
| Field | Type | Required | Description |
|---|---|---|---|
sender | string | yes | Identifier for the sending process |
title | string | yes | Notification title |
body | string | yes | Body text (plain text) |
icon | string | no | Lucide icon name (e.g. rocket, bell) |
font | string | no | Google Font name (e.g. Space Grotesk) |
priority | string | no | low, normal (default), high, critical |
timeout | object | no | {"seconds": N} or "never" or "default" |
actions | array | no | Up to 3 action buttons (see below) |
progress | object | no | Progress indicator (bar or ring style) |
group | string | no | Group key for related notifications |
theme | string | no | light or dark (auto-follows system) |
sound | string | no | Sound name (accepted, playback planned) |
callback_url | string | no | URL to POST when an action is clicked |
style | object | no | Per-notification style overrides (27 properties) |
Action button format
{
"id": "deploy", // returned as action_id
"label": "Deploy", // button text
"style": "primary", // primary | secondary | danger
"icon": "rocket", // optional Lucide icon
"bg": "#22c55e", // optional background color
"color": "#ffffff", // optional text color
"borderColor": "#16a34a" // optional border color
}Progress format
{
"value": 0.75, // 0.0 to 1.0
"label": "3 of 4", // optional text label
"style": "bar" // "bar" (default) or "ring"
}Priority levels & timeouts
| Priority | Default timeout | Visual behavior |
|---|---|---|
low | 6 seconds | Standard appearance |
normal | 8 seconds | Standard appearance |
high | 12 seconds | Emphasized styling |
critical | Never (manual dismiss) | Pulsing glow border (Siri-style) |
Style properties (27)
Override any visual property per notification via the style object:
{
"style": {
"accentColor": "#22c55e",
"cardBg": "rgba(10, 40, 20, 0.96)",
"cardBorderRadius": "16px",
"iconColor": "#4ade80",
"iconBg": "rgba(34, 197, 94, 0.15)",
"iconBorderColor": "#22c55e",
"titleColor": "#bbf7d0",
"titleFontSize": "15px",
"bodyColor": "#86efac",
"bodyFontSize": "13px",
"senderColor": "#67e8f9",
"timeColor": "#9ca3af",
"btnBg": "#7c3aed",
"btnColor": "#ffffff",
"btnBorderColor": "#6d28d9",
"btn2Bg": "transparent",
"btn2Color": "#c084fc",
"btn2BorderColor": "#7c3aed",
"dangerBg": "#dc2626",
"dangerColor": "#ffffff",
"dangerBorderColor": "#b91c1c",
"progressColor": "#22c55e",
"progressTrackColor": "rgba(255,255,255,0.1)",
"countdownColor": "#ef4444",
"closeBg": "transparent",
"closeColor": "#9ca3af",
"closeBorderColor": "transparent"
}
}CLI shorthand: --style-json '{...}'
CLI reference
syncfu send [OPTIONS] <BODY> syncfu update <ID> [OPTIONS] syncfu dismiss <ID> syncfu dismiss-all syncfu list syncfu health
syncfu send flags
| Flag | Short | Description |
|---|---|---|
--title | -t | Notification title |
--priority | -p | low, normal, high, critical |
--icon | -i | Lucide icon name |
--sender | -s | Sender identifier |
--action | -a | Action button (id:label or id:label:style) |
--wait | Block until user responds (SSE) | |
--wait-timeout | Timeout in seconds for --wait | |
--progress | Initial progress value (0.0–1.0) | |
--progress-label | Text label for progress indicator | |
--progress-style | bar (default) or ring | |
--timeout | Auto-dismiss seconds, or "never" | |
--font | Google Font name | |
--callback-url | Webhook URL for action clicks | |
--style-json | JSON string of style overrides | |
--group | Group key | |
--json | Output JSON response (includes notification id) |
Exit codes (with --wait)
| Outcome | stdout | Exit code |
|---|---|---|
| Action button clicked | action_id | 0 |
| Dismissed (X button) | dismissed | 1 |
| Timeout (--wait-timeout) | timeout | 2 |
Recommended icons (Lucide v1.x)
syncfu supports all 1400+ Lucide icons. Here are the most useful for notification workflows:
rocket circle-check circle-x triangle-alert bell mail terminal git-pull-request shield-alert flame siren trending-up calendar-clock message-circle eye pen-tool loader server-crash webhook trophy newspaper info pill coffee lightbulb user folder repeat clock brain cpu hard-drive
Environment variables
| Variable | Default | Description |
|---|---|---|
SYNCFU_SERVER | http://localhost:9868 | Point CLI at a remote syncfu instance |
SSE wait endpoint (custom clients)
# Send notification, get ID
ID=$(curl -s -X POST localhost:9868/notify \
-H "Content-Type: application/json" \
-d '{"sender":"ci","title":"Approve?","body":"Deploy v2","actions":[{"id":"yes","label":"Yes","style":"primary"}]}' \
| jq -r .id)
# Open SSE stream — blocks until user responds
curl -N "localhost:9868/notify/$ID/wait"
# event: message
# data: {"event":"connected"}
#
# event: message
# data: {"event":"action","action_id":"yes"}Start building
Full API, 27 style properties, 1400+ icons. Everything you need to integrate syncfu into your workflow.
Get started →