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

# Mark notifications read

> Mark notification events as read for the current user.

Provide exactly one of `notification_ids`, `before`, or `mark_all`. `workflow_id` is only valid when used with `before` or `mark_all`.

This results in the following behaviors:

* If you specify `notification_ids` only, it will mark all notifications with the specified IDs as read.
* If you specify `before` only, it will mark all notifications created in the workspace before the specified timestamp as read.
* If you specify `mark_all` only, it will mark at the time of the API call all existing notifications in the workspace as read.
* If you specify `workflow_id` and `before`, it will mark all notifications created before the specified timestamp for the specified workflow as read.
* If you specify `workflow_id` and `mark_all`, it will mark at the time of the API call all existing notifications associated with the specified workflow as read.

## Body

<ParamField body="notification_ids" type="array">
  Specific notification IDs to mark as read. Maximum 100 UUIDs.
</ParamField>

<ParamField body="before" type="string">
  Mark all notifications created before this ISO 8601 timestamp (in format `YYYY-MM-DDTHH:MM:SSZ`) as read.
</ParamField>

<ParamField body="mark_all" type="boolean">
  If `true`, mark all unread notifications as read. Default: `false`.
</ParamField>

<ParamField body="workflow_id" type="string">
  Scope the operation to a specific workflow. Only valid when used with `before` or `mark_all`.
</ParamField>

## Response

<ResponseField name="marked_count" type="integer" required>
  Number of notifications newly marked as read.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url "${UNSTRUCTURED_API_URL}/api/v1/notifications/mark-read" \
    --header "unstructured-api-key: ${UNSTRUCTURED_API_KEY}" \
    --header "Content-Type: application/json" \
    --data '{
      "notification_ids": [
        "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
        "b2c3d4e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e"
      ]
    }'
  ```

  ```python Python SDK theme={null}
  import os
  from unstructured_client import UnstructuredClient
  from unstructured_client.models.operations import MarkReadApiV1NotificationsMarkReadPostRequest

  client = UnstructuredClient(
      api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
      server_url=os.getenv("UNSTRUCTURED_API_URL"),
  )

  response = client.notifications.mark_read(
      request=MarkReadApiV1NotificationsMarkReadPostRequest(
          notification_ids=[
              "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
              "b2c3d4e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e",
          ],
      )
  )
  print(response)
  ```

  ```python Python SDK (async) theme={null}
  import asyncio
  import os
  from unstructured_client import UnstructuredClient
  from unstructured_client.models.operations import MarkReadApiV1NotificationsMarkReadPostRequest

  async def mark_read():
      client = UnstructuredClient(
          api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
          server_url=os.getenv("UNSTRUCTURED_API_URL"),
      )
      response = await client.notifications.mark_read_async(
          request=MarkReadApiV1NotificationsMarkReadPostRequest(
              notification_ids=[
                  "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
                  "b2c3d4e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e",
              ],
          )
      )
      print(response)

  asyncio.run(mark_read())
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "marked_count": 2
  }
  ```
</ResponseExample>
