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.
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 app | Container | Offline | Native actions | Push fields |
|---|---|---|---|---|
| 1.4.x | containerVersion: 1 | offlinePackageVersion: 1 | — | Bark-compatible paths, url, mode, appId + route |
| 1.5.x | containerVersion: 1 | offlinePackageVersion: 1 | Manifest v2; seven initial actions, sensors from 1.5.0 build 130; audioLevel in 1.5.2 TestFlight | Adds display, statePath, actionState, requestId |
window.DrelRuntime and feature-detect each field. A newer server may accept a field an older installed app cannot render.
Endpoints
| Form | Endpoint | When to use it |
|---|---|---|
| Bark-compatible path | GET /<key>/<title>/<body> | Simple shell scripts and curl with scalar query parameters. |
| Bark-compatible POST | POST /<key> | Form or JSON request bodies while keeping the device key in the path. |
| Structured JSON | POST /push | Use 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.
| Address | Used against | What 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.
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
deviceKeyDrel
titleBark / APNs
bodyBark / APNs
subtitleBark / APNs
categoryAPNs
otp, chat, approval, task, security.contentTypeDrel
plain, markdown, image, qr, approval, otp, chat.markdownDrel
markdown=1 means the body itself is Markdown.verificationCodeDrel
contentType: "otp" and expiresAt.qrPayloadDrel
Destination and routing
urlBark
appIdDrel
appid is accepted as a compatibility alias.routeDrel
routes; anything else is rejected.paramsDrel
statePathDrel
Presentation
displayDrel
sheet, full, inline. The native build supports sheet and full; inline currently falls back to sheet.modeBark compat
normal, modal, immersive. full and fullscreen map to immersive. Prefer display for new integrations.image, iconBark / APNs
Sound, grouping, and lifecycle
soundAPNs
badgeAPNs
group, threadIdAPNs
levelAPNs
passive, active, timeSensitive, critical. Critical alerts require a special entitlement and are not generally available.id, revision, deleteDrel
revision is monotonic — the client ignores older states. delete: true withdraws the message with the same id.expiresAt, ttlDrel
actionStateDrel
pending, approved, rejected, cancelled, expired. Only pending enters the pending list.requestIdDrel
copy, autoCopy, isArchiveBark compat
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":"…"}}.
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.