> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bodhveda.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.



## OpenAPI

````yaml PATCH /recipients/{recipient_id}/notifications
openapi: 3.0.3
info:
  title: Bodhveda Notifications API
  version: '1.0'
  description: API for sending notifications to recipients or broadcasting to all.
servers: []
security: []
paths:
  /recipients/{recipient_id}/notifications:
    patch:
      summary: Update notifications state
      description: >-
        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.
      parameters:
        - name: recipient_id
          in: path
          required: true
          schema:
            type: string
          description: Unique external identifier for the recipient.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ids:
                  type: array
                  description: >-
                    Array of notification IDs to update. If omitted, applies to
                    all.
                  items:
                    type: integer
                state:
                  type: object
                  description: >-
                    The notification state to update. 

                    - You can set one or multiple state fields in the same
                    request. 

                    - Fields left out of `state` will remain unchanged.
                  properties:
                    read:
                      type: boolean
                      description: Whether the notification is marked as read.
                    opened:
                      type: boolean
                      description: Whether the notification is marked as opened.
                  example:
                    read: true
              required:
                - state
            example:
              ids:
                - 123
                - 456
              state:
                read: true
      responses:
        '200':
          description: Successfully updated notifications
          content:
            application/json:
              schema:
                type: object
                properties:
                  updated_count:
                    type: integer
                    description: Number of notifications updated.
                example:
                  updated_count: 2
      security:
        - BearerAuthWithAPIKeyWithFullAcessScope: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            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 }
              }' 
        - lang: javascript
          label: JavaScript
          source: >-
            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_count
        - lang: go
          label: Go
          source: >-
            import (
                "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.UpdatedCount
        - lang: jsx
          label: React
          source: >-
            import { 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>;
            }
components:
  securitySchemes:
    BearerAuthWithAPIKeyWithFullAcessScope:
      type: http
      scheme: bearer
      bearerFormat: APIKey
      description: >-
        Bearer authentication header of the form `Bearer bv_xxxxxxxxx`, where
        `bv_xxxxxxxxx` is your **API Key** with `Full access` scope.

````