User onboarding
Log in, create a user, fetch it back, then delete it.
Not run yet.
Live demo — Zod-first schemas, runtime validation, OpenAPI 3.1 export with proper security schemes, per-route security overrides, hidden-from-docs flag, header auth, nested routers, and saved flows. Try POSTing {} to /users to see the v1.6 422 validation response, or hit /docs/openapi.json to inspect the v1.8 spec with components.securitySchemes wired up.
| Method | Path | Params |
|---|---|---|
| GET |
/
|
—
›
|
|
No traffic observed yet — hit this endpoint at least once to capture payload schemas. |
||
| Method | Path | Params |
|---|---|---|
| GET |
/admin/stats
Platform-wide statistics snapshot.
|
—
›
|
|
Request Headers Authorization:Bearer <admin-token> Query None observed Response {5 props totalUsers: number activeUsers: number totalProducts: number ordersToday: number revenue: number |
||
| DELETE |
/admin/users/:id
Permanently delete a user account (admin only).
|
id
›
|
|
Request Headers Authorization:Bearer <admin-token> Query None observed Response {3 props deleted: boolean userId: number deletedAt: string Errors 403 Admin role required {2 props message: string code?: string |
||
| Method | Path | Params |
|---|---|---|
| POST |
/auth/login
Authenticate with email + password. Returns a JWT pair.
|
—
›
|
|
Request Headers Content-Type:application/json Body {2 props email: string password: string Query None observed Response {4 props token: string refreshToken: string expiresIn: number user: {3 props id: number email: string role: string Errors 401 Invalid email or password {2 props message: string code?: string 422 Validation failed {2 props message: string code?: string |
||
| POST |
/auth/logout
Revoke the current session.
|
—
›
|
|
Request Headers Authorization:Bearer <token> Body No body observed Query None observed Response {1 prop success: boolean |
||
| POST |
/auth/refresh
Exchange a refresh token for a new access token.
|
—
›
|
|
Request Headers Content-Type:application/json Body {1 prop refreshToken: string Query None observed Response {2 props token: string expiresIn: number Errors 401 Refresh token expired or revoked {2 props message: string code?: string |
||
| Method | Path | Params |
|---|---|---|
| GET |
/products
List products. No auth required — public catalog.
|
—
›
|
|
Request Query None observed Response {2 props products: [object[] {5 props ]id: number name: string price: number category: string inStock: boolean total: number |
||
| POST |
/products
Create a new product (admin only).
|
—
›
|
|
Request Headers Authorization:Bearer <token> Content-Type:application/json Body {4 props name: string price: number category: string inStock?: boolean Query None observed Response {5 props id: number name: string price: number category: string inStock: boolean Errors 403 Forbidden — admin role required {2 props message: string code?: string 422 Validation failed {2 props message: string code?: string |
||
| GET |
/products/:id
Get a single product.
|
id
›
|
|
Request Query None observed Response {5 props id: number name: string price: number category: string inStock: boolean Errors 404 Product not found {2 props message: string code?: string |
||
| Method | Path | Params |
|---|---|---|
| GET |
/users
List users with optional role filter, search and pagination.
|
—
›
|
|
Request Headers Authorization:Bearer <token> Query {4 props role?: string search?: string page?: number limit?: number Response {4 props users: [object[] {6 props ]id: number name: string email: string role: string active: boolean createdAt: string total: number page: number limit: number |
||
| POST |
/users
Create a new user. Try POSTing `{}` to see the v1.6 validation middleware return 422.
|
—
›
|
|
Request Headers Authorization:Bearer <token> Content-Type:application/json Body {3 props name: string email: string role?: string Query None observed Response {6 props id: number name: string email: string role: string active: boolean createdAt: string Errors 409 Email already in use {2 props message: string code?: string 422 Validation failed {2 props message: string code?: string |
||
| DELETE |
/users/:id
Delete a user.
|
id
›
|
|
Request Headers Authorization:Bearer <token> Query None observed Response {2 props deleted: boolean id: number Errors 401 Unauthorized {2 props message: string code?: string 403 Forbidden — cannot delete another admin account {2 props message: string code?: string 404 User not found {2 props message: string code?: string |
||
| GET |
/users/:id
Fetch a single user by id.
|
id
›
|
|
Request Headers Authorization:Bearer <token> Query None observed Response {6 props id: number name: string email: string role: string active: boolean createdAt: string Errors 401 Missing or invalid Authorization header {2 props message: string code?: string 404 User not found {2 props message: string code?: string |
||
| PATCH |
/users/:id
Partially update a user record.
|
id
›
|
|
Request Headers Authorization:Bearer <token> Content-Type:application/json Body {2 props name?: string email?: string Query None observed Response {6 props id: number name: string email: string role: string active: boolean createdAt: string Errors 404 User not found {2 props message: string code?: string 422 Validation failed {2 props message: string code?: string |
||
Create one flow for one named piece of logic, such as User onboarding, Login smoke, or Checkout happy path. Keep the sequence focused and ordered.
Use inputs for values the runner should ask for at runtime, such as email, name, or tenantId. Mark required inputs with "required": true.
Use extract to capture values from a response, then reuse them in later steps with {{vars.someName}}. Common examples are IDs, tokens, and timestamps.
Each step should validate the expected behavior. Start with status, then add body checks like "$.id" or "$.email". This keeps the same flow useful as an integration test.
{{input.email}}: runtime values entered in the UI or CLI{{vars.userId}}: values extracted from previous steps{{env.baseUrl}}: environment values loaded from the flow or env file{
"baseUrl": "{{env.baseUrl}}",
"request": {
"path": "/users/{{vars.userId}}",
"body": {
"email": "{{input.email}}"
}
}
}
{
"id": "create-user",
"request": {
"method": "POST",
"path": "/users",
"body": { "email": "{{input.email}}" }
},
"extract": {
"userId": { "from": "body", "path": "$.id" }
},
"assert": {
"status": 201
}
}
{
"extract": {
"userId": { "from": "body", "path": "$.id" },
"etag": { "from": "header", "path": "etag" }
},
"assert": {
"status": 201,
"body": {
"$.email": "{{input.email}}"
},
"exists": ["$.id", "$.createdAt"]
}
}
{
"version": 1,
"name": "User onboarding",
"baseUrl": "http://localhost:3000",
"inputs": {
"email": { "type": "string", "required": true },
"name": { "type": "string", "required": true }
},
"steps": [
{
"id": "create-user",
"request": {
"method": "POST",
"path": "/users",
"body": {
"email": "{{input.email}}",
"name": "{{input.name}}"
}
},
"extract": {
"userId": { "from": "body", "path": "$.id" }
},
"assert": { "status": 201 }
},
{
"id": "get-user",
"request": {
"method": "GET",
"path": "/users/{{vars.userId}}"
},
"assert": {
"status": 200,
"body": { "$.id": "{{vars.userId}}" }
}
}
]
}
Store flow files in doctreen-flows/*.json or configure flowsPath. The same definition can be run here in the docs UI or headlessly with doctreen-flow run ....
Select documented routes, configure steps, and export a reusable flow JSON draft.
{
"version": 1,
"name": "",
"description": "",
"baseUrl": "{{env.baseUrl}}",
"env": {
"baseUrl": "http://localhost:3000"
},
"inputs": {
"email": { "type": "string", "required": true }
},
"steps": []
}
Log in, create a user, fetch it back, then delete it.
Not run yet.
Public product listing and detail check — no auth.
Not run yet.