Notifications
La Notifications API ti dà accesso programmatico al tuo feed di notifiche. Elenca le notifiche con paginazione cursor, contrassegnale come lette o non lette ed elimina quelle di cui non hai più bisogno.
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
Disponibile in
| Public API | CLI | MCP | Copera AI |
|---|---|---|---|
| ✅ Full | ✅ Full | ✅ Full | — |
La CLI e l'MCP server hostato coprono elenco, cambi di status ed eliminazione. Le Notifications non sono esposte all'assistente Copera AI in-app.
Il modello notification
Una notifica appartiene a un singolo utente in un singolo workspace. Ciascuna porta:
type— che tipo di evento rappresenta.status—READoUNREAD.data— un payload type-specific che descrive l'evento.sender— chi l'ha triggerata (quando applicabile), piùreadAte timestamp.- Campi di grouping —
groupCount,groupStartedAtegroupSenderIdsper le notifiche che raggruppano diversi eventi correlati.
Elencare le notifiche
GET sull'endpoint notifications per recuperare il feed. Usa paginazione cursor basata sugli id delle notifiche:
after— restituisce le notifiche più nuove di questo id.before— restituisce le notifiche più vecchie di questo id.
La response include l'array notifications, il count totale e l'unreadCount corrente:
{
"notifications": [ /* … */ ],
"count": 40,
"unreadCount": 3
}
Vedi Paginazione per le convenzioni cursor.
Segnare come lette o non lette
PATCH una singola notifica con un status di read o 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" }'
La response è l'oggetto notification aggiornato.
Eliminare una notifica
DELETE una notifica per rimuoverla dal feed. La response restituisce l'_id della notifica eliminata.
Autenticazione e scope
Gli endpoint Notifications richiedono un Personal Access Token (cp_pat_) con lo scope access_notifications — operano sempre sul feed del titolare del token. Un token senza lo scope ottiene un 403. Vedi Autenticazione.
Riferimento
- Notifications nell'API Reference — endpoint list, update status e delete con schemi completi.
- Paginazione — il modello cursor
after/before. - Copera CLI e MCP server.