Wizard State Manager
API Contract
REST
/api/v1/wizard-sessions
8 endpoints
GET
/api/v1/wizard-sessions/api/v1/wizard-sessions
List active wizard sessions for the authenticated user
Public
Response Example
{
"data": [
{
"session_id": "sess-7f3a92b1",
"wizard_id": "onboarding-wizard-v3",
"user_id": "usr-00124",
"current_step_index": 2,
"total_steps": 6,
"status": "in_progress",
"started_at": "2026-03-26T08:30:00Z",
"last_activity_at": "2026-03-26T08:42:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1
}
}
GET
/api/v1/wizard-sessions/api/v1/wizard-sessions/:id
Get a specific wizard session with current answers
Public
Response Example
{
"session_id": "sess-7f3a92b1",
"wizard_id": "onboarding-wizard-v3",
"user_id": "usr-00124",
"current_step_index": 2,
"total_steps": 6,
"status": "in_progress",
"answers": {
"screen-01": {
"chosen": [
"opt-b"
]
},
"screen-02": {
"chosen": [
"opt-a",
"opt-c"
]
}
},
"started_at": "2026-03-26T08:30:00Z",
"last_activity_at": "2026-03-26T08:42:00Z"
}
POST
/api/v1/wizard-sessions/api/v1/wizard-sessions
Start a new wizard session
Public
Request Example
{
"wizard_id": "onboarding-wizard-v3",
"user_id": "usr-00124",
"locale": "en-IE"
}
Response Example
{
"session_id": "sess-9c1d45e2",
"wizard_id": "onboarding-wizard-v3",
"user_id": "usr-00124",
"current_step_index": 0,
"total_steps": 6,
"status": "in_progress",
"started_at": "2026-03-26T10:30:00Z"
}
PUT
/api/v1/wizard-sessions/api/v1/wizard-sessions/:id
Update session state (advance, go back, or save answers)
Public
Request Example
{
"action": "next_step",
"answers": {
"screen-02": {
"chosen": [
"opt-a"
]
}
}
}
Response Example
{
"session_id": "sess-7f3a92b1",
"current_step_index": 3,
"status": "in_progress",
"answers": {
"screen-01": {
"chosen": [
"opt-b"
]
},
"screen-02": {
"chosen": [
"opt-a"
]
}
},
"updated_at": "2026-03-26T10:35:00Z"
}
DELETE
/api/v1/wizard-sessions/api/v1/wizard-sessions/:id
Terminate and discard a wizard session
Public
Response Example
{
"deleted": true,
"session_id": "sess-7f3a92b1"
}
POST
/api/v1/wizard-sessions/api/v1/wizard-sessions/:id/next-step
Advance the session to the next wizard step
Public
Request Example
{
"answers": {
"screen-03": {
"chosen": [
"opt-c"
]
}
}
}
Response Example
{
"session_id": "sess-7f3a92b1",
"previous_step_index": 2,
"current_step_index": 3,
"status": "in_progress"
}
POST
/api/v1/wizard-sessions/api/v1/wizard-sessions/:id/previous-step
Navigate the session back one step
Public
Response Example
{
"session_id": "sess-7f3a92b1",
"previous_step_index": 3,
"current_step_index": 2,
"status": "in_progress"
}
POST
/api/v1/wizard-sessions/api/v1/wizard-sessions/:id/save-draft
Persist current session state as a resumable draft
Public
Request Example
{
"answers": {
"screen-01": {
"chosen": [
"opt-b"
]
},
"screen-02": {
"chosen": [
"opt-a"
]
}
}
}
Response Example
{
"draft_id": "draft-44ab12f0",
"session_id": "sess-7f3a92b1",
"step_index": 2,
"saved_at": "2026-03-26T10:40:00Z"
}