Overview
@Endpoint() turns Python functions into serverless API endpoints - like AWS Lambda, but simpler.
What are Endpoints?
Endpoints are serverless API functions that:- Respond to HTTP requests (GET, POST, PUT, DELETE)
- Scale automatically with traffic
- Return JSON responses
- Have built-in authentication
- Support path parameters and query strings
Building Endpoints
Basic Endpoint
Endpoint Parameters
string
required
Unique endpoint identifier (alphanumeric, underscores, hyphens)
string
required
Human-readable name
string
required
What the endpoint does
string
default:"POST"
HTTP method:
GET, POST, PUT, DELETE, PATCHstring
Custom URL path (e.g.,
/users/{id})If not provided, defaults to /endpoints/{id}boolean
default:"true"
Require API key authentication
int
default:"30"
Max execution time in seconds
int
Max requests per minute
HTTP Methods
GET Endpoint
Fetch data:POST Endpoint
Create data:PUT Endpoint
Update data:DELETE Endpoint
Delete data:Path Parameters
Use{parameter} in path:
Query Parameters
Accept query strings as function parameters:Response Format
Return a dict withstatus and body:
200- OK201- Created400- Bad Request401- Unauthorized404- Not Found500- Internal Server Error
Authentication
Require Auth (Default)
By default, endpoints require API key authentication:Public Endpoint
Disable authentication for public endpoints:Rate Limiting
Limit requests per minute:Using Database
Store and query data:Using Integrations
Call external APIs:Complete Example: REST API
Best Practices
Use appropriate HTTP methods
Use appropriate HTTP methods
Follow REST conventions:
- GET - Fetch data (read-only)
- POST - Create resources
- PUT - Update resources (full update)
- PATCH - Partial update
- DELETE - Delete resources
Return proper status codes
Return proper status codes
Handle errors gracefully
Handle errors gracefully
Use rate limiting for public endpoints
Use rate limiting for public endpoints
Next Steps
Database
Store data persistently
Deploying
Deploy your endpoints
Integrations
Use integrations in endpoints
Actions
Build actions for complex logic