wispfnDocs
REST API

List, create, update, schedule, delete and run a project's functions with the REST API.

:function is the function's name or id. Every change creates a new draft version.

GET    /api/projects/:id/functions
GET    /api/projects/:id/functions/:function
POST   /api/projects/:id/functions
PATCH  /api/projects/:id/functions/:function
DELETE /api/projects/:id/functions/:function
POST   /api/projects/:id/functions/:function/invoke

#Create a function

FieldTypeDefaultDescription
namestring—Lowercase letters, digits, -, _. before and after create the special functions.
codestring—The complete source file
httpbooleantrueExpose over HTTP at <project url>/<name>
methodstringGET (POST without HTTP)GET, POST, PUT, PATCH, DELETE
visibilitystringpublicpublic, private or internal (HTTP functions)
mcpbooleanpublic HTTP functionsOffer it as an MCP tool
beforeAfterbooleantruefalse skips before and after
callablebooleantruefalse: other functions can't call it (only schedules, MCP and the console). Always true with a public API
scheduleobject?nullWhen it runs on its own — see below
cacheobject?null{ "seconds": 300 } to turn on edge caching (GET only)
languagestring?project'sjavascript or python
descriptionstring""Up to 500 characters
inputSchemaobject?nullJSON Schema of the input
outputSchemaobject?nullJSON Schema of the response
exampleQuery, exampleBodystring?nullPrefill the console's Test / Run
curl -X POST https://wispfn.com/api/projects/$PROJECT/functions \
  -H "Authorization: Bearer $WISP_API_KEY" -H "content-type: application/json" \
  -d '{"name":"ping","code":"export async function handler() { return { status: 200, body: { pong: true } }; }"}'

Returns { "function": { … }, "version": 7, "deploy": { … } }.

A function without HTTP is always private and uses POST; it can't be cached. before and after are never exposed: http, mcp and schedule are refused for them.

#Update settings and schedule

PATCH with any of the fields above except code (use Code):

{ "schedule": { "cron": "0 9 * * 1", "timezone": "Europe/Berlin", "description": "Mondays at 9", "enabled": true } }

Set schedule to null to remove it. Schedules run the published version. Turning http on makes the function public unless you send visibility.

#Run a function

POST /functions/:function/invoke runs it now — private ones and those without HTTP too — against the draft ("mode": "test") or the live version. See Runtime.