Skip to content
GurtOS

Turn notifications on for this phone

PUT
/push
curl --request PUT \
--url http://127.0.0.1:7700/api/push \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "subscription": { "endpoint": "https://example.com", "keys": { "p256dh": "example", "auth": "example" } }, "key": "example" }'

A paired device only; the box’s own screen gets 403. The app subscribes once with the relay gateway’s VAPID key and gives the box the subscription and a 32-byte key it made for this box. On a new approval the box pushes to the phones that should answer: on Business, the people the request is routed to; otherwise phones paired as the owner. Settings quietHours hold pushes back. The box encrypts each push for the phone (RFC 8291), so the gateway forwards bytes it cannot read.

Media typeapplication/json
object
subscription
required

The result of pushManager.subscribe().toJSON().

object
endpoint
required

An https address.

string format: uri
<= 1024 characters
keys
required
object
p256dh
required

The subscription’s P-256 key

string
auth
required

The 16-byte auth secret

string
key
required

32 random bytes

string

Example generated

{
"subscription": {
"endpoint": "https://example.com",
"keys": {
"p256dh": "example",
"auth": "example"
}
},
"key": "example"
}

Saved.

Media typeapplication/json
object
subscribed
boolean

Example

{
"subscribed": true
}

A field is wrong, with the reason.

Media typeapplication/json
object
error
required

What went wrong

string

Example generated

{
"error": "example"
}

Not a paired phone.

Media typeapplication/json
object
error
required

What went wrong

string

Example generated

{
"error": "example"
}