Get VAPID Public Key
curl --request GET \
--url https://api.sublay.io/api/v6/:projectId/api/v7/push-notifications/vapid-public-keyimport requests
url = "https://api.sublay.io/api/v6/:projectId/api/v7/push-notifications/vapid-public-key"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.sublay.io/api/v6/:projectId/api/v7/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/api/v6/:projectId/api/v7/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",
]);
$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/api/v6/:projectId/api/v7/push-notifications/vapid-public-key"
req, _ := http.NewRequest("GET", url, nil)
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/api/v6/:projectId/api/v7/push-notifications/vapid-public-key")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/api/v6/:projectId/api/v7/push-notifications/vapid-public-key")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
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
/
:projectId
/
api
/
v7
/
push-notifications
/
vapid-public-key
Get VAPID Public Key
curl --request GET \
--url https://api.sublay.io/api/v6/:projectId/api/v7/push-notifications/vapid-public-keyimport requests
url = "https://api.sublay.io/api/v6/:projectId/api/v7/push-notifications/vapid-public-key"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.sublay.io/api/v6/:projectId/api/v7/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/api/v6/:projectId/api/v7/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",
]);
$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/api/v6/:projectId/api/v7/push-notifications/vapid-public-key"
req, _ := http.NewRequest("GET", url, nil)
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/api/v6/:projectId/api/v7/push-notifications/vapid-public-key")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/api/v6/:projectId/api/v7/push-notifications/vapid-public-key")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"publicKey": {}
}Returns the VAPID (Voluntary Application Server Identification) public key for this project. The browser’s
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
{ "error": "...", "code": "database/tables-not-available" }

