-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Implement POST /routines — Create Routine with First Time Block
Endpoint
POST /api/v1/routines (Bearer JWT auth)
What it does
Creates a new routine for the authenticated user along with the first time block and its sessions. Used when no routine exists yet for the user.
Request Body (CreateTimeBlockRequest)
{
"time": "06:00",
"time_int": 600,
"notification_enabled": true,
"sessions": [
{
"session_type": "PLAN",
"source_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"display_order": 0
}
]
}Success Response — 201
Returns RoutineWithTimeBlocksResponse:
{
"id": "routine-uuid",
"time_blocks": [
{
"id": "time-block-uuid",
"time": "06:00",
"time_int": 600,
"notification_enabled": true,
"sessions": [
{
"id": "session-uuid",
"session_type": "PLAN",
"source_id": "a1b2c3d4-...",
"title": "AIY - Introduction",
"language": "en",
"image_url": "https://...",
"display_order": 0
}
]
}
]
}Error Responses
| Code | Meaning |
|---|---|
| 401 | Invalid/missing JWT |
| 409 | Routine already exists for this user |
| 422 | Validation error (no sessions, duplicate plan, bad time format) |
Validation Rules
- Must have at least one session
- A plan
source_idcan only appear once across the entire routine timemust be valid HH:MM 24-hour format (00:00–23:59)session_typeis eitherPLANorRECITATION
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
IN PROGRESS