Skip to content

Beta: these docs are still being updated. The next full update is on 18 November at 8 PM UTC. Docs in beta. Full update 18 Nov, 8 PM UTC.

Hoody.com

This page documents the computer’s Web Push routes for retrieving the VAPID public key, managing browser push subscriptions, and sending a fixed test alert. Use these endpoints when implementing device enrollment or troubleshooting push delivery. These are computer-scoped Kit routes, and access is controlled by the computer’s proxy permission rules.

GET /api/v1/notifications/push/vapid-public-key

Section titled “GET /api/v1/notifications/push/vapid-public-key”

Returns the computer’s VAPID public key. Pass it to a page as applicationServerKey before calling pushManager.subscribe(). The key pair is created on first use and retained. It does not change while subscriptions exist.

This endpoint takes no path, query, or header parameters.

Terminal window
curl --request GET \
--url 'https://{projectId}-{computerId}-n-1.{server}.computers.hoody.com/api/v1/notifications/push/vapid-public-key'
FieldTypeRequiredDescription
successbooleanYesIndicates that the request succeeded.
dataobjectYesContains the public key.
data.publicKeystringYesUncompressed P-256 public key, base64url without padding, 87 characters.
FieldTypeRequiredDescription
detailsstringNoDetailed error message.
errorstringYesError type or category.
codestringNoStable machine-readable error code.
successbooleanYesIndicates that the request failed.
messagestringNoHuman-readable explanation.

Media type: application/json

{
"success": true,
"data": {
"publicKey": "BEl62iUYgUivxIkv69yViEuiBIa-Ib9-SkvMeAtA3LFgDzkrxZJjSgSnfckjBJuBkr3qBUYIHBQFLXYp5Nksh8U"
}
}

GET /api/v1/notifications/push/subscriptions

Section titled “GET /api/v1/notifications/push/subscriptions”

Lists every stored push subscription, oldest first, in one response, with delivery health. The subscription limit, PUSH_MAX_SUBSCRIPTIONS, defaults to 50 and is enforced when a subscription is created. Lowering the limit does not remove stored subscriptions, so the listed count can exceed the current limit.

Browser keys and full endpoint URLs are never returned. The summary instead includes the endpoint host, subscription origin, display selection, and recent delivery health.

This endpoint takes no path, query, or header parameters.

Terminal window
curl --request GET \
--url 'https://{projectId}-{computerId}-n-1.{server}.computers.hoody.com/api/v1/notifications/push/subscriptions'
FieldTypeRequiredDescription
successbooleanYesIndicates that the request succeeded.
dataobjectYesContains the subscription list.
data.countintegerYesNumber of subscriptions listed. This can exceed data.max if the limit was lowered after subscriptions were stored.
data.maxintegerYesConfigured PUSH_MAX_SUBSCRIPTIONS value. The default is 50. Lowering this value does not remove stored subscriptions.
data.subscriptionsarrayYesStored subscription summaries, ordered oldest first.
data.subscriptions[].idstringYesSubscription ID, 22 characters in base64url.
data.subscriptions[].endpointHoststringYesHost of the browser’s push service.
data.subscriptions[].originstringYesOrigin of the page that subscribed. Alert links open on this origin.
data.subscriptions[].displaysstring | arrayYes"all" or the display numbers this device receives.
data.subscriptions[].createdAtintegerYesSubscription creation time in Unix milliseconds.
data.subscriptions[].userAgentstring | nullNoBrowser label supplied when the subscription was registered.
data.subscriptions[].lastSuccessAtinteger | nullNoLast time the push service accepted a message, in Unix milliseconds.
data.subscriptions[].lastFailureAtinteger | nullNoLast failed delivery time, in Unix milliseconds.
data.subscriptions[].lastFailureStatusinteger | nullNoHTTP status of the last failed delivery.
data.subscriptions[].consecutiveFailuresintegerYesFailed deliveries since the last success. A non-zero value places the device in a cooldown that starts at one minute after the last failure, doubles after each further failure, and is capped at one hour. Notifications received during a cooldown are skipped and never replayed, although history retains them. A success ends the cooldown, while a test push ignores it.
FieldTypeRequiredDescription
detailsstringNoDetailed error message.
errorstringYesError type or category.
codestringNoStable machine-readable error code.
successbooleanYesIndicates that the request failed.
messagestringNoHuman-readable explanation.

Media type: application/json

{
"success": true,
"data": {
"count": 1,
"max": 50,
"subscriptions": [
{
"id": "q3F0b2tVc2VyQWdlbnQxMg",
"endpointHost": "fcm.googleapis.com",
"origin": "https://example.com",
"displays": "all",
"createdAt": 1760598000000,
"userAgent": "Mozilla/5.0 (Linux; Android 15) Chrome/141.0",
"lastSuccessAt": 1760598120000,
"consecutiveFailures": 0
}
]
}
}

POST /api/v1/notifications/push/subscriptions

Section titled “POST /api/v1/notifications/push/subscriptions”

Stores a browser push subscription so new notifications can reach that device while the page is closed. Send the fields produced by PushSubscription.toJSON().

Posting an endpoint that is already stored refreshes it and returns the subscription ID with a 200 response. When replacesEndpoint identifies a rotated endpoint, the existing record takes the new endpoint under the same ID and returns 200 with replaced: true. Rotation does not consume another subscription slot, but only an earlier record created from the same origin can be replaced. Otherwise, the route creates a new record and returns 201, unless PUSH_MAX_SUBSCRIPTIONS records are already stored.

Only endpoints belonging to browser push services are accepted. The allowed hosts are configured by PUSH_ALLOWED_ENDPOINT_HOSTS.

NameInTypeRequiredDescription
OriginheaderstringYesSet by the browser. Must be an https origin. A null origin is refused. Alert links open on this origin.
FieldTypeRequiredDescription
endpointstringYesBrowser push service URL. Must be an https URI on a known push service host. Maximum size: 2048 bytes (UTF-8).
keysobjectYesBrowser encryption and authentication keys.
keys.p256dhstringYesBrowser public key represented as an uncompressed P-256 point in base64url.
keys.authstringYesBrowser authentication secret represented as 16 bytes in base64url.
userAgentstringNoLabel shown in the subscription list. Control characters are removed and the value is limited to 200 characters. Default: the User-Agent header.
displaysstring | arrayNoDisplays whose notifications reach this device. Default: "all". The value "*" is also accepted. Use a comma-separated string such as "1,2" or an array of display numbers. Each array entry is a one-to-five-digit string with an optional leading colon or an integer from 0 through 99999. The array must contain 1 to 100 entries. After duplicates are removed, either form selects at most 100 distinct displays.
replacesEndpointstring | nullNoThe earlier endpoint replaced by this subscription. Maximum size: 2048 bytes (UTF-8). The earlier record must have been created from the same origin.
{
"endpoint": "https://fcm.googleapis.com/fcm/send/dXJsLXNhZmUtdG9rZW4",
"keys": {
"p256dh": "BNcRdreALRFXTkOOUHK1EtK2wtaz5Ry4YfYCA_0QTpQtUbVlUls0VJXg7A8u-Ts1XbjhazAkj7I99e8QcYP7DkM",
"auth": "tBHItJI5svbpez7KI4CCXg"
},
"userAgent": "Pixel 9 / Chrome",
"displays": "all"
}
Terminal window
curl --request POST \
--url 'https://{projectId}-{computerId}-n-1.{server}.computers.hoody.com/api/v1/notifications/push/subscriptions' \
--header 'Content-Type: application/json' \
--header 'Origin: https://example.com' \
--data '{
"endpoint": "https://fcm.googleapis.com/fcm/send/dXJsLXNhZmUtdG9rZW4",
"keys": {
"p256dh": "BNcRdreALRFXTkOOUHK1EtK2wtaz5Ry4YfYCA_0QTpQtUbVlUls0VJXg7A8u-Ts1XbjhazAkj7I99e8QcYP7DkM",
"auth": "tBHItJI5svbpez7KI4CCXg"
},
"userAgent": "Pixel 9 / Chrome",
"displays": "all"
}'
FieldTypeRequiredDescription
successbooleanYesIndicates that the request succeeded.
dataobjectYesContains the subscription result.
data.idstringYesSubscription ID.
data.createdbooleanYesIndicates whether a new record was created.
data.replacedbooleanYesIndicates whether the record of replacesEndpoint now holds this endpoint.
FieldTypeRequiredDescription
detailsstringNoDetailed error message.
errorstringYesError type or category.
codestringNoStable machine-readable error code.
successbooleanYesIndicates that the request failed.
messagestringNoHuman-readable explanation.

