← Home

API Documentation

Rytsas exposes a REST API at https://rytsas.lionfi.sh/api/v1. All request and response bodies are JSON.

Authentication

Three auth mechanisms

API Key Authorization: Bearer ryt_…
Used by your backend to send notifications. Create keys in the dashboard.
Device Token X-Device-Token: <token>
Used by the mobile app to list subscriptions and notification history.
Session Browser cookie session via GitHub OAuth. Powers the dashboard UI.

MCP Server (Agent Integration)

The Rytsas MCP server lets AI agents send push notifications as a native tool. It’s hosted at https://rytsas.lionfi.sh/mcp—no local install required.

Configuration

Add to your .mcp.json (Claude Code) or equivalent MCP client config:

{
  "mcpServers": {
    "rytsas": {
      "type": "url",
      "url": "https://rytsas.lionfi.sh/mcp",
      "headers": {
        "Authorization": "Bearer rytsas_YOUR_API_KEY"
      }
    }
  }
}

Replace rytsas_YOUR_API_KEY with an API key from your dashboard.

Available Tool

TOOL send_notification
Send a push notification to a subscribed user.
ParameterTypeRequiredDescription
user_idstringYesThe user alias to notify
titlestringYesNotification title
bodystringYesNotification body text
linkstringNoURL to open on tap
metadataobjectNoArbitrary key-value data passed to the device

Response

{
  "id": "01J…",
  "status": "sent",
  "devices_targeted": 1
}

Endpoints

POST /api/v1/notify API Key
Send a push notification to a subscribed user.

Request body

FieldTypeRequiredDescription
user_idstringYesThe user alias to notify
titlestringYesNotification title
bodystringYesNotification body text
linkstringNoURL to open on tap
metadataobjectNoArbitrary key-value data passed to the device

Example

curl -X POST https://rytsas.lionfi.sh/api/v1/notify \
  -H "Authorization: Bearer ryt_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "alice",
    "title": "New message",
    "body": "You have 3 unread messages",
    "link": "https://example.com/inbox"
  }'

Response

{
  "id": "01J…",
  "status": "sent",
  "devices_targeted": 1
}
POST /api/v1/devices/register None
Register or update a mobile device for push notifications.

Request body

FieldTypeRequiredDescription
device_tokenstringYesStable device identifier
fcm_tokenstringYesFirebase Cloud Messaging token
platformstringYesandroid or ios

Example

curl -X POST https://rytsas.lionfi.sh/api/v1/devices/register \
  -H "Content-Type: application/json" \
  -d '{
    "device_token": "device_abc123",
    "fcm_token": "fcm_token_here",
    "platform": "android"
  }'

Response

{ "device_id": "01J…" }
POST /api/v1/subscriptions/subscribe None
Subscribe a device to a project (typically triggered after QR scan).

Request body

FieldTypeRequiredDescription
device_tokenstringYesStable device identifier
project_idstringYesProject to subscribe to
user_aliasstringYesUser identifier within the project

Response

{ "subscription_id": "01J…" }
POST /api/v1/subscriptions/unsubscribe None
Unsubscribe a device from a project.

Request body

FieldTypeRequiredDescription
device_tokenstringYesStable device identifier
project_idstringYesProject to unsubscribe from

Response

{ "ok": true }
GET /api/v1/subscriptions/mine Device Token
List active subscriptions for a device.

Example

curl https://rytsas.lionfi.sh/api/v1/subscriptions/mine \
  -H "X-Device-Token: device_abc123"

Response

{
  "subscriptions": [
    {
      "id": "01J…",
      "project_id": "01J…",
      "project_name": "My Project",
      "user_alias": "alice",
      "created_at": 1700000000000
    }
  ]
}
GET /api/v1/notifications/history Device Token
Fetch notification history for a device. Supports pagination.

Query parameters

ParamTypeDefaultDescription
sincenumber0Only return notifications created after this timestamp (ms)
limitnumber50Max results (capped at 100)

Example

curl https://rytsas.lionfi.sh/api/v1/notifications/history \
  -H "X-Device-Token: device_abc123"

Response

{
  "notifications": [
    {
      "id": "01J…",
      "project_id": "01J…",
      "project_name": "My Project",
      "title": "Deploy complete",
      "body": "v2.1.0 is live",
      "status": "sent",
      "sent_at": 1700000000000,
      "created_at": 1700000000000
    }
  ]
}