---
title: "Get Web Push Public Key"
method: GET
path: "/v1/web-push/public-key"
tags: ["web-push"]
---

# Get Web Push Public Key

`GET /v1/web-push/public-key`

## Request

- Base URL: `https://api.elaan.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.elaan.io/v1/web-push/public-key`
- Auth: none declared

The VAPID public key a browser needs as `applicationServerKey`.

No path parameter and no role gate: the tenant comes from the verified token
like everywhere else, and a contact token (the subscribing browser) resolves
one just as a tenant token (a backend, or the console) does.

404 when the tenant has no Web Push transport — deliberately not an empty
string, which a caller would hand to `subscribe()` and get an opaque browser
error instead of "this account hasn't enabled browser push".

## Headers

- `authorization` string, nullable

## Response `200`

Successful Response

- WebPushPublicKeyResponse: The tenant's VAPID public key, for a browser about to subscribe. A whole response for one field, because that is the whole question: a browser cannot call `pushManager.subscribe()` without this value as its `applicationServerKey`. Returned to *contact* tokens, which no other read on this aggregate is — every other field here is a credential, and this one is generated in order to be published.
  - `public_key` string, required: The tenant's VAPID application server public key, base64url-encoded — pass it to `pushManager.subscribe({ applicationServerKey })`. Absent as a 404 when the tenant has no Web Push transport, i.e. nobody can subscribe to them yet.

## Other responses

- `404`: This tenant has no Web Push transport configured
- `422`: Validation Error

---

[API](https://skmtc.dev/elaan/apis/elaan-api.md) · [All operations](https://skmtc.dev/elaan/apis/elaan-api/llms.txt) · [OpenAPI document](https://skmtc.dev/elaan/apis/elaan-api/revisions/c96a7e6399aa?raw)
