Create notification
curl --request POST \
--url https://staging.api.us.aptlydone.com/v1/notifications \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"templateKey": "DELEGATION_ISSUED",
"userId": "550e8400-e29b-41d4-a716-446655440000",
"tenantId": "550e8400-e29b-41d4-a716-446655440000",
"entityType": "delegation",
"entityId": "9da9a193-7ce8-4540-8020-d22ad2333960",
"placeholders": {
"delegation_id": "ABC123",
"user_email": "[email protected]"
},
"actionUrl": "https://example.com/delegations/123456",
"payload": {
"delegationName": "Q3 Budget Review",
"priority": "high"
}
}
'import requests
url = "https://staging.api.us.aptlydone.com/v1/notifications"
payload = {
"templateKey": "DELEGATION_ISSUED",
"userId": "550e8400-e29b-41d4-a716-446655440000",
"tenantId": "550e8400-e29b-41d4-a716-446655440000",
"entityType": "delegation",
"entityId": "9da9a193-7ce8-4540-8020-d22ad2333960",
"placeholders": {
"delegation_id": "ABC123",
"user_email": "[email protected]"
},
"actionUrl": "https://example.com/delegations/123456",
"payload": {
"delegationName": "Q3 Budget Review",
"priority": "high"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
templateKey: 'DELEGATION_ISSUED',
userId: '550e8400-e29b-41d4-a716-446655440000',
tenantId: '550e8400-e29b-41d4-a716-446655440000',
entityType: 'delegation',
entityId: '9da9a193-7ce8-4540-8020-d22ad2333960',
placeholders: {delegation_id: 'ABC123', user_email: '[email protected]'},
actionUrl: 'https://example.com/delegations/123456',
payload: {delegationName: 'Q3 Budget Review', priority: 'high'}
})
};
fetch('https://staging.api.us.aptlydone.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://staging.api.us.aptlydone.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([
'templateKey' => 'DELEGATION_ISSUED',
'userId' => '550e8400-e29b-41d4-a716-446655440000',
'tenantId' => '550e8400-e29b-41d4-a716-446655440000',
'entityType' => 'delegation',
'entityId' => '9da9a193-7ce8-4540-8020-d22ad2333960',
'placeholders' => [
'delegation_id' => 'ABC123',
'user_email' => '[email protected]'
],
'actionUrl' => 'https://example.com/delegations/123456',
'payload' => [
'delegationName' => 'Q3 Budget Review',
'priority' => 'high'
]
]),
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://staging.api.us.aptlydone.com/v1/notifications"
payload := strings.NewReader("{\n \"templateKey\": \"DELEGATION_ISSUED\",\n \"userId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"tenantId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"entityType\": \"delegation\",\n \"entityId\": \"9da9a193-7ce8-4540-8020-d22ad2333960\",\n \"placeholders\": {\n \"delegation_id\": \"ABC123\",\n \"user_email\": \"[email protected]\"\n },\n \"actionUrl\": \"https://example.com/delegations/123456\",\n \"payload\": {\n \"delegationName\": \"Q3 Budget Review\",\n \"priority\": \"high\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://staging.api.us.aptlydone.com/v1/notifications")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"templateKey\": \"DELEGATION_ISSUED\",\n \"userId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"tenantId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"entityType\": \"delegation\",\n \"entityId\": \"9da9a193-7ce8-4540-8020-d22ad2333960\",\n \"placeholders\": {\n \"delegation_id\": \"ABC123\",\n \"user_email\": \"[email protected]\"\n },\n \"actionUrl\": \"https://example.com/delegations/123456\",\n \"payload\": {\n \"delegationName\": \"Q3 Budget Review\",\n \"priority\": \"high\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.us.aptlydone.com/v1/notifications")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"templateKey\": \"DELEGATION_ISSUED\",\n \"userId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"tenantId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"entityType\": \"delegation\",\n \"entityId\": \"9da9a193-7ce8-4540-8020-d22ad2333960\",\n \"placeholders\": {\n \"delegation_id\": \"ABC123\",\n \"user_email\": \"[email protected]\"\n },\n \"actionUrl\": \"https://example.com/delegations/123456\",\n \"payload\": {\n \"delegationName\": \"Q3 Budget Review\",\n \"priority\": \"high\"\n }\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"timestamp": "2026-01-12T09:08:08.140Z",
"message": "Success",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440002",
"tenantId": "123e4567-e89b-12d3-a456-426614174000",
"templateKey": "DELEGATION_ISSUED",
"category": "Delegations",
"title": "Delegation Issued",
"message": "Delegation ABC123 was issued to you. Click to review.",
"isActionable": true,
"status": "UNREAD",
"createdAt": "2023-01-01T12:00:00Z",
"userId": "550e8400-e29b-41d4-a716-446655440000",
"entityType": "delegation",
"entityId": "123456",
"relativeTime": "2 hours ago",
"readAt": "2023-01-02T14:30:00Z",
"actionUrl": "https://example.com/delegations/123456",
"payload": {
"assignedBy": "John Doe",
"priority": "high"
}
}
}Notifications
Create notification
POST
/
v1
/
notifications
Create notification
curl --request POST \
--url https://staging.api.us.aptlydone.com/v1/notifications \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"templateKey": "DELEGATION_ISSUED",
"userId": "550e8400-e29b-41d4-a716-446655440000",
"tenantId": "550e8400-e29b-41d4-a716-446655440000",
"entityType": "delegation",
"entityId": "9da9a193-7ce8-4540-8020-d22ad2333960",
"placeholders": {
"delegation_id": "ABC123",
"user_email": "[email protected]"
},
"actionUrl": "https://example.com/delegations/123456",
"payload": {
"delegationName": "Q3 Budget Review",
"priority": "high"
}
}
'import requests
url = "https://staging.api.us.aptlydone.com/v1/notifications"
payload = {
"templateKey": "DELEGATION_ISSUED",
"userId": "550e8400-e29b-41d4-a716-446655440000",
"tenantId": "550e8400-e29b-41d4-a716-446655440000",
"entityType": "delegation",
"entityId": "9da9a193-7ce8-4540-8020-d22ad2333960",
"placeholders": {
"delegation_id": "ABC123",
"user_email": "[email protected]"
},
"actionUrl": "https://example.com/delegations/123456",
"payload": {
"delegationName": "Q3 Budget Review",
"priority": "high"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
templateKey: 'DELEGATION_ISSUED',
userId: '550e8400-e29b-41d4-a716-446655440000',
tenantId: '550e8400-e29b-41d4-a716-446655440000',
entityType: 'delegation',
entityId: '9da9a193-7ce8-4540-8020-d22ad2333960',
placeholders: {delegation_id: 'ABC123', user_email: '[email protected]'},
actionUrl: 'https://example.com/delegations/123456',
payload: {delegationName: 'Q3 Budget Review', priority: 'high'}
})
};
fetch('https://staging.api.us.aptlydone.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://staging.api.us.aptlydone.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([
'templateKey' => 'DELEGATION_ISSUED',
'userId' => '550e8400-e29b-41d4-a716-446655440000',
'tenantId' => '550e8400-e29b-41d4-a716-446655440000',
'entityType' => 'delegation',
'entityId' => '9da9a193-7ce8-4540-8020-d22ad2333960',
'placeholders' => [
'delegation_id' => 'ABC123',
'user_email' => '[email protected]'
],
'actionUrl' => 'https://example.com/delegations/123456',
'payload' => [
'delegationName' => 'Q3 Budget Review',
'priority' => 'high'
]
]),
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://staging.api.us.aptlydone.com/v1/notifications"
payload := strings.NewReader("{\n \"templateKey\": \"DELEGATION_ISSUED\",\n \"userId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"tenantId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"entityType\": \"delegation\",\n \"entityId\": \"9da9a193-7ce8-4540-8020-d22ad2333960\",\n \"placeholders\": {\n \"delegation_id\": \"ABC123\",\n \"user_email\": \"[email protected]\"\n },\n \"actionUrl\": \"https://example.com/delegations/123456\",\n \"payload\": {\n \"delegationName\": \"Q3 Budget Review\",\n \"priority\": \"high\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://staging.api.us.aptlydone.com/v1/notifications")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"templateKey\": \"DELEGATION_ISSUED\",\n \"userId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"tenantId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"entityType\": \"delegation\",\n \"entityId\": \"9da9a193-7ce8-4540-8020-d22ad2333960\",\n \"placeholders\": {\n \"delegation_id\": \"ABC123\",\n \"user_email\": \"[email protected]\"\n },\n \"actionUrl\": \"https://example.com/delegations/123456\",\n \"payload\": {\n \"delegationName\": \"Q3 Budget Review\",\n \"priority\": \"high\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.us.aptlydone.com/v1/notifications")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"templateKey\": \"DELEGATION_ISSUED\",\n \"userId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"tenantId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"entityType\": \"delegation\",\n \"entityId\": \"9da9a193-7ce8-4540-8020-d22ad2333960\",\n \"placeholders\": {\n \"delegation_id\": \"ABC123\",\n \"user_email\": \"[email protected]\"\n },\n \"actionUrl\": \"https://example.com/delegations/123456\",\n \"payload\": {\n \"delegationName\": \"Q3 Budget Review\",\n \"priority\": \"high\"\n }\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"timestamp": "2026-01-12T09:08:08.140Z",
"message": "Success",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440002",
"tenantId": "123e4567-e89b-12d3-a456-426614174000",
"templateKey": "DELEGATION_ISSUED",
"category": "Delegations",
"title": "Delegation Issued",
"message": "Delegation ABC123 was issued to you. Click to review.",
"isActionable": true,
"status": "UNREAD",
"createdAt": "2023-01-01T12:00:00Z",
"userId": "550e8400-e29b-41d4-a716-446655440000",
"entityType": "delegation",
"entityId": "123456",
"relativeTime": "2 hours ago",
"readAt": "2023-01-02T14:30:00Z",
"actionUrl": "https://example.com/delegations/123456",
"payload": {
"assignedBy": "John Doe",
"priority": "high"
}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The template key for the notification
Example:
"DELEGATION_ISSUED"
The user ID who should receive this notification
Example:
"550e8400-e29b-41d4-a716-446655440000"
The tenant ID of the user who should receive this notification
Example:
"550e8400-e29b-41d4-a716-446655440000"
The type of entity this notification relates to
Example:
"delegation"
The ID of the entity this notification relates to
Example:
"9da9a193-7ce8-4540-8020-d22ad2333960"
Template placeholders to populate in the message
Example:
{
"delegation_id": "ABC123",
"user_email": "[email protected]"
}
Optional URL for action button on the notification
Example:
"https://example.com/delegations/123456"
Optional payload with additional data for the notification
Example:
{
"delegationName": "Q3 Budget Review",
"priority": "high"
}
Response
201 - application/json
The notification has been successfully created
Was this page helpful?
āI