API Endpoints

Create REST API endpoints and connect them to your backend logic.

API Endpoints

Create REST API endpoints that your frontend or any HTTP client can call. Each endpoint maps a URL and HTTP method to a function that handles the request.

The API section showing all endpoints organized by route prefix in the sidebar
All your endpoints organized by route prefix — click any to edit

Quick walkthrough

Create an endpoint

Click Endpoints in the sidebar, then Add Endpoint.

Set method and path

Choose the HTTP method (GET, POST, PUT, DELETE) and enter a path like /api/cases or /api/cases/:id. The :id segment is a path parameter - it matches any value and is available in your function as params.id.

Attach a function

Select the function that handles the request. The function runs when someone calls this endpoint.

Test it

Open the Playground and send a request to see the response.

Publish when ready

Review the changes and publish when the endpoint should be available to live clients.

Pro tip

Most APIs follow a standard pattern. For a cases resource, you would typically create five endpoints: list, get, create, update, and delete.

Common endpoint patterns

| Method | Path            | Function       | What it does       |
|--------|----------------|----------------|--------------------|
| GET    | /api/cases       | List Cases     | Get all cases      |
| GET    | /api/cases/:id   | Get Case       | Get one case       |
| POST   | /api/cases       | Create Case    | Create a new case  |
| PUT    | /api/cases/:id   | Update Case    | Update a case      |
| DELETE | /api/cases/:id   | Delete Case    | Delete a case      |

Learn more

Endpoint Controls

Endpoints can also control operational behavior:

- Authentication - require JWT auth for protected routes.
- Inputs - define path, query, body, and file inputs for clearer testing and docs.
- Rate limiting - protect expensive or public routes from abuse.
- Hide from API docs - keep internal or experimental routes out of generated public docs.
- AI summary - ask AI to draft a human-readable endpoint description for docs and review.
- Requests - inspect recent request history when debugging live behavior.
Create an Endpoint
Step-by-step guide to setting up endpoints with methods, paths, and functions.
/endpoints/creating-endpoints
Inputs & Outputs
Handle path parameters, query strings, request bodies, and responses.
/endpoints/inputs-outputs
Protect Your Endpoints
Add authentication with JWT tokens and role-based access.
/endpoints/authentication
Functions
/flows
Build the logic that powers your endpoints
Publish
/features/publish-export
Review and publish endpoints for live clients
Build a REST API
/guides/build-rest-api
Step-by-step guide to creating a complete API