Notifications ============ Use this endpoint to manipulate and obtain details on Salesbox's Notifications. Base Endpoint ------------ .. code-block:: text https://segmentai.salesbox.com.br/api/notifications Get Notification -------------- .. code-block:: text GET /api/notifications/{id} Get an individual Notification by ID. **HTTP Request** ``GET /api/notifications/ID`` **Response** ``Expected Response Code: 200`` .. code-block:: json { "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** .. list-table:: :header-rows: 1 * - 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 ---------------- .. code-block:: text GET /api/notifications Get a list of notifications. **Query Parameters** .. list-table:: :header-rows: 1 * - 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 ----------- .. code-block:: text POST /api/notifications/{id}/read Mark a notification as read. Mark All as Read -------------- .. code-block:: text POST /api/notifications/read-all Mark all notifications as read. Delete Notification ----------------- .. code-block:: text DELETE /api/notifications/{id}/delete Delete an existing notification.