Skip to content

Functions API

MethodPathPurpose
POST/v1/{app_id}/functionsDeploy or update a function
GET/v1/{app_id}/functionsList all functions
GET/v1/{app_id}/functions/{name}Get function details and metrics
DELETE/v1/{app_id}/functions/{name}Delete a function
POST/v1/{app_id}/functions/{name}/invokeTest-invoke a function
GET/v1/{app_id}/functions/{name}/logsView invocation logs
MethodPathPurpose
ANY/v1/{app_id}/fn/{function_name}Call a deployed function (any HTTP method)

End-user tokens are forwarded to the function.

POST /v1/{app_id}/functions
Authorization: Bearer {token}
{
"name": "hello-world",
"code": "export default async function handler(req) {\n return new Response(JSON.stringify({ message: 'Hello!' }), {\n headers: { 'Content-Type': 'application/json' }\n });\n}",
"description": "A simple greeting function",
"trigger": {
"type": "http",
"config": {}
},
"envVars": {
"API_KEY": "secret123"
},
"timeoutMs": 30000,
"memoryLimitMb": 128
}
FieldDescription
nameUnique name (1-100 characters)
codeSource code with default export handler
FieldDefaultDescription
descriptionWhat the function does
envVarsEnvironment variables (encrypted)
timeoutMs30000Max execution time (max: 300000)
memoryLimitMb128Memory limit (range: 64-1024)
trigger.typehttphttp, cron, or websocket
trigger.config{}Trigger-specific config
TypeConfigExample
http{}
cron{"schedule": "cron_expr"}{"schedule": "*/5 * * * *"}
websocket{"event": "event_name"}{"event": "chat_message"}
PATCH /v1/{app_id}/functions/{name}/env
Authorization: Bearer {token}
{
"API_KEY": "new-secret",
"NEW_VAR": "value"
}
GET /v1/{app_id}/functions/{name}/logs?limit=50&since=2026-01-01T00:00:00Z&level=error
ParameterDescription
limitNumber of log entries
sinceISO date filter
levelFilter by level (error, info)
FieldDescription
methodHTTP method
pathRequest path
status_codeResponse status
duration_msExecution time
memory_mbMemory used
errorError message (if any)
MetricDescription
total_invocationsTotal invocation count
error_countNumber of errors
error_rateError percentage
avg_duration_msAverage execution time
last_invocationTimestamp of last call