Skip to main content
Routes can be API endpoints or pages. API routes return JSON and are always public. Pages render React components and can be public or require authentication.

Parameters

path
string
required
Route path starting with ’/’. Use ’/’ for custom home page.
route_type
string
required
Either ‘api’ or ‘page’.
code
string
Full replacement source code. Must be valid TypeScript/TSX with a default export. Use for new routes or total rewrites. Mutually exclusive with code_edit.
code_edit
string
Partial edit of the route code — only the changed sections. Use ’// … existing code …’ for unchanged parts. Preferred for updating existing routes. Mutually exclusive with code.
edit_instructions
string
A sentence describing what the edit does, to help disambiguate. Used with code_edit.
public
boolean
Whether the route is publicly accessible. API routes are always public. For pages, omit to preserve current visibility on updates; defaults to False for new pages (True for homepage).