Count of new notifications grouped

Count of New Notifications Grouped

The GET /api/notifications/new endpoint returns a summary of new (unread) notifications for the currently authenticated user, grouped by notification category. Instead of returning full notification details, it delivers a lightweight count per group so the calling application can efficiently display badge counts or category indicators. This is useful for dashboards and navigation bars that need to signal pending items without loading full notification payloads.

Endpoint

GET /api/notifications/new

Authentication

Bearer token required. Obtain via:

POST https://api.banking.netevia.dev/api/auth/v2

Include in header: Authorization: Bearer {token}
Token lifetime: 10 minutes. Refresh via POST /api/auth/refresh.

When to use

Call this endpoint when rendering a notification badge or summary panel in the partner application. It provides a quick overview of how many new items are waiting in each category — such as general notifications, messages, campaigns, and cardholder agreement notices — without the overhead of fetching every notification record. Poll this endpoint periodically or after key events (e.g., after a transaction completes) to keep badge counts current.

Response

200 OK

Returns an array of objects, each representing one notification group and its unread count.

FieldTypeDescription
groupstring (enum)Notification group type. One of: Notifications, Messages, Campaigns, CardholderAgreement
countinteger (int32)Number of new (unread) notifications in this group
[
  {
    "group": "Notifications",
    "count": 5
  },
  {
    "group": "Messages",
    "count": 2
  },
  {
    "group": "Campaigns",
    "count": 0
  },
  {
    "group": "CardholderAgreement",
    "count": 1
  }
]

Notification Group Types

GroupDescription
NotificationsGeneral account and transaction alerts (e.g., payment received, low balance)
MessagesDirect communications from support or system notices
CampaignsPromotional or informational messages from Netevia or the partner
CardholderAgreementPending cardholder agreements or policy updates requiring acknowledgment

Error Codes

CodeWhen it happens
401Token missing, expired, or invalid
403Insufficient permissions to access notification data
500Internal server error

Common Mistakes

  • Not refreshing the Bearer token before calling this endpoint — tokens expire after 10 minutes and the request will return 401.
  • Treating a missing group in the response as an error — if a group has zero new notifications, it may be omitted from the array entirely; handle absent groups as a count of zero.
  • Expecting full notification content in the response — this endpoint returns counts only; use the full notifications list endpoint to retrieve notification details.

Related Endpoints

  • GET /api/notifications — Retrieve the full list of notifications with details
  • POST /api/notifications/{id}/read — Mark a specific notification as read
  • POST /api/auth/v2 — Obtain a Bearer token for authentication
  • POST /api/auth/refresh — Refresh an existing Bearer token

Example

curl -X GET https://api.banking.netevia.dev/api/notifications/new \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"
Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Response

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
text/plain
application/json
text/json