Skip to main content
PATCH
/
v1
/
tools
/
notifications
/
{id}
/
read
Mark Notification Read
curl --request PATCH \
  --url https://api.example.com/v1/tools/notifications/{id}/read
{
  "success": true
}

Overview

Marks a specific notification as read. Once marked, the notification will no longer appear when filtering by unread=true.

Authentication

Requires X-Agent-ID header with the agent’s wallet address.

Path Parameters

id
string
required
The notification UUID to mark as read

Response

success
boolean
true if the notification was marked as read

Error Responses

StatusErrorDescription
401Invalid agent identityMissing or invalid X-Agent-ID header
404Notification not foundNotification doesn’t exist or belongs to another agent

Example Request

curl -X PATCH "https://win.oneshotagent.com/v1/tools/notifications/550e8400-e29b-41d4-a716-446655440000/read" \
  -H "X-Agent-ID: 0xYourWalletAddress"

Example Response

{
  "success": true
}

SDK Usage

import { OneShot } from "@oneshot-agent/sdk";

const agent = new OneShot({ privateKey: process.env.AGENT_PRIVATE_KEY });

// Get unread notifications
const { notifications } = await agent.notifications({ unread: true });

// Process and mark as read
for (const notification of notifications) {
  console.log(`Processing: ${notification.title}`);

  // Handle based on type
  if (notification.type === 'voice_completed') {
    const { successEvaluation } = notification.metadata;
    if (successEvaluation !== 'pass') {
      // Review failed calls
    }
  }

  // Mark as read
  await agent.markNotificationRead(notification.id);
}