cURL
curl -X PATCH https://api.bodhveda.com/recipients/recipient_123/notifications \
-H "Authorization: Bearer bv_xxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"ids": [123, 456],
"state": { "read": true }
}'import { Bodhveda } from "@bodhveda/js";
const bodhveda = new Bodhveda("bv_xxxxxxxxx");
const res = await bodhveda.recipients.notifications.updateState("recipient_123", {
ids: [123, 456],
state: { read: true },
});
// res.updated_countimport (
"context"
bodhveda "github.com/MudgalLabs/bodhveda/sdk/go"
)
ctx := context.Background()
client := bodhveda.NewClient("bv_xxxxxxxxx", nil)
read := true
res, _ := client.Recipients.Notifications.UpdateState(ctx, "recipient_123", &bodhveda.UpdateNotificationsStateRequest{
IDs: []int{123, 456},
State: bodhveda.NotificationStateOptional{Read: &read},
})
// res.UpdatedCountimport { useUpdateNotificationsState } from "@bodhveda/react";
// Requires a <BodhvedaProvider recipientID="recipient_123"> higher in the tree.
function MarkRead({ ids }: { ids: number[] }) {
const { mutate } = useUpdateNotificationsState();
return <button onClick={() => mutate({ ids, state: { read: true } })}>Mark read</button>;
}{
"updated_count": 2
}Notifications
Update notifications state
Updates the state of one or more notifications for the specified recipient.
Only notifications visible in the recipient’s feed are updated — muted, quota_exceeded, and not_requested notifications are skipped, and the returned count reflects only the rows actually changed.
PATCH
/
recipients
/
{recipient_id}
/
notifications
cURL
curl -X PATCH https://api.bodhveda.com/recipients/recipient_123/notifications \
-H "Authorization: Bearer bv_xxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"ids": [123, 456],
"state": { "read": true }
}'import { Bodhveda } from "@bodhveda/js";
const bodhveda = new Bodhveda("bv_xxxxxxxxx");
const res = await bodhveda.recipients.notifications.updateState("recipient_123", {
ids: [123, 456],
state: { read: true },
});
// res.updated_countimport (
"context"
bodhveda "github.com/MudgalLabs/bodhveda/sdk/go"
)
ctx := context.Background()
client := bodhveda.NewClient("bv_xxxxxxxxx", nil)
read := true
res, _ := client.Recipients.Notifications.UpdateState(ctx, "recipient_123", &bodhveda.UpdateNotificationsStateRequest{
IDs: []int{123, 456},
State: bodhveda.NotificationStateOptional{Read: &read},
})
// res.UpdatedCountimport { useUpdateNotificationsState } from "@bodhveda/react";
// Requires a <BodhvedaProvider recipientID="recipient_123"> higher in the tree.
function MarkRead({ ids }: { ids: number[] }) {
const { mutate } = useUpdateNotificationsState();
return <button onClick={() => mutate({ ids, state: { read: true } })}>Mark read</button>;
}{
"updated_count": 2
}Authorizations
Bearer authentication header of the form Bearer bv_xxxxxxxxx, where bv_xxxxxxxxx is your API Key with Full access scope.
Path Parameters
Unique external identifier for the recipient.
Body
application/json
Response
200 - application/json
Successfully updated notifications
Number of notifications updated.