curl --request POST \
--url https://api.assembly.com/v1/notifications \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"deliveryTargets": {},
"senderId": "550e8400-e29b-41d4-a716-446655440000",
"notificationSettingId": "550e8400-e29b-41d4-a716-446655440006",
"recipientClientId": "550e8400-e29b-41d4-a716-446655440001",
"recipientCompanyId": "550e8400-e29b-41d4-a716-446655440003",
"recipientId": "550e8400-e29b-41d4-a716-446655440001",
"recipientInternalUserId": "550e8400-e29b-41d4-a716-446655440004",
"recipientType": "client",
"senderCompanyId": "550e8400-e29b-41d4-a716-446655440003"
}
'import requests
url = "https://api.assembly.com/v1/notifications"
payload = {
"deliveryTargets": {},
"senderId": "550e8400-e29b-41d4-a716-446655440000",
"notificationSettingId": "550e8400-e29b-41d4-a716-446655440006",
"recipientClientId": "550e8400-e29b-41d4-a716-446655440001",
"recipientCompanyId": "550e8400-e29b-41d4-a716-446655440003",
"recipientId": "550e8400-e29b-41d4-a716-446655440001",
"recipientInternalUserId": "550e8400-e29b-41d4-a716-446655440004",
"recipientType": "client",
"senderCompanyId": "550e8400-e29b-41d4-a716-446655440003"
}
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({
deliveryTargets: {},
senderId: '550e8400-e29b-41d4-a716-446655440000',
notificationSettingId: '550e8400-e29b-41d4-a716-446655440006',
recipientClientId: '550e8400-e29b-41d4-a716-446655440001',
recipientCompanyId: '550e8400-e29b-41d4-a716-446655440003',
recipientId: '550e8400-e29b-41d4-a716-446655440001',
recipientInternalUserId: '550e8400-e29b-41d4-a716-446655440004',
recipientType: 'client',
senderCompanyId: '550e8400-e29b-41d4-a716-446655440003'
})
};
fetch('https://api.assembly.com/v1/notifications', 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/notifications",
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([
'deliveryTargets' => [
],
'senderId' => '550e8400-e29b-41d4-a716-446655440000',
'notificationSettingId' => '550e8400-e29b-41d4-a716-446655440006',
'recipientClientId' => '550e8400-e29b-41d4-a716-446655440001',
'recipientCompanyId' => '550e8400-e29b-41d4-a716-446655440003',
'recipientId' => '550e8400-e29b-41d4-a716-446655440001',
'recipientInternalUserId' => '550e8400-e29b-41d4-a716-446655440004',
'recipientType' => 'client',
'senderCompanyId' => '550e8400-e29b-41d4-a716-446655440003'
]),
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/notifications"
payload := strings.NewReader("{\n \"deliveryTargets\": {},\n \"senderId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"notificationSettingId\": \"550e8400-e29b-41d4-a716-446655440006\",\n \"recipientClientId\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"recipientCompanyId\": \"550e8400-e29b-41d4-a716-446655440003\",\n \"recipientId\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"recipientInternalUserId\": \"550e8400-e29b-41d4-a716-446655440004\",\n \"recipientType\": \"client\",\n \"senderCompanyId\": \"550e8400-e29b-41d4-a716-446655440003\"\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/notifications")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"deliveryTargets\": {},\n \"senderId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"notificationSettingId\": \"550e8400-e29b-41d4-a716-446655440006\",\n \"recipientClientId\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"recipientCompanyId\": \"550e8400-e29b-41d4-a716-446655440003\",\n \"recipientId\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"recipientInternalUserId\": \"550e8400-e29b-41d4-a716-446655440004\",\n \"recipientType\": \"client\",\n \"senderCompanyId\": \"550e8400-e29b-41d4-a716-446655440003\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.assembly.com/v1/notifications")
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 \"deliveryTargets\": {},\n \"senderId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"notificationSettingId\": \"550e8400-e29b-41d4-a716-446655440006\",\n \"recipientClientId\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"recipientCompanyId\": \"550e8400-e29b-41d4-a716-446655440003\",\n \"recipientId\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"recipientInternalUserId\": \"550e8400-e29b-41d4-a716-446655440004\",\n \"recipientType\": \"client\",\n \"senderCompanyId\": \"550e8400-e29b-41d4-a716-446655440003\"\n}"
response = http.request(request)
puts response.read_body{
"additionalFields": {
"channelName": "<string>",
"invoiceNumber": "<string>",
"senderName": "<string>"
},
"appId": "550e8400-e29b-41d4-a716-446655440005",
"assetS3Key": "<string>",
"channelId": "<string>",
"companyId": "550e8400-e29b-41d4-a716-446655440003",
"count": 123,
"createdAt": "<string>",
"creatorId": "<string>",
"data": "<string>",
"defaultListIndexPkey": "<string>",
"deliveryTargets": {
"email": {
"header": "You have a new file",
"subject": "New file uploaded",
"title": "New file uploaded",
"body": "A new file was uploaded to your portal.",
"ctaParams": {},
"htmlBody": "<p>A new file was uploaded to your portal.</p>"
},
"inProduct": {
"title": "New file uploaded",
"body": "A new file was uploaded to your portal.",
"ctaParams": {},
"isRead": false
}
},
"event": "file.created",
"fields": {
"channelId": "<string>",
"companyId": "<string>",
"count": 123,
"formId": "<string>",
"groupingEntityType": "<string>",
"itemName": "<string>",
"notificationGroup": "<string>",
"senderID": "<string>",
"senderType": "<string>",
"senderUserId": "<string>"
},
"id": "<string>",
"identityId": "<string>",
"isGroup": true,
"isRead": true,
"object": "<string>",
"previousAttributes": {},
"recipientClientId": "550e8400-e29b-41d4-a716-446655440001",
"recipientCompanyId": "550e8400-e29b-41d4-a716-446655440003",
"recipientId": "550e8400-e29b-41d4-a716-446655440001",
"recipientInternalUserId": "550e8400-e29b-41d4-a716-446655440004",
"recipientType": "USER",
"ref": "<string>",
"reminders": {
"scheduled": [
"<string>"
],
"sent": [
"<string>"
]
},
"resourceId": "550e8400-e29b-41d4-a716-446655440002",
"senderCompanyId": "550e8400-e29b-41d4-a716-446655440003",
"senderId": "550e8400-e29b-41d4-a716-446655440000",
"senderType": "internalUser",
"updatedAt": "<string>"
}{
"message": "notification suppressed by recipient notification settings"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}Create a notification
Creates a notification for a recipient. Requires senderId, a recipient (recipientClientId or recipientInternalUserId), and at least one delivery target. Notifications can only be created from a custom app. No notification is created and the request returns 202 when the client recipient cannot see the app, or when the recipient’s notification settings disable every requested delivery target.
curl --request POST \
--url https://api.assembly.com/v1/notifications \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"deliveryTargets": {},
"senderId": "550e8400-e29b-41d4-a716-446655440000",
"notificationSettingId": "550e8400-e29b-41d4-a716-446655440006",
"recipientClientId": "550e8400-e29b-41d4-a716-446655440001",
"recipientCompanyId": "550e8400-e29b-41d4-a716-446655440003",
"recipientId": "550e8400-e29b-41d4-a716-446655440001",
"recipientInternalUserId": "550e8400-e29b-41d4-a716-446655440004",
"recipientType": "client",
"senderCompanyId": "550e8400-e29b-41d4-a716-446655440003"
}
'import requests
url = "https://api.assembly.com/v1/notifications"
payload = {
"deliveryTargets": {},
"senderId": "550e8400-e29b-41d4-a716-446655440000",
"notificationSettingId": "550e8400-e29b-41d4-a716-446655440006",
"recipientClientId": "550e8400-e29b-41d4-a716-446655440001",
"recipientCompanyId": "550e8400-e29b-41d4-a716-446655440003",
"recipientId": "550e8400-e29b-41d4-a716-446655440001",
"recipientInternalUserId": "550e8400-e29b-41d4-a716-446655440004",
"recipientType": "client",
"senderCompanyId": "550e8400-e29b-41d4-a716-446655440003"
}
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({
deliveryTargets: {},
senderId: '550e8400-e29b-41d4-a716-446655440000',
notificationSettingId: '550e8400-e29b-41d4-a716-446655440006',
recipientClientId: '550e8400-e29b-41d4-a716-446655440001',
recipientCompanyId: '550e8400-e29b-41d4-a716-446655440003',
recipientId: '550e8400-e29b-41d4-a716-446655440001',
recipientInternalUserId: '550e8400-e29b-41d4-a716-446655440004',
recipientType: 'client',
senderCompanyId: '550e8400-e29b-41d4-a716-446655440003'
})
};
fetch('https://api.assembly.com/v1/notifications', 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/notifications",
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([
'deliveryTargets' => [
],
'senderId' => '550e8400-e29b-41d4-a716-446655440000',
'notificationSettingId' => '550e8400-e29b-41d4-a716-446655440006',
'recipientClientId' => '550e8400-e29b-41d4-a716-446655440001',
'recipientCompanyId' => '550e8400-e29b-41d4-a716-446655440003',
'recipientId' => '550e8400-e29b-41d4-a716-446655440001',
'recipientInternalUserId' => '550e8400-e29b-41d4-a716-446655440004',
'recipientType' => 'client',
'senderCompanyId' => '550e8400-e29b-41d4-a716-446655440003'
]),
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/notifications"
payload := strings.NewReader("{\n \"deliveryTargets\": {},\n \"senderId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"notificationSettingId\": \"550e8400-e29b-41d4-a716-446655440006\",\n \"recipientClientId\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"recipientCompanyId\": \"550e8400-e29b-41d4-a716-446655440003\",\n \"recipientId\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"recipientInternalUserId\": \"550e8400-e29b-41d4-a716-446655440004\",\n \"recipientType\": \"client\",\n \"senderCompanyId\": \"550e8400-e29b-41d4-a716-446655440003\"\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/notifications")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"deliveryTargets\": {},\n \"senderId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"notificationSettingId\": \"550e8400-e29b-41d4-a716-446655440006\",\n \"recipientClientId\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"recipientCompanyId\": \"550e8400-e29b-41d4-a716-446655440003\",\n \"recipientId\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"recipientInternalUserId\": \"550e8400-e29b-41d4-a716-446655440004\",\n \"recipientType\": \"client\",\n \"senderCompanyId\": \"550e8400-e29b-41d4-a716-446655440003\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.assembly.com/v1/notifications")
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 \"deliveryTargets\": {},\n \"senderId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"notificationSettingId\": \"550e8400-e29b-41d4-a716-446655440006\",\n \"recipientClientId\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"recipientCompanyId\": \"550e8400-e29b-41d4-a716-446655440003\",\n \"recipientId\": \"550e8400-e29b-41d4-a716-446655440001\",\n \"recipientInternalUserId\": \"550e8400-e29b-41d4-a716-446655440004\",\n \"recipientType\": \"client\",\n \"senderCompanyId\": \"550e8400-e29b-41d4-a716-446655440003\"\n}"
response = http.request(request)
puts response.read_body{
"additionalFields": {
"channelName": "<string>",
"invoiceNumber": "<string>",
"senderName": "<string>"
},
"appId": "550e8400-e29b-41d4-a716-446655440005",
"assetS3Key": "<string>",
"channelId": "<string>",
"companyId": "550e8400-e29b-41d4-a716-446655440003",
"count": 123,
"createdAt": "<string>",
"creatorId": "<string>",
"data": "<string>",
"defaultListIndexPkey": "<string>",
"deliveryTargets": {
"email": {
"header": "You have a new file",
"subject": "New file uploaded",
"title": "New file uploaded",
"body": "A new file was uploaded to your portal.",
"ctaParams": {},
"htmlBody": "<p>A new file was uploaded to your portal.</p>"
},
"inProduct": {
"title": "New file uploaded",
"body": "A new file was uploaded to your portal.",
"ctaParams": {},
"isRead": false
}
},
"event": "file.created",
"fields": {
"channelId": "<string>",
"companyId": "<string>",
"count": 123,
"formId": "<string>",
"groupingEntityType": "<string>",
"itemName": "<string>",
"notificationGroup": "<string>",
"senderID": "<string>",
"senderType": "<string>",
"senderUserId": "<string>"
},
"id": "<string>",
"identityId": "<string>",
"isGroup": true,
"isRead": true,
"object": "<string>",
"previousAttributes": {},
"recipientClientId": "550e8400-e29b-41d4-a716-446655440001",
"recipientCompanyId": "550e8400-e29b-41d4-a716-446655440003",
"recipientId": "550e8400-e29b-41d4-a716-446655440001",
"recipientInternalUserId": "550e8400-e29b-41d4-a716-446655440004",
"recipientType": "USER",
"ref": "<string>",
"reminders": {
"scheduled": [
"<string>"
],
"sent": [
"<string>"
]
},
"resourceId": "550e8400-e29b-41d4-a716-446655440002",
"senderCompanyId": "550e8400-e29b-41d4-a716-446655440003",
"senderId": "550e8400-e29b-41d4-a716-446655440000",
"senderType": "internalUser",
"updatedAt": "<string>"
}{
"message": "notification suppressed by recipient notification settings"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}Body
Notification to create
NotificationSettingId optionally selects one of the app's declared notification settings (see the app's notificationConfig). When provided, delivery on each surface is resolved against the recipient's per-setting preference, falling back to the app's configured default. Optional; when omitted, all requested delivery targets are delivered as-is.
"550e8400-e29b-41d4-a716-446655440006"
Response
OK
Event is the domain event that triggered the notification.
files.created, file.created, contract.signed, contract.requested, formResponse.requested, formResponse.completed, form.created, invoice.paid, invoice.requested, invoice.processing, invoice.paymentFailed, refund.requested, refund.processed, refund.failed, autoChargePayment.requested, customApp.action, internalChat.mentioned, channel.mentioned "file.created"