listNotifications
List your in-app notifications (the bell feed), newest first.
List your in-app notifications (the bell feed), newest first. Optional filters: notificationTypeFilter (one notification type: use an EXACT value from getAvailableNotificationTypes; an unrecognized string is not an error, it just returns an empty feed with total 0), seen (true = only read, false = only unread, omitted = both), and searchTerm. Cursor-paginated: pass the returned canFetchNext as a signal there is another page and re-call with cursor set to the last notification's id (limit defaults to 25, capped at 50). total is the full match count and hasUnread flags any unread in the feed, so nothing is silently truncated. Reads ONLY your own notifications: true for EVERY key including an admin's, because this operation exposes no recipient selector at all. The app does have the admin/Goliath-staff teammate feed (one or more teammates' notifications combined), so if the user asks to see a colleague's bell, point them at the app instead of saying nobody can see it. Each row carries the related-record ids (contactId, dealId, noteId, replyId, taskId, callId) and actionType/actionTargetId for deep-linking.
curl https://server.goliathdata.com/api/v1/call \
-H "Authorization: Bearer $GOLIATH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"operationId": "listNotifications",
"variables": {}
}'import { GoliathClient } from '@goliath-data/sdk'
const goliath = new GoliathClient({
apiKey: process.env.GOLIATH_API_KEY!,
baseUrl: 'https://server.goliathdata.com',
})
const result = await goliath.notifications.listNotifications({})const res = await fetch('https://server.goliathdata.com/api/v1/call', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.GOLIATH_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
operationId: 'listNotifications',
variables: {}
}),
})
const { data, errors } = await res.json()limit is clamped to 50.
Variables
The example sends only what the schema requires. Some operations also need one of several optional variables (one filter or another, say); the description above says which.
Default 25.
Response
What comes back under data: a list shows as one entry, and a value as its type.
{
"data": {
"notificationQuery": {
"paginateUserNotifications": {
"notifications": [
{
"id": "<ID>",
"userId": "<ID>",
"notificationType": "…",
"title": "…",
"content": "…",
"seen": true,
"createdAt": "…",
"actionType": "…",
"actionTargetId": "<ID>",
"contactId": "<ID>",
"dealId": "<ID>",
"noteId": "<ID>",
"replyId": "<ID>",
"taskId": "<ID>",
"callId": "<ID>"
}
],
"total": 0,
"hasUnread": true,
"canFetchNext": true,
"canFetchPrevious": true
}
}
}
}Errors
unknown_variableA variable the operation does not declare. A typo is refused rather than silently dropped.
unauthorizedNo bearer header, or the key is invalid or revoked.
insufficient_scopeThe key lacks the scope the operation requires.
forbiddenA referenced record does not exist, was deleted, or is outside your organization. The gateway cannot tell those apart.
Behaviour
A read. It rejects an Idempotency-Key header with 400 bad_request.