Push
Update Web Push Settings
Turn web push on or off and set the default icon
PUT
/
api
/
v1
/
push
/
settings
/
web
Update Web Push Settings
curl --request PUT \
--url https://api.sequenzy.com/api/v1/push/settings/web \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"defaultIconUrl": {}
}
'import requests
url = "https://api.sequenzy.com/api/v1/push/settings/web"
payload = {
"enabled": True,
"defaultIconUrl": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true, defaultIconUrl: {}})
};
fetch('https://api.sequenzy.com/api/v1/push/settings/web', 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.sequenzy.com/api/v1/push/settings/web",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'defaultIconUrl' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sequenzy.com/api/v1/push/settings/web"
payload := strings.NewReader("{\n \"enabled\": true,\n \"defaultIconUrl\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.sequenzy.com/api/v1/push/settings/web")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"defaultIconUrl\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/push/settings/web")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"defaultIconUrl\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"push": {
"web": {
"enabled": true,
"vapidPublicKey": "BH3tXU0JSzok9ND7DyeQRcEy..."
},
"ios": {
"configured": true,
"keyId": "ABC123DEFG",
"teamId": "DEF123GHIJ",
"bundleId": "com.example.app",
"environment": "production",
"lastError": null,
"lastErrorAt": null
},
"android": {
"configured": false,
"projectId": null,
"clientEmail": null,
"lastError": null,
"lastErrorAt": null
},
"defaultIconUrl": "https://cdn.example.com/icon-192.png"
},
"siteKey": {
"id": "wtk_123",
"name": "Website",
"publicKey": "seq_pk_abc123",
"allowedOrigins": ["https://example.com", "https://www.example.com"],
"installSnippet": "<script>...</script><script async src=\"https://api.sequenzy.com/sequenzy.js\" ...></script>"
},
"siteKeyCreated": true,
"message": "Web push is enabled. Created site key seq_pk_abc123 for https://example.com, https://www.example.com."
}
{
"error": "defaultIconUrl must be an https:// URL."
}
{
"error": "Invalid API key"
}
{
"error": "You have view-only access to this company. Contact the owner to request edit permissions."
}
Update Web Push Settings
Turns web push on or off, or sets the default notification icon. The first time you turn it on, Sequenzy generates your workspace’s VAPID keys. Turning it off keeps the keys, so browsers that already subscribed keep working when you turn it on again. Requires theintegrations:manage scope and edit access to the workspace.
Request
boolean
Turn web push on or off. Provide
enabled, defaultIconUrl, or both.string | null
https icon used when a message has no icon of its own.
null or an empty
string clears it, and web pushes go back to your company logo.enabled is true, the response also includes siteKey: the active
web tracking key web push uses, with its install
snippet. If the workspace has no active key and your company website is set,
one named Website is created for that website and its www or apex twin, and
siteKeyCreated is true. siteKey is null when there is no key and the
website is unknown or not a valid origin. Requests that do not enable web push
omit both fields.
curl -X PUT "https://api.sequenzy.com/api/v1/push/settings/web" \
--header "Authorization: Bearer $SEQUENZY_API_KEY" \
--header "Content-Type: application/json" \
--data '{"enabled": true}'
Responses
{
"success": true,
"push": {
"web": {
"enabled": true,
"vapidPublicKey": "BH3tXU0JSzok9ND7DyeQRcEy..."
},
"ios": {
"configured": true,
"keyId": "ABC123DEFG",
"teamId": "DEF123GHIJ",
"bundleId": "com.example.app",
"environment": "production",
"lastError": null,
"lastErrorAt": null
},
"android": {
"configured": false,
"projectId": null,
"clientEmail": null,
"lastError": null,
"lastErrorAt": null
},
"defaultIconUrl": "https://cdn.example.com/icon-192.png"
},
"siteKey": {
"id": "wtk_123",
"name": "Website",
"publicKey": "seq_pk_abc123",
"allowedOrigins": ["https://example.com", "https://www.example.com"],
"installSnippet": "<script>...</script><script async src=\"https://api.sequenzy.com/sequenzy.js\" ...></script>"
},
"siteKeyCreated": true,
"message": "Web push is enabled. Created site key seq_pk_abc123 for https://example.com, https://www.example.com."
}
{
"error": "defaultIconUrl must be an https:// URL."
}
{
"error": "Invalid API key"
}
{
"error": "You have view-only access to this company. Contact the owner to request edit permissions."
}
⌘I
Update Web Push Settings
curl --request PUT \
--url https://api.sequenzy.com/api/v1/push/settings/web \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"defaultIconUrl": {}
}
'import requests
url = "https://api.sequenzy.com/api/v1/push/settings/web"
payload = {
"enabled": True,
"defaultIconUrl": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true, defaultIconUrl: {}})
};
fetch('https://api.sequenzy.com/api/v1/push/settings/web', 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.sequenzy.com/api/v1/push/settings/web",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'defaultIconUrl' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sequenzy.com/api/v1/push/settings/web"
payload := strings.NewReader("{\n \"enabled\": true,\n \"defaultIconUrl\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.sequenzy.com/api/v1/push/settings/web")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"defaultIconUrl\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/push/settings/web")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"defaultIconUrl\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"push": {
"web": {
"enabled": true,
"vapidPublicKey": "BH3tXU0JSzok9ND7DyeQRcEy..."
},
"ios": {
"configured": true,
"keyId": "ABC123DEFG",
"teamId": "DEF123GHIJ",
"bundleId": "com.example.app",
"environment": "production",
"lastError": null,
"lastErrorAt": null
},
"android": {
"configured": false,
"projectId": null,
"clientEmail": null,
"lastError": null,
"lastErrorAt": null
},
"defaultIconUrl": "https://cdn.example.com/icon-192.png"
},
"siteKey": {
"id": "wtk_123",
"name": "Website",
"publicKey": "seq_pk_abc123",
"allowedOrigins": ["https://example.com", "https://www.example.com"],
"installSnippet": "<script>...</script><script async src=\"https://api.sequenzy.com/sequenzy.js\" ...></script>"
},
"siteKeyCreated": true,
"message": "Web push is enabled. Created site key seq_pk_abc123 for https://example.com, https://www.example.com."
}
{
"error": "defaultIconUrl must be an https:// URL."
}
{
"error": "Invalid API key"
}
{
"error": "You have view-only access to this company. Contact the owner to request edit permissions."
}