Notifications

Use this endpoint to manipulate and obtain details on Salesbox’s Notifications.

Base Endpoint

https://segmentai.salesbox.com.br/api/notifications

Get Notification

GET /api/notifications/{id}

Get an individual Notification by ID.

HTTP Request

GET /api/notifications/ID

Response

Expected Response Code: 200

{
    "notification": {
        "id": 1,
        "message": "New lead assigned to you",
        "type": "lead_assigned",
        "isRead": false,
        "createdAt": "2024-01-15T10:00:00+00:00",
        "modifiedAt": "2024-01-15T10:00:00+00:00",
        "userId": 1,
        "userName": "John Smith",
        "details": {
            "leadId": 123,
            "leadName": "Jane Doe"
        }
    }
}

Notification Properties

Name

Type

Description

id

int

ID of the Notification

message

string

Notification message

type

string

Type of notification

isRead

boolean

Whether the notification has been read

createdAt

datetime

Notification creation date/time

modifiedAt

datetime/null

Notification last modified date/time

userId

int

ID of the User the notification is for

userName

string

Name of the User the notification is for

details

object

Additional details specific to the notification type

List Notifications

GET /api/notifications

Get a list of notifications.

Query Parameters

Name

Type

Description

search

string

Text to search notifications by

page

int

Which page to display

limit

int

How many records to return

orderBy

string

Column to sort by

orderByDir

string

Sort direction: asc or desc

isRead

boolean

Filter by read status

type

string

Filter by notification type

Mark as Read

POST /api/notifications/{id}/read

Mark a notification as read.

Mark All as Read

POST /api/notifications/read-all

Mark all notifications as read.

Delete Notification

DELETE /api/notifications/{id}/delete

Delete an existing notification.