Skip to content

Notifications API

View notification send history and per-watch trigger filtering.

Naming during the transition

URLs still address watches as tasks (/api/v1/tasks/{task_id}/notifications). The rename to webwhen is a later phase.

Overview

webwhen has two notification-related endpoints:

  1. GET /api/v1/notifications/sends — global notification send history (email/webhook delivery records).
  2. GET /api/v1/tasks/{task_id}/notifications — per-watch: executions where the condition was met.

Endpoints

Notification send history

View the delivery history of email and webhook notifications across all your watches. Tracks actual send attempts, not just condition matches.

Endpoint: GET /api/v1/notifications/sends

Headers:

Authorization: Bearer {api_key}

Query parameters:

ParameterTypeDescription
notification_typestringFilter by email or webhook
task_idstringFilter by a specific watch UUID
limitintegerMax results (default: 50)
offsetintegerPagination offset (default: 0)

Response: 200 OK

json
{
  "sends": [
    {
      "id": "880e8400-e29b-41d4-a716-446655440000",
      "user_id": "550e8400-e29b-41d4-a716-446655440000",
      "task_id": "660e8400-e29b-41d4-a716-446655440000",
      "execution_id": "770e8400-e29b-41d4-a716-446655440000",
      "recipient": "[email protected]",
      "notification_type": "email",
      "status": "sent",
      "error_message": null,
      "created_at": "2025-01-15T09:00:10Z"
    }
  ],
  "total": 42
}

Examples:

bash
# Get all notification sends
curl -X GET https://api.webwhen.ai/api/v1/notifications/sends \
  -H "Authorization: Bearer sk_..."

# Filter by type
curl -X GET "https://api.webwhen.ai/api/v1/notifications/sends?notification_type=webhook" \
  -H "Authorization: Bearer sk_..."

# Filter by watch
curl -X GET "https://api.webwhen.ai/api/v1/notifications/sends?task_id=660e8400..." \
  -H "Authorization: Bearer sk_..."

# Paginate
curl -X GET "https://api.webwhen.ai/api/v1/notifications/sends?limit=10&offset=20" \
  -H "Authorization: Bearer sk_..."

Notification send object

FieldTypeDescription
idUUIDSend record ID
user_idUUIDWatch owner
task_idUUIDAssociated watch
execution_idUUIDExecution that triggered the send
recipientstringEmail address (for email type)
notification_typestringemail or webhook
statusstringDelivery status
error_messagestring/nullError if delivery failed
created_attimestampWhen the send was attempted

Per-watch trigger feed

Get executions where the condition was met for a specific watch. This is a filtered view of the Executions API.

Endpoint: GET /api/v1/tasks/{task_id}/notifications

See Executions API — Per-watch trigger feed for details.

Difference between the endpoints

Feature/notifications/sends/tasks/{id}/notifications
ScopeAll watchesSingle watch
What it tracksEmail/webhook delivery attemptsExecutions where the condition was met
Response typeSend records with delivery statusExecution objects with results
Use caseAudit notification deliveryView what triggered

Next steps

Released under the MIT License.