Simple :id
A single path parameter replaced from the variables object.
ts
// Method definition with :id placeholder
getById: endpoint.get(":id").variables<{ id: number }>().response<User>()
// Usage — :id is replaced with the value from variables
await caller.users.getById({ id: 1 })
// → GET /users/1caller.users.getByIdSANDBOX
// run the request to see the responseNested :id/posts/:postId
Multiple path params in a single URL — all replaced from variables.
ts
// Multiple path params in one URL
getUserPost: endpoint.get(":id/posts/:postId").variables<{ id: number; postId: number }>().response<UserPostResponse>()
// Both :id and :postId are replaced
await caller.users.getUserPost({ id: 1, postId: 2 })
// → GET /users/1/posts/2caller.users.getUserPostSANDBOX
// run the request to see the responseQuery Params
Variables that don't match a :placeholder become query parameters.
ts
// Path params + query params work together
// Variables matching :placeholders go into the URL path
// Remaining variables go as query params
getAll: endpoint.get("").variables<{ page?: number; limit?: number }>().response<UsersListResponse>()
// No path params — all variables become ?query params
await caller.users.getAll({ page: 1, limit: 5 })
// → GET /users?page=1&limit=5caller.users.getAllSANDBOX
// run the request to see the response