DocTreen Demo API

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.

v1.9.0 14 routes 2 flows 13 with schemas

/root

1 route
Method Path Params
GET
/
No traffic observed yet — hit this endpoint at least once to capture payload schemas.

/admin

2 routes
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
}

/auth

3 routes
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
}

/products

3 routes
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
}

/users

5 routes
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
}

Flows

Run named request flows through the shared server-side flow engine.

2 flows

Flow Creator

Select documented routes, configure steps, and export a reusable flow JSON draft.

Builder
Pick route steps, then insert {{input.*}}, {{env.*}}, or prior {{vars.*}} into the focused field.
Draft Steps
No steps yet. Pick a route and add it to the flow.
Generated JSON
{
  "version": 1,
  "name": "",
  "description": "",
  "baseUrl": "{{env.baseUrl}}",
  "env": {
    "baseUrl": "http://localhost:3000"
  },
  "inputs": {
    "email": { "type": "string", "required": true }
  },
  "steps": []
}

User onboarding

Log in, create a user, fetch it back, then delete it.

4 steps
Steps
1POST/auth/login
2POST/users
3GET/users/{{vars.userId}}
4DELETE/users/{{vars.userId}}
Last result
Not run yet.
Not run yet.

Product catalog smoke

Public product listing and detail check — no auth.

2 steps
No runtime inputs required.
Steps
1GET/products
2GET/products/{{vars.firstProductId}}
Last result
Not run yet.
Not run yet.