Endpoint
POST https://api.velt.dev/v2/notifications/add
Headers
Your API key.
Your Auth Token.
Body
Params
Show properties
Show properties
Organization ID
If set to true, a new organization will be created (if it doesn’t exist) before the notification is created.
Document ID
If set to true, a new document will be created before the notification is created.
User who took the action
Notification ID. If not provided, Velt will generate a random ID.
Use this if you want more control on the ID being set and prevent duplicate notifications.
Only the special characters
_
, -
are allowed.Display Headline Message Template
Display Body Message
Array of Notify Users
Default is true.
If set to true, the notification will be sent to all users in the organization.
If set to false, the notification will be sent to only the users specified in the
notifyUsers
array.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
Copy
Ask AI
{
"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
Copy
Ask AI
{
"result": {
"status": "success",
"message": "Notification added successfully.",
"data": {
"success": true,
"message": "Notification added successfully."
}
}
}
Failure Response
Copy
Ask AI
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
Copy
Ask AI
{
"result": {
"status": "success",
"message": "Notification added successfully.",
"data": {
"success": true,
"message": "Notification added successfully."
}
}
}