Skip to main content

Overview

The Functions API provides endpoints for invoking and managing serverless functions. In cloud environments, functions run on Deno Subhosting at the edge. In self-hosted (Docker) environments, functions run in a local Deno runtime.

Headers

For authenticated function invocations:
For admin endpoints:

Invoke Function

Execute a deployed function using any HTTP method (GET, POST, PUT, PATCH, DELETE, etc.). The server preserves and forwards the caller’s original method to the function runtime.
Note: Function invocation uses /functions/{slug} (without /api prefix), not /api/functions/{slug}.

Path Parameters

Request Body

Any JSON payload that the function expects.

Example

Response

The response depends on what the function returns:

Admin Endpoints

These endpoints require admin authentication.

List All Functions

Example

Response


Get Function Details

Example

Response


Create Function

Currently, InsForge only supports JavaScript/TypeScript functions running in a Deno environment.

Request Body

Example

Response


Update Function

Request Body

Example

Response


Delete Function

Example

Response


Function Code Structure

Functions must export a default async function that receives a Request object and returns a Response:

Accessing Request Data


Function Status


Error Responses

Function Not Found (404)

Function Not Active (404)

Execution Error (502)

When the function runtime is unreachable (self-hosted: local Deno runtime down; cloud: subhosting proxy failure):

Function Runtime Error (500)

When the function code throws an error:

Slug Already Exists (409)

Dangerous Code Detected (400)