Notifications
Send push notifications to the Oblien mobile app from inside a workspace. Each workspace is a channel: you mint a send token for it, then code running in the workspace pushes notifications to the channel's subscribers.
inside a workspace ──(send token)──▶ Oblien ──▶ deviceThe send token is the only credential you handle. It's scoped to one workspace, Oblien-controlled, and resolves to the right devices server-side — you never touch device tokens.
Create a send token
Mint a virtual send token for a workspace you own.
POST /notifications/tokens
Content-Type: application/json
{ "workspace_id": "ws_123", "name": "agent-channel", "metadata": { "channel": "builds" } }| Parameter | Type | Required | Description |
|---|---|---|---|
workspace_id | string | Yes | Workspace this token sends for (must be owned by you) |
name | string | No | Label (≤120 chars) |
metadata | object | No | Arbitrary metadata — e.g. a channel label |
Response
{
"success": true,
"token": {
"id": 1,
"workspace_id": "ws_123",
"name": "agent-channel",
"metadata": { "channel": "builds" },
"token_prefix": "onp_ab12cd34",
"status": "active",
"token": "onp_ab12cd34…"
}
}The plaintext token is returned once, at creation — it's stored only as a hash and cannot be retrieved later. Capture it now.
List / revoke / delete tokens
GET /notifications/tokens?workspace_id=ws_123
POST /notifications/tokens/:id/revoke # soft — keeps the record, stops routing
DELETE /notifications/tokens/:id # permanentSend a notification
Authenticated by the send token itself — call it from inside the workspace.
POST /notifications/send
Authorization: Bearer <send-token>
Content-Type: application/json
{ "title": "Build finished", "body": "Your agent completed the task", "data": { "run_id": "abc" } }curl -X POST "https://api.oblien.com/notifications/send" \
-H "Authorization: Bearer $SEND_TOKEN" \
-H "Content-Type: application/json" \
-d '{"title":"Build finished","body":"Your agent completed the task"}'At least one of title / body is required. The notification is delivered to the channel's subscribed devices; workspace_id and channel are merged into the data payload.
Response
{ "success": true, "delivered": 1, "failed": 0, "devices": 1 }Send is rate-limited per workspace. A revoked token returns 401. Devices are managed by the Oblien app — registration and delivery health are handled for you.