Notifications
The Notification:
Notifications are configurations that send alerts to users when a certain criteria has been met.
This criteria is defined in the notification's configuration. Each log that is processed is checked against the notification's configuration. If the log matches the configuration, then the user will notified.
Configuration parts:
Owner
Rules (criteria)
Mediums
Practical example:
Enabling/Disabling:
Inheritance:
Access Control:
Silencing:
Get all
Description
Get all notifications that the user has access to.
Parameters
headers
Authorization
string
Required
Description:
Bearer token - JWT
Example:
"Bearer <token>"
Responses
200
OK
Type:
Array of Notification objects
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{ _id: "0f9c0b0b4f0c6b0017f0e3b1", name: "Error notification", notes: "This notification is for errors", ownerEntityType: "User", ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1", rules: { id: "0f9c0b0b4f0c6b0017f0e3b1", field: "typ", operator: "EQUALS", comparator: "error", combinator: "AND" }, mediums: { email: true, sms: true, push: true }, enabled: true }
401
Unauthorized
Type:
Error object
Example:
1 2 3 4 5
{ name: "Invalid Role", message: "You do not have the required role to access this resource", status: 401 }
404
Not Found
Type:
Error object
Example:
1 2 3 4 5
{ name: "Entity not found", message: "Entity not found", status: 404 }
500
Internal Server Error
Type:
Error object
Example:
1 2 3 4 5
{ name: "Internal Server Error", message: "Internal Server Error", status: 500 }
get
/notification/
Request
1 2 3 4
curl https://logharvestor.com/api/v1/notification/ \ -X GET \ -H 'Authorization: Bearer <token>' \
Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{ _id: "0f9c0b0b4f0c6b0017f0e3b1", name: "Error notification", notes: "This notification is for errors", ownerEntityType: "User", ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1", rules: { id: "0f9c0b0b4f0c6b0017f0e3b1", field: "typ", operator: "EQUALS", comparator: "error", combinator: "AND" }, mediums: { email: true, sms: true, push: true }, enabled: true }
Get owner options
Description
Get all notification owner options that the user has access to.
Parameters
headers
Authorization
string
Required
Description:
Bearer token - JWT
Example:
"Bearer <token>"
body
entityType
string
Required
Description:
The type of entity to get options for. Must be one of: "org", "project", or "user".
Options:
Chart | Forwarder | Log | Notification | Org | Project | Ticket | User
Example:
"Forwarder"
Responses
200
OK
Type:
Array of RBAC objects
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
{ _id: "0f9c0b0b4f0c6b0017f0e3b1", user: { _id: "0f9c0b0b4f0c6b0017f0e3b1", fname: "Jack", lname: "Lumber", dname: "Jack Lumber", email: "ljack21@logharvestor.com", password: "password", image: "{image url}", phone: "123-456-7890", queries: {}, settings: {}, role: "demo", onboardingStage: "welcome", dismissOnboarding: false }, role: "owner", entity: "0f9c0b0b4f0c6b0017f0e3b1", entityType: "Forwarder" }
401
Unauthorized
Type:
Error object
Example:
1 2 3 4 5
{ name: "Invalid Role", message: "You do not have the required role to access this resource", status: 401 }
404
Not Found
Type:
Error object
Example:
1 2 3 4 5
{ name: "Entity not found", message: "Entity not found", status: 404 }
500
Internal Server Error
Type:
Error object
Example:
1 2 3 4 5
{ name: "Internal Server Error", message: "Internal Server Error", status: 500 }
post
/notification/entityOptions
Request
1 2 3 4 5
curl https://logharvestor.com/api/v1/notification/entityOptions \ -X POST \ -H 'Authorization: Bearer <token>' \ -H 'Content-Type: application/json' \ --data-raw '{"entityType":"\"Forwarder\""}'
Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
{ _id: "0f9c0b0b4f0c6b0017f0e3b1", user: { _id: "0f9c0b0b4f0c6b0017f0e3b1", fname: "Jack", lname: "Lumber", dname: "Jack Lumber", email: "ljack21@logharvestor.com", password: "password", image: "{image url}", phone: "123-456-7890", queries: {}, settings: {}, role: "demo", onboardingStage: "welcome", dismissOnboarding: false }, role: "owner", entity: "0f9c0b0b4f0c6b0017f0e3b1", entityType: "Forwarder" }
Get by id
Description
Find the notification that matches the {id} query parameter.
Parameters
headers
Authorization
string
Required
Description:
Bearer token - JWT
Example:
"Bearer <token>"
params
id
string
Required
Description:
The id of the notification
Example:
"0f9c0b0b4f0c6b0017f0e3b1"
Responses
200
OK
Type:
Notification object
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{ _id: "0f9c0b0b4f0c6b0017f0e3b1", name: "Error notification", notes: "This notification is for errors", ownerEntityType: "User", ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1", rules: { id: "0f9c0b0b4f0c6b0017f0e3b1", field: "typ", operator: "EQUALS", comparator: "error", combinator: "AND" }, mediums: { email: true, sms: true, push: true }, enabled: true }
401
Unauthorized
Type:
Error object
Example:
1 2 3 4 5
{ name: "Invalid Role", message: "You do not have the required role to access this resource", status: 401 }
404
Not Found
Type:
Error object
Example:
1 2 3 4 5
{ name: "Entity not found", message: "Entity not found", status: 404 }
500
Internal Server Error
Type:
Error object
Example:
1 2 3 4 5
{ name: "Internal Server Error", message: "Internal Server Error", status: 500 }
get
/notification/:id
Request
1 2 3 4
curl https://logharvestor.com/api/v1/notification/:id \ -X GET \ -H 'Authorization: Bearer <token>' \
Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{ _id: "0f9c0b0b4f0c6b0017f0e3b1", name: "Error notification", notes: "This notification is for errors", ownerEntityType: "User", ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1", rules: { id: "0f9c0b0b4f0c6b0017f0e3b1", field: "typ", operator: "EQUALS", comparator: "error", combinator: "AND" }, mediums: { email: true, sms: true, push: true }, enabled: true }
Get events
Description
Get all events that the notification has triggered. These include how and to whom the notification was sent, as well as when the notification was created or updated.
Parameters
headers
Authorization
string
Required
Description:
Bearer token - JWT
Example:
"Bearer <token>"
params
forwarderId
string
Required
Description:
Forwarder identifier
Example:
"0f9c0b0b4f0c6b0017f0e3b1"
Responses
200
OK
Description:
Returns all events for the Notification.
Type:
Array of Event objects
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
{ _id: "0f9c0b0b4f0c6b0017f0e3b1", type: "updated", message: "User 0f9c0b0b4f0c6b0017f0e3b1 updated forwarder 0f9c0b0b4f0c6b0017f0e3b1", user: "0f9c0b0b4f0c6b0017f0e3b1", entity: "0f9c0b0b4f0c6b0017f0e3b1", entityType: "Forwarder", refs: [ { entity: "0f9c0b0b4f0c6b0017f0e3b1", entityType: "Forwarder" }, { entity: "0f9c0b0b4f0c6b0017f0e3b1", entityType: "Project" } ] }
401
Unauthorized
Type:
Error object
Example:
1 2 3 4 5
{ name: "Invalid Role", message: "You do not have the required role to access this resource", status: 401 }
404
Not Found
Type:
Error object
Example:
1 2 3 4 5
{ name: "Entity not found", message: "Entity not found", status: 404 }
500
Internal Server Error
Type:
Error object
Example:
1 2 3 4 5
{ name: "Internal Server Error", message: "Internal Server Error", status: 500 }
get
/notification/:id/events
Request
1 2 3 4
curl https://logharvestor.com/api/v1/notification/:id/events \ -X GET \ -H 'Authorization: Bearer <token>' \
Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
{ _id: "0f9c0b0b4f0c6b0017f0e3b1", type: "updated", message: "User 0f9c0b0b4f0c6b0017f0e3b1 updated forwarder 0f9c0b0b4f0c6b0017f0e3b1", user: "0f9c0b0b4f0c6b0017f0e3b1", entity: "0f9c0b0b4f0c6b0017f0e3b1", entityType: "Forwarder", refs: [ { entity: "0f9c0b0b4f0c6b0017f0e3b1", entityType: "Forwarder" }, { entity: "0f9c0b0b4f0c6b0017f0e3b1", entityType: "Project" } ] }
Create
Description
Create a new notification. The notification will be enabled by default.
Parameters
headers
Authorization
string
Required
Description:
Bearer token - JWT
Example:
"Bearer <token>"
body
name
string
Required
Description:
Name of the notification
Example:
"Error notification"
notes
string
Description:
Notes of the notification
Example:
"This notification is for errors"
owner
string
Required
Description:
Owner of the notification
Example:
"0f9c0b0b4f0c6b0017f0e3b1"
ownerEntityType
string
Required
Description:
Owner entity type of the notification
Options:
Org | Project | User | Forwarder
Example:
"User"
rules
array
Required
Description:
Rules of the notification
Example:
rules
mediums
object
Required
Description:
Mediums of the notification
Example:
NotificationMediums
Responses
200
OK
Description:
Returns the created notification.
Type:
Notification object
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{ _id: "0f9c0b0b4f0c6b0017f0e3b1", name: "Error notification", notes: "This notification is for errors", ownerEntityType: "User", ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1", rules: { id: "0f9c0b0b4f0c6b0017f0e3b1", field: "typ", operator: "EQUALS", comparator: "error", combinator: "AND" }, mediums: { email: true, sms: true, push: true }, enabled: true }
401
Unauthorized
Type:
Error object
Example:
1 2 3 4 5
{ name: "Invalid Role", message: "You do not have the required role to access this resource", status: 401 }
404
Not Found
Type:
Error object
Example:
1 2 3 4 5
{ name: "Entity not found", message: "Entity not found", status: 404 }
500
Internal Server Error
Type:
Error object
Example:
1 2 3 4 5
{ name: "Internal Server Error", message: "Internal Server Error", status: 500 }
post
/notification/
Request
1 2 3 4 5
curl https://logharvestor.com/api/v1/notification/ \ -X POST \ -H 'Authorization: Bearer <token>' \ -H 'Content-Type: application/json' \ --data-raw '{"name":"\"Error notification\"","notes":"\"This notification is for errors\"","owner":"\"0f9c0b0b4f0c6b0017f0e3b1\"","ownerEntityType":"\"User\""}'
Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{ _id: "0f9c0b0b4f0c6b0017f0e3b1", name: "Error notification", notes: "This notification is for errors", ownerEntityType: "User", ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1", rules: { id: "0f9c0b0b4f0c6b0017f0e3b1", field: "typ", operator: "EQUALS", comparator: "error", combinator: "AND" }, mediums: { email: true, sms: true, push: true }, enabled: true }
Update
Description
Update an existing notification.
Parameters
headers
Authorization
string
Required
Description:
Bearer token - JWT
Example:
"Bearer <token>"
params
id
string
Required
Description:
The id of the notification
Example:
"0f9c0b0b4f0c6b0017f0e3b1"
body
name
string
Required
Description:
Name of the notification
Example:
"Error notification"
notes
string
Description:
Notes of the notification
Example:
"This notification is for errors"
owner
string
Required
Description:
Owner of the notification
Example:
"0f9c0b0b4f0c6b0017f0e3b1"
ownerEntityType
string
Required
Description:
Owner entity type of the notification
Options:
Org | Project | User | Forwarder
Example:
"User"
rules
array
Required
Description:
Rules of the notification
Example:
rules
mediums
object
Required
Description:
Mediums of the notification
Example:
NotificationMediums
Responses
200
OK
Description:
Returns the updated notification.
Type:
Notification object
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{ _id: "0f9c0b0b4f0c6b0017f0e3b1", name: "Error notification", notes: "This notification is for errors", ownerEntityType: "User", ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1", rules: { id: "0f9c0b0b4f0c6b0017f0e3b1", field: "typ", operator: "EQUALS", comparator: "error", combinator: "AND" }, mediums: { email: true, sms: true, push: true }, enabled: true }
401
Unauthorized
Type:
Error object
Example:
1 2 3 4 5
{ name: "Invalid Role", message: "You do not have the required role to access this resource", status: 401 }
404
Not Found
Type:
Error object
Example:
1 2 3 4 5
{ name: "Entity not found", message: "Entity not found", status: 404 }
500
Internal Server Error
Type:
Error object
Example:
1 2 3 4 5
{ name: "Internal Server Error", message: "Internal Server Error", status: 500 }
put
/notification/:id
Request
1 2 3 4 5
curl https://logharvestor.com/api/v1/notification/:id \ -X PUT \ -H 'Authorization: Bearer <token>' \ -H 'Content-Type: application/json' \ --data-raw '{"name":"\"Error notification\"","notes":"\"This notification is for errors\"","owner":"\"0f9c0b0b4f0c6b0017f0e3b1\"","ownerEntityType":"\"User\""}'
Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{ _id: "0f9c0b0b4f0c6b0017f0e3b1", name: "Error notification", notes: "This notification is for errors", ownerEntityType: "User", ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1", rules: { id: "0f9c0b0b4f0c6b0017f0e3b1", field: "typ", operator: "EQUALS", comparator: "error", combinator: "AND" }, mediums: { email: true, sms: true, push: true }, enabled: true }
Delete
Description
Delete an existing notification.
Parameters
headers
Authorization
string
Required
Description:
Bearer token - JWT
Example:
"Bearer <token>"
params
id
string
Required
Description:
The id of the notification
Example:
"0f9c0b0b4f0c6b0017f0e3b1"
Responses
200
OK
Description:
Returns a snapshot of the deleted notification.
Type:
Notification object
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{ _id: "0f9c0b0b4f0c6b0017f0e3b1", name: "Error notification", notes: "This notification is for errors", ownerEntityType: "User", ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1", rules: { id: "0f9c0b0b4f0c6b0017f0e3b1", field: "typ", operator: "EQUALS", comparator: "error", combinator: "AND" }, mediums: { email: true, sms: true, push: true }, enabled: true }
401
Unauthorized
Type:
Error object
Example:
1 2 3 4 5
{ name: "Invalid Role", message: "You do not have the required role to access this resource", status: 401 }
404
Not Found
Type:
Error object
Example:
1 2 3 4 5
{ name: "Entity not found", message: "Entity not found", status: 404 }
500
Internal Server Error
Type:
Error object
Example:
1 2 3 4 5
{ name: "Internal Server Error", message: "Internal Server Error", status: 500 }
delete
/notification/:id
Request
1 2 3 4
curl https://logharvestor.com/api/v1/notification/:id \ -X DELETE \ -H 'Authorization: Bearer <token>' \
Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{ _id: "0f9c0b0b4f0c6b0017f0e3b1", name: "Error notification", notes: "This notification is for errors", ownerEntityType: "User", ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1", rules: { id: "0f9c0b0b4f0c6b0017f0e3b1", field: "typ", operator: "EQUALS", comparator: "error", combinator: "AND" }, mediums: { email: true, sms: true, push: true }, enabled: true }
Archive
Description
Archive an existing notification.
Parameters
headers
Authorization
string
Required
Description:
Bearer token - JWT
Example:
"Bearer <token>"
params
id
string
Required
Description:
The id of the notification
Example:
"0f9c0b0b4f0c6b0017f0e3b1"
Responses
200
OK
Description:
Returns the archived notification.
Type:
Notification object
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{ _id: "0f9c0b0b4f0c6b0017f0e3b1", name: "Error notification", notes: "This notification is for errors", ownerEntityType: "User", ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1", rules: { id: "0f9c0b0b4f0c6b0017f0e3b1", field: "typ", operator: "EQUALS", comparator: "error", combinator: "AND" }, mediums: { email: true, sms: true, push: true }, enabled: true }
401
Unauthorized
Type:
Error object
Example:
1 2 3 4 5
{ name: "Invalid Role", message: "You do not have the required role to access this resource", status: 401 }
404
Not Found
Type:
Error object
Example:
1 2 3 4 5
{ name: "Entity not found", message: "Entity not found", status: 404 }
500
Internal Server Error
Type:
Error object
Example:
1 2 3 4 5
{ name: "Internal Server Error", message: "Internal Server Error", status: 500 }
post
/notification/:id/archive
Request
1 2 3 4
curl https://logharvestor.com/api/v1/notification/:id/archive \ -X POST \ -H 'Authorization: Bearer <token>' \
Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{ _id: "0f9c0b0b4f0c6b0017f0e3b1", name: "Error notification", notes: "This notification is for errors", ownerEntityType: "User", ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1", rules: { id: "0f9c0b0b4f0c6b0017f0e3b1", field: "typ", operator: "EQUALS", comparator: "error", combinator: "AND" }, mediums: { email: true, sms: true, push: true }, enabled: true }
Unarchive
Description
Unarchive an existing notification.
Parameters
headers
Authorization
string
Required
Description:
Bearer token - JWT
Example:
"Bearer <token>"
params
id
string
Required
Description:
The id of the notification
Example:
"0f9c0b0b4f0c6b0017f0e3b1"
Responses
200
OK
Description:
Returns the unarchived notification.
Type:
Notification object
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{ _id: "0f9c0b0b4f0c6b0017f0e3b1", name: "Error notification", notes: "This notification is for errors", ownerEntityType: "User", ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1", rules: { id: "0f9c0b0b4f0c6b0017f0e3b1", field: "typ", operator: "EQUALS", comparator: "error", combinator: "AND" }, mediums: { email: true, sms: true, push: true }, enabled: true }
401
Unauthorized
Type:
Error object
Example:
1 2 3 4 5
{ name: "Invalid Role", message: "You do not have the required role to access this resource", status: 401 }
404
Not Found
Type:
Error object
Example:
1 2 3 4 5
{ name: "Entity not found", message: "Entity not found", status: 404 }
500
Internal Server Error
Type:
Error object
Example:
1 2 3 4 5
{ name: "Internal Server Error", message: "Internal Server Error", status: 500 }
post
/notification/:id/unarchive
Request
1 2 3 4
curl https://logharvestor.com/api/v1/notification/:id/unarchive \ -X POST \ -H 'Authorization: Bearer <token>' \
Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{ _id: "0f9c0b0b4f0c6b0017f0e3b1", name: "Error notification", notes: "This notification is for errors", ownerEntityType: "User", ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1", rules: { id: "0f9c0b0b4f0c6b0017f0e3b1", field: "typ", operator: "EQUALS", comparator: "error", combinator: "AND" }, mediums: { email: true, sms: true, push: true }, enabled: true }
Enable/Disable
Description
Enable or disable an existing notification.
Parameters
headers
Authorization
string
Required
Description:
Bearer token - JWT
Example:
"Bearer <token>"
params
id
string
Required
Description:
The id of the notification
Example:
"0f9c0b0b4f0c6b0017f0e3b1"
Responses
200
OK
Description:
Returns the updated notification.
Type:
Notification object
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{ _id: "0f9c0b0b4f0c6b0017f0e3b1", name: "Error notification", notes: "This notification is for errors", ownerEntityType: "User", ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1", rules: { id: "0f9c0b0b4f0c6b0017f0e3b1", field: "typ", operator: "EQUALS", comparator: "error", combinator: "AND" }, mediums: { email: true, sms: true, push: true }, enabled: true }
401
Unauthorized
Type:
Error object
Example:
1 2 3 4 5
{ name: "Invalid Role", message: "You do not have the required role to access this resource", status: 401 }
404
Not Found
Type:
Error object
Example:
1 2 3 4 5
{ name: "Entity not found", message: "Entity not found", status: 404 }
500
Internal Server Error
Type:
Error object
Example:
1 2 3 4 5
{ name: "Internal Server Error", message: "Internal Server Error", status: 500 }
post
/notification/:id/toggle
Request
1 2 3 4
curl https://logharvestor.com/api/v1/notification/:id/toggle \ -X POST \ -H 'Authorization: Bearer <token>' \
Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{ _id: "0f9c0b0b4f0c6b0017f0e3b1", name: "Error notification", notes: "This notification is for errors", ownerEntityType: "User", ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1", rules: { id: "0f9c0b0b4f0c6b0017f0e3b1", field: "typ", operator: "EQUALS", comparator: "error", combinator: "AND" }, mediums: { email: true, sms: true, push: true }, enabled: true }
Resources
Docs
Pricing
Roadmap
About
Integrations
Copyright © Log Harvestor 2023 • Terms • Privacy