Get VAPID Public Key
curl --request GET \
--url https://api.sublay.io/v7/:projectId/push-notifications/vapid-public-key \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v7/:projectId/push-notifications/vapid-public-key"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v7/:projectId/push-notifications/vapid-public-key', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sublay.io/v7/:projectId/push-notifications/vapid-public-key",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/v7/:projectId/push-notifications/vapid-public-key"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sublay.io/v7/:projectId/push-notifications/vapid-public-key")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v7/:projectId/push-notifications/vapid-public-key")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"publicKey": {}
}Push Notification Endpoints
Get VAPID Public Key
Retrieve the project’s VAPID public key for Web Push subscriptions
Get VAPID Public Key
curl --request GET \
--url https://api.sublay.io/v7/:projectId/push-notifications/vapid-public-key \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v7/:projectId/push-notifications/vapid-public-key"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v7/:projectId/push-notifications/vapid-public-key', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sublay.io/v7/:projectId/push-notifications/vapid-public-key",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/v7/:projectId/push-notifications/vapid-public-key"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sublay.io/v7/:projectId/push-notifications/vapid-public-key")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v7/:projectId/push-notifications/vapid-public-key")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"publicKey": {}
}Returns the VAPID (Voluntary Application Server Identification) public key for this project. The browser’s
Returned while the
Rate limit: 50 requests per 5 minutes per IP. Exceeding it returns
PushManager.subscribe() requires this key as applicationServerKey when creating a Web Push subscription.
This endpoint is intentionally unauthenticated — a VAPID public key is not a secret (only the matching private key, which is never returned by any endpoint, provides security). The webPushTokenAdapter calls this automatically before the user has signed in, which is a common browser pattern.
Returns { publicKey: null } if the web-push provider has not been configured for the project.
Requires the push bundle.
Response
string | null
The Base64url-encoded VAPID public key, or
null if Web Push is not configured.{ "publicKey": "BGE1YqnfxcY...Bm7uB4" }
Error Responses
Bundle Not Installed — 403
Bundle Not Installed — 403
{
"code": "database/tables-not-available",
"missingTables": ["PushProviderConfigs", "PushDevices", "NotificationPreferences"],
"dashboardUrl": "https://…/<projectId>/database"
}
Bundle Provisioning — 503
Bundle Provisioning — 503
{
"code": "database/tables-provisioning",
"missingTables": ["PushProviderConfigs", "PushDevices", "NotificationPreferences"],
"bundleId": "push"
}
push bundle is mid-install. Retry shortly.Server Error — 500
Server Error — 500
{ "error": "Internal server error.", "code": "push-vapid-key/server-error" }
429 with a plain-text message and no code.

