Wrab API
Providers need the Wrab API for two things: fetching the current license token without replacing it by hand, and sending push notifications to their Wrabbit subscribers. This page covers the addresses, authorization, limits and every error code. Push notifications step by step — Push notifications; updating the token with a script — License.
#Basics
- Address:
https://api.wrab.club. Requests and responses are JSON in UTF-8. - Every request carries the
wpk_…API key — in theAuthorization: BearerorX-Wrab-Push-Keyheader. The license token is not passed to the API: it is public and changes with every renewal. - The key is bound to the provider and the subscription domain and does not change when the license is renewed.
- Responses are not cached (
Cache-Control: no-store).
Authorization: Bearer wpk_...
# or
X-Wrab-Push-Key: wpk_...
#API key
The provider dashboard issues the key on the “License” screen for an active license on a domain verified with a TXT record. It is shown once — keep it like a password, on your server, not in the panel and not in the app. Details — API key.
#Endpoints
| Request | What it does | Requires |
|---|---|---|
GET /v1/provider/license | The domain’s current license token — below | A key and an active license |
POST /v1/provider/push/send | Queue a push — Sending | A license with push, a verified domain |
GET /v1/provider/push/messages | The domain’s recent sends: limit 1–200, default 50 | A license with push |
GET /v1/provider/push/messages/{id} | Status and counters of one send | A license with push |
GET /v1/provider/push/stats | How many devices are subscribed, current limits, push_blocked | A license with push |
POST /v1/provider/push/key | Rotate the API key — below | A license with push |
GET /v1/provider/push/remnawave | Settings for automatic pushes from Remnawave webhooks | A license with push |
PUT /v1/provider/push/remnawave | Turn on or change automatic pushes — Webhooks | A license with push |
DELETE /v1/provider/push/remnawave | Turn automatic pushes off | A license with push |
POST /v1/provider/remnawave/webhook/{id} | Webhook receiver: the Remnawave panel calls it, not you. PUT /push/remnawave returns the address | An X-Remnawave-Signature signature |
#Current license token
curl -sS https://api.wrab.club/v1/provider/license \
-H "Authorization: Bearer $WRAB_API_KEY"
{
"dom": "sub.example.com",
"token": "v1.<base64url(payload)>.<base64url(sig)>",
"format": 1,
"kid": "k1",
"features": ["brand", "hide", "routing", "app", "push"],
"issued_at": "2026-11-13T09:00:00Z",
"expires_at": "2027-12-20T09:00:00Z",
"paid_until": "2027-12-13T09:00:00Z",
"header": { "key": "wrab-license", "value": "v1.<base64url(payload)>.<base64url(sig)>" },
"next_check": 86400
}
| Field | Value |
|---|---|
dom | The key’s and license’s domain |
token | The current token: the domain’s unrevoked, unexpired token with the latest paid term |
format | Token format: 1 or 2 — License format |
kid | Signing key label |
features | License features |
issued_at, expires_at | Token issue and end time, RFC 3339 in UTC. The token term is the paid term plus grace days |
paid_until | End of the paid term; may be absent |
header | What to put in the Wrabbit rule: key is the header name, value is the token |
next_check | In how many seconds to ask again: 86400 (a day), and 3600 less than 8 days before expires_at |
This request does not need the push feature — an active license on the key’s domain is enough. Without one the answer is 404 license_not_found: renew the license in the dashboard. A ready-made script for Remnawave — Automatic token updates.
#Push notifications
Who to send to and how, the queue and automatic push texts are in Push notifications; this page lists every field and status. To check the key, license and domain without sending anything, use a request with dry_run: it counts recipients and does not spend the daily limit.
curl -sS https://api.wrab.club/v1/provider/push/send \
-H "Authorization: Bearer $WRAB_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"category": "service", "target": "all", "body": "Test", "dry_run": true}'
{ "dry_run": true, "dom": "sub.example.com", "target_count": 1234 }
A real send answers 202 with message_id, status: "queued", target_count and duplicate: false; a repeat with the same idempotency_key gives 200 and duplicate: true. An unknown field in the body is a 400 invalid_json error: this catches typos like sub_hashes.
#Send fields
| Field | Required | Meaning |
|---|---|---|
category | yes | service — status, billing, maintenance; promo — advertising: the API accepts it, but there are no recipients, since the app has no consent screen |
target | yes | all — every subscriber of the domain; sub — specific subscribers by sub_hash |
hashes | for sub | 1–1000 sub_hash values (64 hex); not sent with all |
body | yes | Up to 300 characters; line breaks are allowed, other control characters are not |
title | no | Up to 80 characters |
localized | no | Texts for the device languages ru and en with the same limits; without a translation — title and body |
url | no | https://… without credentials in the address, or a safe deep link, up to 512 bytes |
collapse_id | no | Up to 64 visible ASCII characters: a new push with the same id replaces the previous one on the device (apns-collapse-id) |
idempotency_key | no | Up to 128 visible ASCII characters, or the Idempotency-Key header; a repeat with the same key returns the earlier send. The rw: prefix is reserved for automatic pushes |
dom | no | If present, must match the license domain |
dry_run | no | true — only count recipients, send nothing |
#Send status and log
GET /v1/provider/push/messages/{id} returns one send, GET /v1/provider/push/messages?limit=50 the latest sends of the domain (from the API, the dashboard and automatic pushes, up to 200). The log is kept for 180 days.
| Field | Values |
|---|---|
status | queued, sending, done (sent), cancelled |
cancel_reason | Only for cancelled: push_blocked — pushes stopped by an administrator; license_inactive — the license is not valid; domain_not_verified — the domain is not verified; domain_transferred — the domain moved to another provider; provider_inactive — the provider account is disabled; expired — it waited in the queue too long; apns_config_error — a sending failure on the Wrabbit side, contact support |
source | api or remnawave (an automatic push from a webhook); automatic pushes also have event |
target_count | How many devices were targeted |
sent_count, failed_count, invalid_count | Delivered to Apple, not delivered, the device no longer accepts pushes |
pending_count | How many are still waiting — only in the single-send response |
created_at, started_at, finished_at | Queued, started and finished time, UTC |
GET /v1/provider/push/stats — devices (devices subscribed to the domain's pushes), devices_promo_opt_in (of them, with advertising consent; always 0 with 2.2.0), subscriptions (distinct subscriptions), limits (daily limits), push_blocked and license_expires_at.
#Rotating the key
curl -sS -X POST https://api.wrab.club/v1/provider/push/key \
-H "Authorization: Bearer $WRAB_API_KEY"
{ "key": "wpk_...", "key_hint": "...", "dom": "sub.example.com" }
The request is signed with the current key. The response holds the new key, shown once. The old key stops working immediately: replace it in every script and bot before the next request.
#Request limits
| Limit | Value |
|---|---|
| Requests per minute from one IP, before the key check (IPv6 — per /64 network) | 120 |
| Requests per minute per license, after the key check | 60 |
| Push sends per day | Separate for service, promo and automatic pushes — Push limits |
Going over gives 429 rate_limited with Retry-After: 60 or 429 daily_limit_exceeded with Retry-After: 3600. Retry no sooner than the given number of seconds.
#Error codes
An error comes with an HTTP status and an error body: a machine-readable code and a message hint, which may be empty. Rely on code.
HTTP/1.1 403 Forbidden
Content-Type: application/json; charset=utf-8
Cache-Control: no-store
{ "error": { "code": "domain_not_verified", "message": "..." } }
| HTTP | code | What it means and what to do |
|---|---|---|
| 401 | push_key_required | No key, or it doesn’t look like wpk_…. Pass the key in Authorization: Bearer or X-Wrab-Push-Key |
| 401 | push_key_invalid | The key was not found or was replaced. Get the current one in the dashboard |
| 401 | license_expired | The license with push on the domain has expired or been revoked. Renew it |
| 403 | feature_required | The domain’s license has no push. Get a new token in the dashboard |
| 403 | provider_inactive | The provider account is disabled. Contact support |
| 403 | domain_not_verified | The domain is not verified with a TXT record or has moved to another provider — Domain verification |
| 403 | domain_mismatch | The dom field of the request does not match the license domain |
| 403 | push_blocked | Push sending was stopped by a Wrabbit administrator: complaints or rule violations. Contact support |
| 404 | license_not_found | GET /license only: the key’s domain has no active license. Renew it in the dashboard |
| HTTP | code | What it means and what to do |
|---|---|---|
| 400 | invalid_json | The body is not JSON, a field has the wrong type, or a field is unknown |
| 400 | invalid_category | category must be service or promo |
| 400 | invalid_target | target must be all or sub; hashes is not passed with all |
| 400 | invalid_hashes | sub needs 1–1000 sub_hash values, each 64 hex characters |
| 400 | invalid_text | Empty body, text too long, or control characters |
| 400 | invalid_localized | Only the ru and en keys are allowed in localized |
| 400 | invalid_url | url must be https://… or a safe wrabbit://…, up to 512 bytes — Links from push notifications |
| 400 | invalid_collapse_id | Up to 64 visible ASCII characters |
| 400 | invalid_idempotency_key | Up to 128 visible ASCII characters, without the rw: prefix |
| 400 | secret_required, invalid_secret | The first webhook setup needs secret — the panel’s WEBHOOK_SECRET_HEADER, 32–256 characters [a-zA-Z0-9] |
| 400 | invalid_events, invalid_name, invalid_templates | An unknown event or an empty list, a name longer than 64 characters, an error in templates — see message |
| 404 | not_found | Your domain has no such send or webhook setting |
| 429 | rate_limited | The per-minute request limit. Wait for Retry-After |
| 429 | daily_limit_exceeded | The daily send limit. Wait for Retry-After |
| 500 | internal | An error on our side. Retry later; if it persists — support |
| 503 | push_disabled, webhooks_disabled | Sending or webhook intake is temporarily off on the Wrabbit side |
Responses of the panel webhook address (200 queued and ignored, 401 bad_signature, 403 license_inactive, 413 body_too_large) are seen not by your script but by Remnawave in its webhook log — their meaning is in Push notifications.