Benachrichtigungen
Die Notifications-API gibt Ihnen programmatischen Zugriff auf Ihren eigenen Benachrichtigungs-Feed. Listen Sie Benachrichtigungen mit Cursor-Paginierung, markieren Sie sie als gelesen oder ungelesen und löschen Sie nicht mehr benötigte.
Quick Start
- REST API
- CLI
# List your notification feed (cursor pagination)
curl -X GET https://api.copera.ai/public/v1/notifications \
-H "Authorization: Bearer cp_pat_YOUR_TOKEN"
# Mark a notification as read
curl -X PATCH https://api.copera.ai/public/v1/notifications/NOTIFICATION_ID \
-H "Authorization: Bearer cp_pat_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "status": "read" }'
# Delete a notification
curl -X DELETE https://api.copera.ai/public/v1/notifications/NOTIFICATION_ID \
-H "Authorization: Bearer cp_pat_YOUR_TOKEN"
curl -fsSL https://cli.copera.ai/install.sh | bash
# Notifications commands require a Personal Access Token
copera notifications list
# Mark read / unread
copera notifications read <notification-id>
copera notifications unread <notification-id>
# Delete
copera notifications delete <notification-id> --force
Verfügbar in
| Public API | CLI | MCP | Copera AI |
|---|---|---|---|
| ✅ Voll | ✅ Voll | ✅ Voll | — |
Die CLI und der gehostete MCP-Server decken Listen, Statusänderungen und Löschen ab. Benachrichtigungen sind dem In-App-Assistenten Copera AI nicht freigegeben.
Das Notification-Modell
Eine Benachrichtigung gehört zu einem einzelnen Benutzer in einem einzelnen Workspace. Jede trägt:
type— welche Art von Ereignis sie darstellt.status—READoderUNREAD.data— typspezifische Payload, die das Ereignis beschreibt.sender— wer sie ausgelöst hat (falls zutreffend), plusreadAtund Zeitstempel.- Gruppierungsfelder —
groupCount,groupStartedAtundgroupSenderIdsfür Benachrichtigungen, die mehrere zusammengehörige Ereignisse bündeln.
Benachrichtigungen listen
GET auf den Notifications-Endpunkt holt Ihren Feed. Er nutzt Cursor-Paginierung basierend auf Notification-IDs:
after— Benachrichtigungen neuer als diese ID.before— Benachrichtigungen älter als diese ID.
Die Antwort enthält das Array notifications, die Gesamtzahl count und den aktuellen unreadCount:
{
"notifications": [ /* … */ ],
"count": 40,
"unreadCount": 3
}
Siehe Paginierung für die Cursor-Konventionen.
Als gelesen oder ungelesen markieren
PATCH einer einzelnen Benachrichtigung mit status read oder unread:
curl -X PATCH "https://api.copera.ai/public/v1/notifications/{notificationId}" \
-H "Authorization: Bearer cp_pat_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "status": "read" }'
Die Antwort ist das aktualisierte Notification-Objekt.
Benachrichtigung löschen
DELETE einer Benachrichtigung entfernt sie aus Ihrem Feed. Die Antwort liefert die _id der gelöschten Benachrichtigung.
Authentifizierung & Scope
Notifications-Endpunkte erfordern ein Personal Access Token (cp_pat_) mit dem Scope access_notifications — sie wirken immer auf den eigenen Feed des Token-Inhabers. Ein Token ohne Scope erhält 403. Siehe Authentifizierung.
Referenz
- Benachrichtigungen in der API-Referenz — List-, Status-Update- und Delete-Endpunkte mit vollständigen Schemas.
- Paginierung — das Cursor-Modell
after/before. - Copera CLI und MCP-Server.