Edge Functions HTTP API reference
The complete HTTP surface of the functions service, with the role each route requires.
1. Conventions
Base URL. The URL of your project, for example https://my-app.aurabase.cloud. The project is identified by the host, so the paths below carry no project id. The long form /v1/functions/{project_id}/… is accepted as well.
Authentication. Send your key in the apikey header. Add Authorization: Bearer <JWT> to call as a signed-in user. The Studio calls the same routes with a console session token, which gives it the admin role.
| Role | How you get it | May call |
|---|---|---|
anon | The public key of the project | POST …/invoke |
authenticated | The public key plus a user's JWT | POST …/invoke |
service_role | The service_role key (server only) | Every route below |
admin | A console session (the Studio) | Every route below |
Any other route answers 403 to anon and authenticated:
Format. Bodies are JSON and need Content-Type: application/json. A success is { "data": …, "meta": null }. A failure is { "error": { "code", "message", "type", "request_id" } }.
Function object.
| Field | Type | |
|---|---|---|
id, project_id, name | string | |
runtime | "deno" or "wasm" | |
code | string | Source for deno; base64 of the compiled binary for wasm |
code_hash | string | SHA-256 of code |
env_vars | object | Key to value |
permissions | object | allow_net (string array), memory_mb, timeout_secs |
is_active | boolean | |
created_at, updated_at | ISO 8601 |
2. Functions
| Method and path | Role | Body | Response |
|---|---|---|---|
GET /v1/functions | service_role | none | array of function objects |
POST /v1/functions | service_role | { name, runtime, code, env_vars? } | the function object |
GET /v1/functions/{name} | service_role | none | the function object. {name} is the name, or the id when no function has that name. |
PATCH /v1/functions/{name} | service_role | { code?, env_vars?, is_active?, permissions? } | the function object |
DELETE /v1/functions/{name} | service_role | none | { "data": null } |
GET /v1/functions/{name}/code | service_role | none | { "data": { "code": "…" } } |
GET /v1/functions/{name}/env | service_role | none | { "data": [ { "key", "value" } ] }, values decrypted |
PUT /v1/functions/{name}/env | service_role | { "vars": [ { "key", "value" } ] } | { "data": null } |
Notes:
POSTis an upsert onname: posting an existing name replaces its code. Anenv_varsfield in that body replaces the existing variables; omit it to keep them.- In
PATCH,permissionsis merged field by field:{ "permissions": { "timeout_secs": 60 } }keepsallow_netandmemory_mb. A field outside its bounds returns400. PUT …/envreplaces the whole set of variables and is the only route that encrypts them. See secrets.- A function with
is_active: falseis not found byinvokeor by jobs.
3. Invoke
POST /v1/functions/{name}/invoke. Role: anon, authenticated or service_role.
| Field | Type | Default | |
|---|---|---|---|
method | string | POST | HTTP method seen by the function |
path | string | / | Path seen by the function |
headers | object | none | Headers given to the function. Reserved headers are dropped. |
body | any JSON | none | Body given to the function |
| Request header | |
|---|---|
apikey | Required |
Content-Type: application/json | Required |
Authorization: Bearer <JWT> | Optional: call as that user |
X-Aurabase-Invoke-Mode: raw | Optional: return the function's own response |
Default response, always 200:
status is the status of your function. logs is empty for deno. In raw mode the response is your function's own: status, content-type, bytes, plus x-aurabase-invoke-origin: function.
| Failure | Status | error.code |
|---|---|---|
| Function not found or inactive | 404 | NOT_FOUND |
| Runtime unreachable | 503 | SERVICE_UNAVAILABLE |
The platform stopped waiting for the runtime (after timeout_secs plus a margin) | 504 | TIMEOUT |
| Plan quota exhausted | 403 | QUOTA_EXCEEDED |
| Too many calls from one client | 429 | rate_limit_exceeded |
| Body above about 256 KiB | 503 | SERVICE_UNAVAILABLE |
4. Jobs and dead-letter queue
| Method and path | Role | Body or query | Response |
|---|---|---|---|
POST /v1/functions/jobs | service_role | { function_name, payload?, delay_secs?, max_attempts? } | the job |
GET /v1/functions/jobs | service_role | ?status=&limit= (1 to 500, default 50) | array of jobs |
GET /v1/functions/jobs/{id} | service_role | none | the job |
POST /v1/functions/jobs/{id}/retry | service_role | none | the job, back to pending |
GET /v1/functions/jobs/dlq | service_role | ?limit= | array of dead jobs |
POST /v1/functions/jobs/dlq/requeue | service_role | none | { "data": { "requeued": 1 } } |
Job object: id, project_id, function_name, payload, status (pending, running, completed, failed, dead), attempts, max_attempts, error, scheduled_at, started_at, completed_at, created_at. Behaviour: Jobs, cron and the dead-letter queue.
5. Cron
| Method and path | Role | Body | Response |
|---|---|---|---|
POST /v1/functions/cron | service_role | { name, schedule, function_name, payload? } | the cron entry |
GET /v1/functions/cron | service_role | none | array of entries |
DELETE /v1/functions/cron/{name} | service_role | none | { "data": null }, or 404 for an unknown name |
Entry: id, project_id, name, schedule (stored with 6 fields), function_name, payload, is_active, last_run, next_run, created_at.
6. Alerts
| Method and path | Role | Body or query |
|---|---|---|
POST /v1/functions/alerts | service_role | { name, metric, condition, threshold, channel, destination } |
GET /v1/functions/alerts | service_role | none |
PATCH /v1/functions/alerts/{id} | service_role | { "enabled": true } |
DELETE /v1/functions/alerts/{id} | service_role | none |
GET /v1/functions/alerts/{id}/events | service_role | ?limit=&offset= |
GET /v1/functions/alerts/events | service_role | ?limit=&offset= |
Values and behaviour: Alerts.