API ReferenceCore API
Notifications API
View system and user notifications
Notifications API
View system notifications, user notifications, and client-level alerts.
Notification Types
- System: Platform-wide announcements, maintenance, updates
- User: Personal alerts, invitations, account changes
- Client: Organisation-level notifications, billing, usage alerts, and cadence-based meter alert digests
Notifications are automatically marked as read when fetched individually. Meter alert digests (limit exceeded, predicate match, or usage threshold reached) are delivered as client notifications. See Meters — Alert Policy.
System Notification Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/notifications/system | List system-wide notifications |
| GET | /api/notifications/system/{notificationId} | Get specific system notification |
User Notification Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/users/{userId}/notifications | List your personal notifications |
| GET | /api/users/{userId}/notifications/{notificationId} | Get specific user notification |
Client Notification Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/clients/{clientId}/notifications | List client notifications |
| GET | /api/clients/{clientId}/notifications/{notificationId} | Get specific client notification |
List System Notifications
Get platform-wide system notifications.
Request
GET /api/notifications/system HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}Response
{
"notifications": [
{
"notificationId": "notif_sys_123",
"type": "system",
"title": "Scheduled Maintenance",
"message": "System maintenance scheduled for Sunday at 2 AM UTC",
"read": false,
"createdAt": "2024-01-22T10:00:00.000Z",
"pKey": "SYSTEM_NOTIFICATION",
"sKey": "notif_sys_123"
}
],
"message": "Success"
}Example
const response = await fetch(
'https://api.requestrocket.com/api/notifications/system',
{
headers: {
'Authorization': process.env.USER_TOKEN
}
}
);
const data = await response.json();
console.log('System notifications:', data.notifications);import requests
import os
response = requests.get(
'https://api.requestrocket.com/api/notifications/system',
headers={'Authorization': os.getenv('USER_TOKEN')}
)
data = response.json()
print(f"Found {len(data['notifications'])} system notifications")package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
type Response struct {
Notifications []map[string]interface{} `json:"notifications"`
Message string `json:"message"`
}
func main() {
req, _ := http.NewRequest("GET", "https://api.requestrocket.com/api/notifications/system", nil)
req.Header.Set("Authorization", os.Getenv("USER_TOKEN"))
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var result Response
json.Unmarshal(body, &result)
fmt.Printf("Found %d system notifications\n", len(result.Notifications))
}import java.net.http.*;
import java.net.URI;
import com.google.gson.*;
public class ListSystemNotifications {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.requestrocket.com/api/notifications/system"))
.header("Authorization", System.getenv("USER_TOKEN"))
.GET()
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
JsonObject json = JsonParser.parseString(response.body()).getAsJsonObject();
JsonArray notifications = json.getAsJsonArray("notifications");
System.out.println("Found " + notifications.size() + " system notifications");
}
}curl -X GET "https://api.requestrocket.com/api/notifications/system" \
-H "Authorization: ${USER_TOKEN}"Get System Notification
Get a specific system notification.
Request
GET /api/notifications/system/{notificationId} HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}Response
{
"notifications": [
{
"notificationId": "notif_sys_123",
"type": "system",
"title": "Scheduled Maintenance",
"message": "System maintenance scheduled for Sunday at 2 AM UTC",
"read": true,
"createdAt": "2024-01-22T10:00:00.000Z",
"pKey": "SYSTEM_NOTIFICATION",
"sKey": "notif_sys_123"
}
],
"message": "Success"
}Example
const response = await fetch(
`https://api.requestrocket.com/api/notifications/system/${notificationId}`,
{
headers: {
'Authorization': process.env.USER_TOKEN
}
}
);
const data = await response.json();
console.log('Notification:', data.notifications[0]);import requests
import os
notification_id = "notif_sys_123"
response = requests.get(
f'https://api.requestrocket.com/api/notifications/system/{notification_id}',
headers={'Authorization': os.getenv('USER_TOKEN')}
)
data = response.json()
print(f"Notification: {data['notifications'][0]['title']}")package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
type Response struct {
Notifications []map[string]interface{} `json:"notifications"`
Message string `json:"message"`
}
func main() {
notificationId := "notif_sys_123"
url := fmt.Sprintf("https://api.requestrocket.com/api/notifications/system/%s", notificationId)
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", os.Getenv("USER_TOKEN"))
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var result Response
json.Unmarshal(body, &result)
fmt.Printf("Notification: %v\n", result.Notifications[0])
}import java.net.http.*;
import java.net.URI;
import com.google.gson.*;
public class GetSystemNotification {
public static void main(String[] args) throws Exception {
String notificationId = "notif_sys_123";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.requestrocket.com/api/notifications/system/" + notificationId))
.header("Authorization", System.getenv("USER_TOKEN"))
.GET()
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
JsonObject json = JsonParser.parseString(response.body()).getAsJsonObject();
JsonArray notifications = json.getAsJsonArray("notifications");
System.out.println("Notification: " + notifications.get(0));
}
}curl -X GET "https://api.requestrocket.com/api/notifications/system/${NOTIFICATION_ID}" \
-H "Authorization: ${USER_TOKEN}"List User Notifications
Get your personal notifications.
Request
GET /api/users/{userId}/notifications HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}Response
{
"notifications": [
{
"notificationId": "notif_user_123",
"type": "invitation",
"title": "Invitation to join Example Org",
"message": "You've been invited to join Example Org",
"read": false,
"createdAt": "2024-01-22T10:00:00.000Z",
"pKey": "USER",
"sKey": "notif_user_123"
}
],
"message": "Success"
}Example
const response = await fetch(
`https://api.requestrocket.com/api/users/${userId}/notifications`,
{
headers: {
'Authorization': process.env.USER_TOKEN
}
}
);
const data = await response.json();
console.log('User notifications:', data.notifications);
const unread = data.notifications.filter(n => !n.read);
console.log(`${unread.length} unread notifications`);import requests
import os
user_id = "your-user-id"
response = requests.get(
f'https://api.requestrocket.com/api/users/{user_id}/notifications',
headers={'Authorization': os.getenv('USER_TOKEN')}
)
data = response.json()
unread = [n for n in data['notifications'] if not n['read']]
print(f"Found {len(unread)} unread notifications")package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
type Response struct {
Notifications []map[string]interface{} `json:"notifications"`
Message string `json:"message"`
}
func main() {
userId := "your-user-id"
url := fmt.Sprintf("https://api.requestrocket.com/api/users/%s/notifications", userId)
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", os.Getenv("USER_TOKEN"))
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var result Response
json.Unmarshal(body, &result)
unread := 0
for _, notif := range result.Notifications {
if read, ok := notif["read"].(bool); ok && !read {
unread++
}
}
fmt.Printf("Found %d unread notifications\n", unread)
}import java.net.http.*;
import java.net.URI;
import com.google.gson.*;
public class ListUserNotifications {
public static void main(String[] args) throws Exception {
String userId = "your-user-id";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.requestrocket.com/api/users/" + userId + "/notifications"))
.header("Authorization", System.getenv("USER_TOKEN"))
.GET()
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
JsonObject json = JsonParser.parseString(response.body()).getAsJsonObject();
JsonArray notifications = json.getAsJsonArray("notifications");
int unread = 0;
for (int i = 0; i < notifications.size(); i++) {
JsonObject notif = notifications.get(i).getAsJsonObject();
if (!notif.get("read").getAsBoolean()) {
unread++;
}
}
System.out.println("Found " + unread + " unread notifications");
}
}curl -X GET "https://api.requestrocket.com/api/users/${USER_ID}/notifications" \
-H "Authorization: ${USER_TOKEN}"Get User Notification
Get a specific user notification. This automatically marks it as read.
Request
GET /api/users/{userId}/notifications/{notificationId} HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}Response
{
"notifications": [
{
"notificationId": "notif_user_123",
"type": "invitation",
"title": "Invitation to join Example Org",
"message": "You've been invited to join Example Org",
"read": true,
"createdAt": "2024-01-22T10:00:00.000Z",
"pKey": "USER",
"sKey": "notif_user_123"
}
],
"message": "Success"
}Example
const response = await fetch(
`https://api.requestrocket.com/api/users/${userId}/notifications/${notificationId}`,
{
headers: {
'Authorization': process.env.USER_TOKEN
}
}
);
const data = await response.json();
console.log('Notification:', data.notifications[0]);
console.log('Marked as read:', data.notifications[0].read);import requests
import os
user_id = "your-user-id"
notification_id = "notif_user_123"
response = requests.get(
f'https://api.requestrocket.com/api/users/{user_id}/notifications/{notification_id}',
headers={'Authorization': os.getenv('USER_TOKEN')}
)
data = response.json()
print(f"Notification: {data['notifications'][0]['title']}")
print(f"Read status: {data['notifications'][0]['read']}")package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
type Response struct {
Notifications []map[string]interface{} `json:"notifications"`
Message string `json:"message"`
}
func main() {
userId := "your-user-id"
notificationId := "notif_user_123"
url := fmt.Sprintf("https://api.requestrocket.com/api/users/%s/notifications/%s", userId, notificationId)
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", os.Getenv("USER_TOKEN"))
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var result Response
json.Unmarshal(body, &result)
fmt.Printf("Notification: %v\n", result.Notifications[0])
}import java.net.http.*;
import java.net.URI;
import com.google.gson.*;
public class GetUserNotification {
public static void main(String[] args) throws Exception {
String userId = "your-user-id";
String notificationId = "notif_user_123";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.requestrocket.com/api/users/" + userId + "/notifications/" + notificationId))
.header("Authorization", System.getenv("USER_TOKEN"))
.GET()
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
JsonObject json = JsonParser.parseString(response.body()).getAsJsonObject();
JsonArray notifications = json.getAsJsonArray("notifications");
JsonObject notification = notifications.get(0).getAsJsonObject();
System.out.println("Notification: " + notification.get("title").getAsString());
System.out.println("Read status: " + notification.get("read").getAsBoolean());
}
}curl -X GET "https://api.requestrocket.com/api/users/${USER_ID}/notifications/${NOTIFICATION_ID}" \
-H "Authorization: ${USER_TOKEN}"List Client Notifications
Get notifications for a specific client (organisation).
Request
GET /api/clients/{clientId}/notifications HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}Response
{
"notifications": [
{
"notificationId": "notif_client_123",
"type": "billing",
"title": "Payment Due",
"message": "Your subscription payment is due on January 30",
"read": false,
"createdAt": "2024-01-22T10:00:00.000Z",
"pKey": "550e8400-e29b-41d4-a716-446655440000",
"sKey": "notif_client_123"
}
],
"message": "Success"
}Example
const response = await fetch(
`https://api.requestrocket.com/api/clients/${clientId}/notifications`,
{
headers: {
'Authorization': process.env.USER_TOKEN
}
}
);
const data = await response.json();
console.log('Client notifications:', data.notifications);import requests
import os
client_id = "your-client-id"
response = requests.get(
f'https://api.requestrocket.com/api/clients/{client_id}/notifications',
headers={'Authorization': os.getenv('USER_TOKEN')}
)
data = response.json()
print(f"Found {len(data['notifications'])} client notifications")package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
type Response struct {
Notifications []map[string]interface{} `json:"notifications"`
Message string `json:"message"`
}
func main() {
clientId := "your-client-id"
url := fmt.Sprintf("https://api.requestrocket.com/api/clients/%s/notifications", clientId)
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", os.Getenv("USER_TOKEN"))
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var result Response
json.Unmarshal(body, &result)
fmt.Printf("Found %d client notifications\n", len(result.Notifications))
}import java.net.http.*;
import java.net.URI;
import com.google.gson.*;
public class ListClientNotifications {
public static void main(String[] args) throws Exception {
String clientId = "your-client-id";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.requestrocket.com/api/clients/" + clientId + "/notifications"))
.header("Authorization", System.getenv("USER_TOKEN"))
.GET()
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
JsonObject json = JsonParser.parseString(response.body()).getAsJsonObject();
JsonArray notifications = json.getAsJsonArray("notifications");
System.out.println("Found " + notifications.size() + " client notifications");
}
}curl -X GET "https://api.requestrocket.com/api/clients/${CLIENT_ID}/notifications" \
-H "Authorization: ${USER_TOKEN}"Get Client Notification
Get a specific client notification.
Request
GET /api/clients/{clientId}/notifications/{notificationId} HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}Response
{
"notifications": [
{
"notificationId": "notif_client_123",
"type": "billing",
"title": "Payment Due",
"message": "Your subscription payment is due on January 30",
"read": true,
"createdAt": "2024-01-22T10:00:00.000Z",
"pKey": "550e8400-e29b-41d4-a716-446655440000",
"sKey": "notif_client_123"
}
],
"message": "Success"
}Example
const response = await fetch(
`https://api.requestrocket.com/api/clients/${clientId}/notifications/${notificationId}`,
{
headers: {
'Authorization': process.env.USER_TOKEN
}
}
);
const data = await response.json();
console.log('Notification:', data.notifications[0]);import requests
import os
client_id = "your-client-id"
notification_id = "notif_client_123"
response = requests.get(
f'https://api.requestrocket.com/api/clients/{client_id}/notifications/{notification_id}',
headers={'Authorization': os.getenv('USER_TOKEN')}
)
data = response.json()
print(f"Notification: {data['notifications'][0]['title']}")package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
type Response struct {
Notifications []map[string]interface{} `json:"notifications"`
Message string `json:"message"`
}
func main() {
clientId := "your-client-id"
notificationId := "notif_client_123"
url := fmt.Sprintf("https://api.requestrocket.com/api/clients/%s/notifications/%s", clientId, notificationId)
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", os.Getenv("USER_TOKEN"))
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var result Response
json.Unmarshal(body, &result)
fmt.Printf("Notification: %v\n", result.Notifications[0])
}import java.net.http.*;
import java.net.URI;
import com.google.gson.*;
public class GetClientNotification {
public static void main(String[] args) throws Exception {
String clientId = "your-client-id";
String notificationId = "notif_client_123";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.requestrocket.com/api/clients/" + clientId + "/notifications/" + notificationId))
.header("Authorization", System.getenv("USER_TOKEN"))
.GET()
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
JsonObject json = JsonParser.parseString(response.body()).getAsJsonObject();
JsonArray notifications = json.getAsJsonArray("notifications");
System.out.println("Notification: " + notifications.get(0));
}
}curl -X GET "https://api.requestrocket.com/api/clients/${CLIENT_ID}/notifications/${NOTIFICATION_ID}" \
-H "Authorization: ${USER_TOKEN}"