Use this API to update notifications.
Endpoint
POST https://api.velt.dev/v2/notifications/update
Body
Params
When enabled, notifications are only updated for users who have access to the specified document.
This ensures notification updates respect document access permissions configured via Access Control or Permission Provider. Default: false
Notifications object displayHeadlineMessageTemplate
Display Headline Message Template
displayHeadlineMessageTemplateData
Display Headline Message Template Data User who was directly affected by the action
Any custom field with string value
Any custom object to be stored with the notification.
When the user clicks on the notification, this data will be sent to in the callback.
Array of user ids that you want to mark the notification as read.
Use this with the readByUserIds param. If true, the read notifications will be not be removed from the “For You” tab.
Example Requests
1. Update by organizationId and documentId
{
"data" : {
"organizationId" : "yourOrganizationId" ,
"documentId" : "yourDocumentId" ,
"notifications" : [
{
"id" : "yourNotificationId" ,
"displayBodyMessage" : "This is body message (Secondary message)" ,
}
]
}
}
2. Update by organizationId, documentId and locationId
{
"data" : {
"organizationId" : "yourOrganizationId" ,
"documentId" : "yourDocumentId" ,
"locationId" : "yourLocationId" ,
"notifications" : [
{
"id" : "yourNotificationId" ,
"displayBodyMessage" : "This is body message (Secondary message)" ,
}
]
}
}
3. Update by organizationId, documentId and userId
{
"data" : {
"organizationId" : "yourOrganizationId" ,
"documentId" : "yourDocumentId" ,
"userId" : "yourUserId" ,
"notifications" : [
{
"id" : "yourNotificationId" ,
"displayBodyMessage" : "This is body message (Secondary message)" ,
}
]
}
}
4. Update by organizationId and userId
{
"data" : {
"organizationId" : "yourOrganizationId" ,
"userId" : "yourUserId" ,
"notifications" : [
{
"id" : "yourNotificationId" ,
"displayBodyMessage" : "This is body message (Secondary message)" ,
}
]
}
}
5. Update by organizationId, documentId, locationId and userId
{
"data" : {
"organizationId" : "yourOrganizationId" ,
"documentId" : "yourDocumentId" ,
"userId" : "yourUserId" ,
"locationId" : "yourLocationId" ,
"notifications" : [
{
"id" : "yourNotificationId" ,
"displayBodyMessage" : "This is body message (Secondary message)" ,
}
]
}
}
6. Update with Permission Verification
{
"data" : {
"organizationId" : "yourOrganizationId" ,
"documentId" : "yourDocumentId" ,
"verifyUserPermissions" : true ,
"notifications" : [
{
"id" : "yourNotificationId" ,
"displayBodyMessage" : "This is updated body message (Secondary message)"
}
]
}
}
When verifyUserPermissions is enabled, the API checks document access for each user before updating their notifications. Updates are only applied to users with access to the document.
Response
Success Response
{
"result" : {
"status" : "success" ,
"message" : "Notification(s) updated successfully." ,
"data" : {
"5471488637912692" : {
"success" : true ,
"message" : "Notification updated."
}
}
}
}
When some notifications are not found
{
"result" : {
"status" : "success" ,
"message" : "Notification(s) updated successfully." ,
"data" : {
"5471488637912692" : {
"success" : false ,
"message" : "Failed to update notification."
},
"5471488637912693" : {
"success" : true ,
"message" : "Notification updated."
}
}
}
}
Failure Response
{
"error" : {
"message" : "ERROR_MESSAGE" ,
"status" : "INVALID_ARGUMENT"
}
}
{
"result" : {
"status" : "success" ,
"message" : "Notification(s) updated successfully." ,
"data" : {
"5471488637912692" : {
"success" : true ,
"message" : "Notification updated."
}
}
}
}