wispfnDocs
REST API

Run functions, read logs and metrics, and list schedules with the REST API.

#Invoke

POST /api/projects/:id/functions/:function/invoke

Runs 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.

FieldTypeDefaultDescription
modestringtesttest (draft) or live
methodstring?the function'sOverride the method
subpathstring""Path after the function name
queryobject{}Query parameters
headersobject{}Headers
bodystring?nullRaw 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
QueryDescription
limit1–200, default 50
beforeCursor from the previous page
endpointFunction name or id
modetest or live
status2xx, 4xx, 5xx or errors
qText search

#Metrics

GET /api/projects/:id/metrics

Requests, 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/live

Recent requests for live debugging.

#Purge the edge cache

POST /api/projects/:id/cache/purge     { "endpointId": "e..." }

Leave out endpointId to purge every cached endpoint.