v50

latestOpenAPI 3.1.0raw.githubusercontent.com2025-06-09181183330.0 KB
functions

Create a new Function

Create a new Function.

post/groups/{groupId}/apps/{appId}/functions

Request body

can_evaluateobject

A JSON expression that evaluates to true if the Function is allowed to run in response to an incoming request.

namestring required

A unique name for the Function.

privateboolean required

If true, the function is hidden from client applications. You can still call a private function from JSON expressions and other functions, including incoming webhooks and triggers.

sourcestring required

The stringified source code for the function. The code must be valid ES6.

run_as_systemboolean

If true, the function executes with full privileges, bypassing rules on all services.

run_as_user_idstring

An application user's account ID. If defined, endpoints will always run as the specified user. Cannot be used with run_as_user_id_script_source.

run_as_user_id_script_sourcestring

The stringified source code for a function that returns an application user's account ID. If defined, endpoints execute the function on every request and run as the user with the ID returned from the function. Cannot be used with run_as_user_id.

Response

The function was successfully created.

_idstring

Unique identifier for the function.

namestring

Name for the function specified in the name field of the request.