REST API
Runtime
Run functions, read logs and metrics, and list schedules with the REST API.
#Invoke
POST /api/projects/:id/functions/:function/invokeRuns a function — private ones and those without HTTP included. :function is the name or the id. before and after can't be invoked on their own.
| Field | Type | Default | Description |
|---|---|---|---|
mode | string | test | test (draft) or live |
method | string? | the function's | Override the method |
subpath | string | "" | Path after the function name |
query | object | {} | Query parameters |
headers | object | {} | Headers |
body | string? | null | Raw body (JSON text for JSON APIs) |
Returns the status, headers, body, duration and logs. Uses Run credits. Scope: functions:invoke.
curl -X POST https://wispfn.com/api/projects/$PROJECT/functions/orders/invoke \
-H "Authorization: Bearer $WISP_API_KEY" -H "content-type: application/json" \
-d '{"query": {"status": "open"}}'#Logs
GET /api/projects/:id/logs?limit=50&endpoint=orders&mode=live&status=5xx&q=timeout| Query | Description |
|---|---|
limit | 1–200, default 50 |
before | Cursor from the previous page |
endpoint | Function name or id |
mode | test or live |
status | 2xx, 4xx, 5xx or errors |
q | Text search |
#Metrics
GET /api/projects/:id/metricsRequests, status classes and durations per function, by hour or day, for up to 90 days.
#Schedules
GET /api/projects/:id/schedules
POST /api/schedules/translate { "text": "every weekday at 9am", "timezone": "Europe/Berlin" }translate turns plain words into a cron expression.
#Live stream
GET /api/projects/:id/liveRecent requests for live debugging.
#Purge the edge cache
POST /api/projects/:id/cache/purge { "endpointId": "e..." }Leave out endpointId to purge every cached endpoint.