Onboarding
Onboarding flow state machine — read, start, advance, skip, complete.
Clients get the project's currently-active onboarding flow via GET /client/onboarding; state transitions use the lifecycle endpoints. user_onboarding rows are upserted on (app_user_id, flow_id).
Source: apps/api/src/routes/client/onboarding.ts.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /client/onboarding | Current flow + user progress. |
| POST | /client/onboarding/:flowId/start | Start or restart a flow. |
| POST | /client/onboarding/:flowId/advance | Advance to the next step. |
| POST | /client/onboarding/:flowId/skip | Mark the flow skipped. |
| POST | /client/onboarding/:flowId/complete | Mark the flow completed. |
GET /client/onboarding
Returns the newest active flow plus the caller's progress, or data: null if no active flow exists.
Response 200
Errors
500 FETCH_FAILED.
Try it:
/client/onboardingcurl -X GET 'https://api.amba.dev/client/onboarding'Curl:
POST /client/onboarding/:flowId/start
Upserts the user_onboarding row, setting current_step to the flow's first step id and status = 'in_progress'.
Response 201
Updated / inserted row.
Errors
500 CREATE_FAILED.
Try it:
/client/onboarding/%7B%7BflowId%7D%7D/startcurl -X POST 'https://api.amba.dev/client/onboarding/%7B%7BflowId%7D%7D/start'Curl:
POST /client/onboarding/:flowId/advance
Appends the current step to completed_steps and moves to the next step. If there's no next step, status = 'completed' and completed_at = NOW().
Response 200
Updated row.
Errors
404 NOT_FOUND— the user has nouser_onboardingrow for this flow (call/startfirst).500 UPDATE_FAILED.
Try it:
/client/onboarding/%7B%7BflowId%7D%7D/advancecurl -X POST 'https://api.amba.dev/client/onboarding/%7B%7BflowId%7D%7D/advance'Curl:
POST /client/onboarding/:flowId/skip
Sets status = 'skipped' and completed_at = NOW().
Errors
404 UPDATE_FAILED— onboarding not started.
Try it:
/client/onboarding/%7B%7BflowId%7D%7D/skipcurl -X POST 'https://api.amba.dev/client/onboarding/%7B%7BflowId%7D%7D/skip'Curl:
POST /client/onboarding/:flowId/complete
Sets status = 'completed' and completed_at = NOW().
Errors
404 UPDATE_FAILED.
Try it:
/client/onboarding/%7B%7BflowId%7D%7D/completecurl -X POST 'https://api.amba.dev/client/onboarding/%7B%7BflowId%7D%7D/complete'Curl: