All endpoints require authentication via a master token or JWT in the Authorization header:
Authorization: Bearer <token>
- POST
/events - Body (One-Time Event):
{
"name": "My Event",
"description": "Description...",
"start_time": "2024-04-23T10:00:00Z",
"webhook": "https://example.com/webhook",
"metadata": {"key": "value"},
"tags": ["tag1", "tag2"]
}- Body (Recurring Event):
{
"name": "My Recurring Event",
"description": "Description...",
"start_time": "2024-04-23T10:00:00Z",
"webhook": "https://example.com/webhook",
"schedule": {"frequency": "daily", "interval": 1},
"metadata": {"key": "value"},
"tags": ["tag1", "tag2"]
}- Note:
- For one-time events, omit the
schedulefield and providestart_time. - For recurring events, provide both
start_timeand ascheduleobject. - The
webhookfield is required (notwebhook_url). - The
Authorizationheader is required for all requests.
- For one-time events, omit the
- Response:
201 Created
- GET
/events/{id} - Response:
{
"id": "...",
"name": "...",
"description": "...",
...
}- GET
/events?tags=tag1,tag2 - Response: Array of events
- PUT
/events/{id} - Body: Same as create
- Response: Updated event
- DELETE
/events/{id} - Response:
204 No Content
- GET
/occurrences?tags=tag1,tag2 - Response: Paginated list of occurrences
- GET
/events/{id}/occurrences - Response: List of occurrences for the event
- GET
/occurrences/{id} - Response: Occurrence details
- POST
/tokens - Body:
{
"type": "jwt",
"sub": "user1",
"access": "read",
"scope": ["tag1", "tag2"],
"expires_at": "2024-05-01T00:00:00Z"
}- Response:
{
"token": "...",
"type": "jwt",
"sub": "user1",
"access": "read",
"scope": ["tag1", "tag2"],
"expires_at": "2024-05-01T00:00:00Z"
}- Standard error format:
{
"error": "Error message"
}For more details, see the README.