Enable browser notifications for my current session and business
PUT
/browser-push/subscription
const url = 'https://example.com/browser-push/subscription';const options = { method: 'PUT', headers: { cookie: '__Host-bottle.session_token=<__Host-bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"endpoint":"example","keys":{"p256dh":"example","auth":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/browser-push/subscription \ --header 'Content-Type: application/json' \ --cookie __Host-bottle.session_token=<__Host-bottle.session_token> \ --data '{ "endpoint": "example", "keys": { "p256dh": "example", "auth": "example" } }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
endpoint
required
string
keys
required
object
p256dh
required
string
auth
required
string
Example generated
{ "endpoint": "example", "keys": { "p256dh": "example", "auth": "example" }}Responses
Section titled “Responses”Registered
Not signed in
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Sessions only; no support impersonation
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Browser subscription limit reached
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Invalid push subscription
Media typeapplication/json
object
error
required
string
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}Browser push is not configured
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}