Skip to main content
POST
Create new function

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

Display name for the function

Minimum string length: 1
Example:

"Hello World Function"

code
string
required

JavaScript/TypeScript code that exports an async function

Minimum string length: 1
Example:

"export default async function(request) {\n const { name = 'World' } = await request.json();\n return new Response(\n JSON.stringify({ message:Hello, ${name}!}),\n { headers: { 'Content-Type': 'application/json' } }\n );\n}\n"

slug
string

URL-friendly identifier (auto-generated from name if not provided)

Pattern: ^[a-zA-Z0-9_-]+$
Example:

"hello-world"

description
string

Description of what the function does

Example:

"Returns a personalized greeting message"

status
enum<string>
default:active

Initial status (draft or active/deployed)

Available options:
draft,
active

Response

Function created successfully

success
boolean
function
object