The endpoint was already stored and refreshed, or an earlier endpoint was replaced.

Media type: application/json

{
"success": true,
"data": {
"id": "q3F0b2tVc2VyQWdlbnQxMg",
"created": false,
"replaced": true
}
}

DELETE /api/v1/notifications/push/subscriptions/{id}

Section titled “DELETE /api/v1/notifications/push/subscriptions/{id}”

Removes one stored subscription. The device receives no more alerts through that subscription until its page subscribes again.

NameInTypeRequiredDescription
idpathstringYesSubscription ID returned by the list operation.
Terminal window
curl --request DELETE \
--url 'https://{projectId}-{computerId}-n-1.{server}.computers.hoody.com/api/v1/notifications/push/subscriptions/q3F0b2tVc2VyQWdlbnQxMg'
FieldTypeRequiredDescription
detailsstringNoDetailed error message.
errorstringYesError type or category.
codestringNoStable machine-readable error code.
successbooleanYesIndicates that the request failed.
messagestringNoHuman-readable explanation.

Media type: none

The subscription was deleted and the response has no body.

Sends a fixed test alert to one subscription or to all subscriptions. The test ignores delivery cooldowns and reports the push services’ responses within 20 seconds.

An accepted result means the push service took the message, not that the device displayed it. If the push service reports that a subscription is gone, the subscription is deleted and counted in removed.

This route uses the RATE_LIMIT_NOTIFY_MAX budget, which defaults to 10 requests per window and is counted separately from POST /notify.

This endpoint takes no path, query, or header parameters.

FieldTypeRequiredDescription
subscriptionIdstring | nullNoSends the test only to this subscription. Omit it or send null to send the test to all subscriptions.
{
"subscriptionId": "q3F0b2tVc2VyQWdlbnQxMg"
}
Terminal window
curl --request POST \
--url 'https://{projectId}-{computerId}-n-1.{server}.computers.hoody.com/api/v1/notifications/push/test' \
--header 'Content-Type: application/json' \
--data '{
"subscriptionId": "q3F0b2tVc2VyQWdlbnQxMg"
}'
FieldTypeRequiredDescription
successbooleanYesIndicates that the test request completed.
dataobjectYesContains the delivery results.
data.acceptedintegerYesMessages accepted by the push service. Acceptance does not confirm that the device displayed the alert.
data.failedintegerYesMessages refused by the push service, retried out, or not sent.
data.removedintegerYesSubscriptions reported as gone by the push service and deleted.
data.pendingintegerYesDeliveries unfinished at the 20-second mark, whether queued, in progress, or retrying. They finish in the background.
FieldTypeRequiredDescription
detailsstringNoDetailed error message.
errorstringYesError type or category.
codestringNoStable machine-readable error code.
successbooleanYesIndicates that the request failed.
messagestringNoHuman-readable explanation.

Media type: application/json

{
"success": true,
"data": {
"accepted": 1,
"failed": 0,
"removed": 0,
"pending": 0
}
}