Push Notification Gateway

Internal service for delivering push notifications to iOS and Android devices via APNs and FCM. Provides a unified REST API abstracting transport-layer differences.

Access is restricted to internal network only. Contact your administrator to obtain an API token.

Base URL

Base URL https://push.djrafik.ru/v1

All API requests must use HTTPS. Plain HTTP connections are rejected.

Authentication

All requests require a Bearer token in the Authorization header.

Header Authorization: Bearer <token>

Tokens are issued per service and scoped to specific device groups. A missing or invalid token returns 401 Unauthorized.

Endpoints

POST /v1/send Send a notification to a single device

Delivers a push notification to a single device token. Supports both APNs (iOS) and FCM (Android) transports — the gateway routes automatically based on the token format.

Request body

JSON
{
  "token":   "device_push_token",
  "title":   "Notification title",
  "body":    "Notification body text",
  "data":    { "key": "value" },
  "ttl":     3600
}

Response

200 OK
{
  "id":     "msg_01HZ3K9X4P",
  "status": "delivered"
}
GET /v1/status Service health and delivery stats

Returns the current service status and aggregated delivery metrics for the last 60 seconds.

200 OK
{
  "status":     "ok",
  "apns":       "connected",
  "fcm":        "connected",
  "delivered":  14823,
  "failed":     12,
  "uptime_s":   86400
}
POST /v1/batch Send notifications to multiple devices

Sends the same notification payload to up to 1 000 device tokens in a single request. Tokens from different platforms can be mixed in one batch.

JSON
{
  "tokens":  ["token_a", "token_b", "..."],
  "title":   "Broadcast title",
  "body":    "Broadcast body",
  "data":    {}
}
200 OK
{
  "sent":    2,
  "failed":  0,
  "results": [
    { "token": "token_a", "status": "delivered" },
    { "token": "token_b", "status": "delivered" }
  ]
}

Error codes

HTTPCodeDescription
400invalid_payloadMalformed JSON or missing required field
401unauthorizedMissing or invalid Bearer token
404device_not_foundToken is not registered or has expired
429rate_limitedToo many requests — see rate limits
503upstream_unavailableAPNs or FCM connection is down

Rate limits

Limits apply per token, per minute:

  • POST /v1/send — 600 req / min
  • POST /v1/batch — 60 req / min, max 1 000 tokens per request
  • GET /v1/status — 120 req / min

Exceeded limits return 429 with a Retry-After header.

Changelog

v1.4.2 2025-11-03

Fixed APNs certificate rotation under high load.

v1.4.0 2025-09-18

Added POST /v1/batch endpoint. Increased batch limit to 1 000 tokens.

v1.3.5 2025-07-02

FCM v1 API migration. Legacy FCM tokens are automatically converted.