Skip to main content

Notifications

1 API call in this section.

Internal Background Worker Wake​

Communications & Feedback / Notifications
POST/notifications

Internal request created by PostgreSQL pg_net after a queue transaction reserves a worker slot. Accepted worker_key values are notification_normal and notification_priority. The database validates the Vault-backed secret, slot number, and one-time wake token before granting a lease. A valid wake returns immediately and the Edge runtime drains work in the background. Duplicate or stale wakes are idempotently accepted with accepted:false and perform no work. This endpoint is not a frontend integration contract. Business clients enqueue only through their owning backend operation.

Headers

ParameterTypeDescription
Content-Typestring

Example: application/json

X-Background-Worker-Secretstring

Vault-backed internal secret. Never expose this value to frontend or mobile clients.

Example: {{background_worker_wake_secret}}

Body parameters

ParameterTypeDescription
request_typestring—
worker_keystring—
slot_numbernumber—
wake_tokenstring—
Staging
Request
curl
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/notifications" \2  --header "Content-Type: application/json" \3  --header "X-Background-Worker-Secret: ${BACKGROUND_WORKER_WAKE_SECRET}" \4  --data-raw '{5  "request_type": "background_worker_wake",6  "worker_key": "notification_normal",7  "slot_number": 1,8  "wake_token": "{{notification_worker_wake_token}}"9}'

Replace {{placeholders}} with your own values before sending.

Internal backend endpoint. Run from a trusted server; keep backend secret keys out of the browser.

Response examples

202Accepted
Response body
json
1{2  "success": true,3  "accepted": true4}