Functions API
Custom HTTP function endpoints. All HTTP methods supported.
Custom Functions
ALL /api/functions/:functionName
Executes a user-defined HTTP function. Any HTTP method can be used (GET, POST, PUT, DELETE, etc.).
curl https://your-project.edgebase.dev/api/functions/my-function \
-H "Authorization: Bearer <accessToken>" \
-H "Content-Type: application/json" \
-d '{"input": "data"}'
Auth: Depends on function implementation. Functions can access auth from the context to check authentication.
Request/Response: Entirely determined by the function implementation. The function receives the full HTTP request and returns a custom response.
SQL Endpoint
POST /api/sql
Execute raw SQL against a table's Durable Object SQLite database.
Auth: Service Key required (X-EdgeBase-Service-Key header).
| Field | Type | Required | Description |
|---|---|---|---|
namespace | string | Yes | Database namespace (e.g., "shared") |
id | string | No | Instance ID for dynamic DB blocks |
sql | string | Yes | SQL query |
params | array | No | Parameter bindings |
Request example:
{
"namespace": "shared",
"sql": "SELECT * FROM posts WHERE status = ?",
"params": ["published"]
}
Response 200 — Result array.
warning
Raw SQL bypasses access rules. Only use with Service Key from trusted server-side code.