Drel/Docs/Push API
Reference · official service

Push API Reference

Use the personal push address generated by Drel on your phone as your bearer capability. Send plain text, open exact HTTPS destinations, or route into registered web applications.

Moving from Bark

Drel provides drop-in compatibility for Bark client requests. Read the Bark compatibility and migration guide or the 中文迁移指南 before adapting existing CI or automation scripts.

How a push reaches the phone

One HTTP request, and the relay handles the rest. Nothing in the chain needs an SDK on your side.

Push delivery sequence: your script sends an HTTP request to the relay; the relay looks up the device token and signs a provider JWT; APNs delivers over HTTP/2; the notification service extension decrypts the envelope and the app records the message in the Inbox.
Two things worth knowing. A 200 from the relay indicates request acceptance; it does not prove that APNs delivered or a person saw the notification. And in encrypted mode the relay only ever carries an opaque envelope plus delivery metadata — never your message content.

Which app version gives you which capability

The push contract is versioned with the app. A field only exists once the receiving app ships the version that supports it.

Drel appContainerOfflineNative actionsPush fields
1.4.xcontainerVersion: 1offlinePackageVersion: 1—Bark-compatible paths, url, mode, appId + route
1.5.xcontainerVersion: 1offlinePackageVersion: 1Manifest v2; seven initial actions, sensors from 1.5.0 build 130; audioLevel in 1.5.2 TestFlightAdds display, statePath, actionState, requestId
Check at runtime, not at build time. Read window.DrelRuntime and feature-detect each field. A newer server may accept a field an older installed app cannot render.

Endpoints

中文快速入门、版本表和 Schema 下载

Form Endpoint When to use it
Bark-compatible pathGET /<key>/<title>/<body>Simple shell scripts and curl with scalar query parameters.
Bark-compatible POSTPOST /<key>Form or JSON request bodies while keeping the device key in the path.
Structured JSONPOST /pushUse for structured parameters, including params, rich content, and app routes.
curl "https://api.drel.app/YOUR_KEY/Build%20complete/Open%20the%20report" -G \
  --data-urlencode "url=https://tools.example/release/42" \
  --data-urlencode "mode=immersive"
curl https://api.drel.app/push -H 'content-type: application/json' -d '{
  "deviceKey": "YOUR_KEY",
  "title": "Build complete",
  "body": "Open the report",
  "url": "https://tools.example/release/42",
  "mode": "immersive",
  "params": { "build": "42" }
}'

What a push address looks like

Every Drel installation has one personal push address. It is a URL that contains the device key, and it works against the official relay and any self-hosted relay that speaks the same contract.

AddressUsed againstWhat to send
https://api.drel.app/<key> The official relay Append the title and body as path segments, and any field as a query parameter.
https://push.example.com/<key> Your own relay Exactly the same shape. The address already names the server, so the request goes straight there.

The two forms are interchangeable — the official Swift relay and the self-hosted Go relay both accept the same path shape, so a script can be pointed at either without changing its form.

A push address is a secret. Anyone holding it can alert that phone. Keep it out of source control, screenshots, and public URLs — and reset it from Drel if it ever leaks.

Calling a self-hosted relay from a browser

A script can call any relay without trouble. A web page is different: the browser enforces cross-origin rules, so the relay has to allow the page's origin.

The Swift relay reads an allowlist from CORS_ALLOWED_ORIGINS (comma-separated). Add the origin of the page that calls it — for example https://drel.app:

CORS_ALLOWED_ORIGINS=https://drel.app,https://your-app.example

If the allowlist does not cover the caller, the browser blocks the request before it leaves the page. Use the generated curl command instead — it has no such restriction.

Send a test push now

Paste the push address copied from Drel, pick what to send, and try it. The official address and a self-hosted address have the same shape, so the same box covers both — the request leaves your browser and goes straight to the server in that address, and nothing is stored on this page.

Field reference

Every field below is labelled with where it comes from, so you know which ones you may safely rely on.

Identity and content

deviceKey
Drel
The personal push address generated on your phone. It is a bearer capability: anyone holding it can alert that phone. In the Bark path form the key is the first path segment instead.
title
Bark / APNs
Notification title. Required for normal direct messages.
body
Bark / APNs
Notification body text. Required for normal direct messages.
subtitle
Bark / APNs
Secondary line shown under the title. Optional.
category
APNs
Icon and label grouping: otp, chat, approval, task, security.
contentType
Drel
How the Inbox renders the message: plain, markdown, image, qr, approval, otp, chat.
markdown
Drel
Markdown content for the native detail view. In Bark query form, markdown=1 means the body itself is Markdown.
verificationCode
Drel
Renders a code card with a copy action. Pair it with contentType: "otp" and expiresAt.
qrPayload
Drel
The host generates the QR code from this payload. No remote image is required.

Destination and routing

url
Bark
An exact HTTPS destination opened after the user taps. The query string is preserved. It does not carry credentials and is never treated as authorization.
appId
Drel
The registered web app to open. The app must exist in the trusted manifest of the gateway the phone trusts. appid is accepted as a compatibility alias.
route
Drel
The screen inside the app. It must be listed in the signed manifest's routes; anything else is rejected.
params
Drel
Key/value data handed to the target page. Use the JSON endpoint when the values are nested. Navigation data only — never authority.
statePath
Drel
A path the target app should query for the current task state. The host never substitutes business credentials for the app's own approval flow.

Presentation

display
Drel
How the destination opens: sheet, full, inline. The native build supports sheet and full; inline currently falls back to sheet.
mode
Bark compat
Legacy alias: normal, modal, immersive. full and fullscreen map to immersive. Prefer display for new integrations.
image, icon
Bark / APNs
HTTPS media or sender image. An icon never replaces Drel’s own iOS App Icon.

Sound, grouping, and lifecycle

sound
APNs
Named notification sound. iOS notification settings and system policy remain authoritative — a named sound can still be suppressed by the user’s settings.
badge
APNs
The numeric badge on the Drel icon.
group, threadId
APNs
Inbox grouping and the APNs notification thread. Grouping identical notifications requires the same group and thread.
level
APNs
APNs delivery level: passive, active, timeSensitive, critical. Critical alerts require a special entitlement and are not generally available.
id, revision, delete
Drel
Update or withdraw a message. revision is monotonic — the client ignores older states. delete: true withdraws the message with the same id.
expiresAt, ttl
Drel
Absolute expiry or a relative number of seconds.
actionState
Drel
Approval task state: pending, approved, rejected, cancelled, expired. Only pending enters the pending list.
requestId
Drel
A shared identifier between the notification and the app’s own business request, so the page can correlate them.
copy, autoCopy, isArchive
Bark compat
Inbox behaviors. Use them only where the result is clear to the user; never use a push to perform a sensitive change.

Fields outside this reference may exist for internal or experimental compatibility. Do not build production integrations around undocumented fields.

Responses, retries, and delivery

A successful direct request returns a JSON response: {"code":200,"attempted":1,"accepted":1,"expired":0,"message":"…"}. Errors return {"error":{"message":"…"}}.

Accepted is not displayed. A 200 response means the Drel relay accepted the request and forwarded it to Apple APNs. A phone may be offline, disabled for notifications, or subject to iOS Focus mode.

Key rotation and privacy

Reset your push address from Drel Settings if it ever leaks. The official delivery service processes requests to deliver them and is not an end-to-end secret channel. See Privacy Policy.