Notifications
Add Notifications
REST APIs
- Organizations
- Documents
- Locations
- Users
- Organization User Groups
- Comments Feature
- Notifications
Reference
- Frontend APIs
- React Hooks
- Data Models
Notifications
Add Notifications
POST
/
v1
/
notifications
/
add
Use this API to add notifications.
Endpoint
POST https://api.velt.dev/v1/notifications/add
Headers
x-velt-api-key
string
requiredYour API key.
x-velt-auth-token
string
requiredYour Auth Token.
Body Example
Params
data
object
requiredorganizationId
string
requiredOrganization ID
documentId
string
requiredDocument ID
actionUser
User
requiredUser who took the action
displayHeadlineMessageTemplate
string
requiredDisplay Headline Message Template
displayHeadlineMessageTemplateData
object
Display Headline Message Template Data (Optional)
actionUser
User
User who took the action
recipientUser
string
User who was directly affected by the action
yourCustomField
string
Any custom field with string value
displayBodyMessage
string
requiredDisplay Body Message
notifyUsers
User[]
requiredArray of Notify Users
notificationSourceData
object
Any custom object to be stored with the notification. When the user clicks on the notification, this data will be sent in the callback.
Example Request
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"actionUser": {
"userId": "yourUserId",
"name": "User Name",
"email": "user@example.com"
},
"displayHeadlineMessageTemplate": "This is main template, you can pass variables using curly brackets like this: {actionUser}, {recipientUser}, {yourCustomVariableWithStringValue}",
"displayHeadlineMessageTemplateData": {
"actionUser": {
"userId": "yourUserId",
"name": "User Name",
"email": "user@example.com"
},
"recipientUser": {
"userId": "recipientUserId",
"name": "Recipient Name",
"email": "recipient@example.com"
},
"yourCustomField": "Variable will be replaced with this text"
},
"displayBodyMessage": "This is body message (Secondary message)",
"notifyUsers": [
{
"email": "test@example.com",
"userId": "testingUserId"
},
{
"userId": "yourUserId",
"name": "User Name",
"email": "user@example.com"
}
]
}
}
Response
Success Response
{
"result": {
"status": "success",
"message": "Notification added successfully.",
"data": {
"success": true,
"message": "Notification added successfully."
}
}
}
Failure Response
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
Was this page helpful?