curl --request POST \
--url https://api.assembly.com/v1/installs/{installId}/notification-settings \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"notifications": [
{
"label": "Invoice paid",
"surfaces": [
"product",
"email"
],
"default": {
"email": false,
"product": true
},
"id": "invoice-paid"
}
],
"actionLabel": {
"pluralNoun": "invoices",
"singularNoun": "invoice",
"verb": "review"
}
}
'import requests
url = "https://api.assembly.com/v1/installs/{installId}/notification-settings"
payload = {
"notifications": [
{
"label": "Invoice paid",
"surfaces": ["product", "email"],
"default": {
"email": False,
"product": True
},
"id": "invoice-paid"
}
],
"actionLabel": {
"pluralNoun": "invoices",
"singularNoun": "invoice",
"verb": "review"
}
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
notifications: [
{
label: 'Invoice paid',
surfaces: ['product', 'email'],
default: {email: false, product: true},
id: 'invoice-paid'
}
],
actionLabel: {pluralNoun: 'invoices', singularNoun: 'invoice', verb: 'review'}
})
};
fetch('https://api.assembly.com/v1/installs/{installId}/notification-settings', 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.assembly.com/v1/installs/{installId}/notification-settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'notifications' => [
[
'label' => 'Invoice paid',
'surfaces' => [
'product',
'email'
],
'default' => [
'email' => false,
'product' => true
],
'id' => 'invoice-paid'
]
],
'actionLabel' => [
'pluralNoun' => 'invoices',
'singularNoun' => 'invoice',
'verb' => 'review'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.assembly.com/v1/installs/{installId}/notification-settings"
payload := strings.NewReader("{\n \"notifications\": [\n {\n \"label\": \"Invoice paid\",\n \"surfaces\": [\n \"product\",\n \"email\"\n ],\n \"default\": {\n \"email\": false,\n \"product\": true\n },\n \"id\": \"invoice-paid\"\n }\n ],\n \"actionLabel\": {\n \"pluralNoun\": \"invoices\",\n \"singularNoun\": \"invoice\",\n \"verb\": \"review\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.post("https://api.assembly.com/v1/installs/{installId}/notification-settings")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"notifications\": [\n {\n \"label\": \"Invoice paid\",\n \"surfaces\": [\n \"product\",\n \"email\"\n ],\n \"default\": {\n \"email\": false,\n \"product\": true\n },\n \"id\": \"invoice-paid\"\n }\n ],\n \"actionLabel\": {\n \"pluralNoun\": \"invoices\",\n \"singularNoun\": \"invoice\",\n \"verb\": \"review\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.assembly.com/v1/installs/{installId}/notification-settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"notifications\": [\n {\n \"label\": \"Invoice paid\",\n \"surfaces\": [\n \"product\",\n \"email\"\n ],\n \"default\": {\n \"email\": false,\n \"product\": true\n },\n \"id\": \"invoice-paid\"\n }\n ],\n \"actionLabel\": {\n \"pluralNoun\": \"invoices\",\n \"singularNoun\": \"invoice\",\n \"verb\": \"review\"\n }\n}"
response = http.request(request)
puts response.read_body{
"actionLabel": {
"pluralNoun": "invoices",
"singularNoun": "invoice",
"verb": "review"
},
"notifications": [
{
"default": {
"email": false,
"product": true
},
"id": "invoice-paid",
"label": "Invoice paid",
"surfaces": [
"product",
"email"
]
}
],
"object": "notificationSettings"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}Create an app install's notification settings
Declares the initial notification settings of the install’s backing app. This endpoint
is create-only: when the app already has notification settings (created here or authored
on the App Setup page) it fails with 409 and the settings must be changed via PATCH.
Setting ids are stable identifiers referenced by notificationSettingId on
POST /v1/notifications and by internal users’ saved preferences; omit a setting’s id to
have one generated. Requests authenticated with an app API key may only manage the
calling app’s own installs — for a published marketplace app this changes the app’s
settings in every workspace it is installed in. Requests authenticated with a regular
API key require workspace admin privileges.
curl --request POST \
--url https://api.assembly.com/v1/installs/{installId}/notification-settings \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"notifications": [
{
"label": "Invoice paid",
"surfaces": [
"product",
"email"
],
"default": {
"email": false,
"product": true
},
"id": "invoice-paid"
}
],
"actionLabel": {
"pluralNoun": "invoices",
"singularNoun": "invoice",
"verb": "review"
}
}
'import requests
url = "https://api.assembly.com/v1/installs/{installId}/notification-settings"
payload = {
"notifications": [
{
"label": "Invoice paid",
"surfaces": ["product", "email"],
"default": {
"email": False,
"product": True
},
"id": "invoice-paid"
}
],
"actionLabel": {
"pluralNoun": "invoices",
"singularNoun": "invoice",
"verb": "review"
}
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
notifications: [
{
label: 'Invoice paid',
surfaces: ['product', 'email'],
default: {email: false, product: true},
id: 'invoice-paid'
}
],
actionLabel: {pluralNoun: 'invoices', singularNoun: 'invoice', verb: 'review'}
})
};
fetch('https://api.assembly.com/v1/installs/{installId}/notification-settings', 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.assembly.com/v1/installs/{installId}/notification-settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'notifications' => [
[
'label' => 'Invoice paid',
'surfaces' => [
'product',
'email'
],
'default' => [
'email' => false,
'product' => true
],
'id' => 'invoice-paid'
]
],
'actionLabel' => [
'pluralNoun' => 'invoices',
'singularNoun' => 'invoice',
'verb' => 'review'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.assembly.com/v1/installs/{installId}/notification-settings"
payload := strings.NewReader("{\n \"notifications\": [\n {\n \"label\": \"Invoice paid\",\n \"surfaces\": [\n \"product\",\n \"email\"\n ],\n \"default\": {\n \"email\": false,\n \"product\": true\n },\n \"id\": \"invoice-paid\"\n }\n ],\n \"actionLabel\": {\n \"pluralNoun\": \"invoices\",\n \"singularNoun\": \"invoice\",\n \"verb\": \"review\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.post("https://api.assembly.com/v1/installs/{installId}/notification-settings")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"notifications\": [\n {\n \"label\": \"Invoice paid\",\n \"surfaces\": [\n \"product\",\n \"email\"\n ],\n \"default\": {\n \"email\": false,\n \"product\": true\n },\n \"id\": \"invoice-paid\"\n }\n ],\n \"actionLabel\": {\n \"pluralNoun\": \"invoices\",\n \"singularNoun\": \"invoice\",\n \"verb\": \"review\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.assembly.com/v1/installs/{installId}/notification-settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"notifications\": [\n {\n \"label\": \"Invoice paid\",\n \"surfaces\": [\n \"product\",\n \"email\"\n ],\n \"default\": {\n \"email\": false,\n \"product\": true\n },\n \"id\": \"invoice-paid\"\n }\n ],\n \"actionLabel\": {\n \"pluralNoun\": \"invoices\",\n \"singularNoun\": \"invoice\",\n \"verb\": \"review\"\n }\n}"
response = http.request(request)
puts response.read_body{
"actionLabel": {
"pluralNoun": "invoices",
"singularNoun": "invoice",
"verb": "review"
},
"notifications": [
{
"default": {
"email": false,
"product": true
},
"id": "invoice-paid",
"label": "Invoice paid",
"surfaces": [
"product",
"email"
]
}
],
"object": "notificationSettings"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}Authorizations
Path Parameters
Unique identifier of the app install
Body
Notification settings to create
Response
OK
ActionLabel is the app's generic "[verb] [count] [noun]" label, present only when declared.
Show child attributes
Show child attributes
Notifications is every notification setting the app exposes for this install. Empty when the
install's backing app declares no settings. A setting's id is the value to pass as
notificationSettingId when creating a notification via POST /v1/notifications. If the
recipient's preferences disable every requested delivery target for a setting, that POST
creates nothing and returns 202.
Show child attributes
Show child attributes
"notificationSettings"