Skip to main content

Functions reference

Look up the endpoints, fields, execution modes, and status codes a function exposes.

All function endpoints are app-scoped and nested under an app slug. Lookup is by function slug, which is unique within an app rather than globally.

Interface support​

Start from the task. A checkmark means that interface supports the workflow; an em dash means to choose another interface.

WorkflowJavaScriptPythonRESTConsoleGuide
Execute a function and wait for the result✓✓✓✓Execute a function
Execute a function and return immediately✓✓✓✓Execute a function
Read an execution result by task ID—✓✓✓Execute a function
List functions in an app—✓✓✓Write a function
Read one function—✓✓✓Write a function
Create a function——✓✓Create, run, and delete a function
Update a function or its code——✓✓Write a function
Delete a function——✓✓Security and limits
List version history——✓✓Versioning
Revert to an earlier version——✓✓Versioning
List invocations for one function——✓✓Logs and invocations
List invocations across the site—✓✓—Logs and invocations
Read captured execution logs——✓✓Logs and invocations
Define cron schedules——✓✓Schedules
Filter event-triggered runs——✓✓Filter conditions

The JavaScript SDK has one function method, execute. For everything else, use the Python SDK, REST, or Console.

Endpoints​

{app_slug} is the app slug and {slug} is the function slug.

MethodPathPurpose
GET/api/apps/{app_slug}/functions/List functions in the app
POST/api/apps/{app_slug}/functions/Create a function
GET/api/apps/{app_slug}/functions/{slug}/Read one function
PATCH/api/apps/{app_slug}/functions/{slug}/Update selected fields
PUT/api/apps/{app_slug}/functions/{slug}/Replace the function
DELETE/api/apps/{app_slug}/functions/{slug}/Delete the function
POST GET PATCH PUT/api/apps/{app_slug}/functions/{slug}/execute/Execute the function
GET/api/apps/{app_slug}/functions/{slug}/history/List versions
POST/api/apps/{app_slug}/functions/{slug}/revert/Revert to a version
GET/api/apps/{app_slug}/functions/{slug}/executions/List invocations for this function
GET/api/apps/{app_slug}/functions/{slug}/executions/{execution_id}/Read one invocation, including the executed code
GET/api/invocations/List invocations across the site
GET/api/invocations/{id}/Read one invocation
GET/api/invocations/{id}/result/Read the task result for an invocation
GET/api/invocations/by-task-id/{task_id}/Read an invocation by its task ID (celery_task_id)
GET/api/result/{task_id}/Read a task result by its task ID

The execute action accepts four HTTP methods. The verb used reaches the function in params as __method__.

Every endpoint except execute and /api/result/{task_id}/ requires an organization owner or admin, or another cloud user with access to the site. The /api/invocations/ endpoints are scoped to the site, not to an app, and return invocations for every app in the site. /api/result/{task_id}/ is open to any signed-in caller, but only organization users see the traceback of a failed run. See Security and limits.

Function fields​

FieldTypeWritableBehavior
namestring, max 255✓Source of the generated slug
slugstring, max 255—Generated from name, de-duplicated with a numeric suffix, unique per app
appapp reference—Set from the URL
execution_modeapp · proxy✓No default; required on create
environmentstring—Read-only. Always python
descriptionstring✓Free text
codestring✓Python source for app mode
webhook_urlURL, max 500✓Required for proxy mode
auth_configobject✓Proxy authentication. Accepts bearer, api_key, basic, custom
headersobject✓Additional proxy request headers
configobject✓Scheduling options such as countdown (delay in seconds) and expires. Also carries timeout for proxy requests
paramsobject or null✓JSON Schema describing expected parameters
filter_conditionsstring or null✓CEL expression, evaluated for event triggers only
is_activeboolean✓Defaults to true. Inactive functions return 404 from execute
async_modeboolean✓Default execution style, overridable per request
is_publicboolean✓Defaults to false. Permits execution without authentication
tagslist✓Filterable by name, case-insensitive
versioninteger—Incremented when a versioned field changes
total_versionsinteger—Count of history records
scheduleslist✓Cron schedules, written through the function body

id, created_at, updated_at, created_by, and modified_by are also read-only.

Fields that create a version​

Changing any of these increments version and writes a history record: name, code, webhook_url, auth_config, headers, config, filter_conditions, execution_mode, is_active, async_mode, description.

A request that changes nothing in that list returns HTTP 200 with a body whose status is error, the message No changes detected, version unchanged, and code BAD_REQUEST. Treat 200 as "request handled", not as "function updated".

Revert restores code and filter_conditions only. Other versioned fields keep their current values, and the version counter advances rather than rewinding.

Execution modes​

ModeRequiresResult shape
appapp, coderesult, stdout, stderr, logs, success
proxyapp, webhook_urlstatus_code, response, headers, success

Execute request​

{
"params": {"order_id": 123},
"async": false
}

Query-string parameters are merged into params, with body values taking precedence on a key collision. When async is omitted, the function's async_mode applies.

A synchronous call returns 200 with the function's return value in data and the invocation record alongside it. An asynchronous call returns 202 with data set to null and an invocation record carrying celery_task_id, which is the handle for later result lookups.

Function signature​

App-mode code must define main taking exactly three parameters:

main.py
def main(params, user_data, sdk_client):
return {"ok": True}

Validation on write requires the literal text def main(params, user_data, sdk_client): to appear in the code. This is an exact string match, so type annotations, renamed parameters, or different spacing are rejected even when the resulting function would run. At execution time, main must additionally exist, be callable, and accept exactly three parameters.

ParameterCarries
paramsThe caller's input, merged with query-string values, plus the keys below
user_dataThe authenticated caller. For an unauthenticated call to a public function, it identifies the platform rather than a person
sdk_clientA TaruviBase SDK client authenticated as the caller, so the function reaches only what that caller could reach

params arrives with three keys added by the platform:

KeyContents
__function__This function's name, slug, and execution mode
requestHTTP metadata for the calling request
__method__The HTTP verb used to call the function

Trigger types​

ValueOriginFilter conditionsRuns as
apiThe execute endpointNot evaluatedThe caller
scheduleA cron scheduleNot evaluatedThe function's creator
eventAn event subscriptionEvaluated; a false result skips executionThe caller

Status and error codes​

StatusCodeCause
200—Synchronous execution completed, or a read succeeded
202—Asynchronous execution accepted
400VALIDATION_ERRORInvalid parameters, or code that fails compilation or the signature check
400BAD_REQUESTExecution failed inside the function, or an update changed nothing
403FORBIDDENAuthentication required for a non-public function, policy denied execution, or the caller lacks organization access to manage or read functions
404NOT_FOUNDThe app, function, or invocation does not exist, or the function is inactive

Limits​

These are the values in force today. Functions is in preview, so treat them as current behavior rather than fixed guarantees, and avoid depending on an exact number where your code can handle a range.

LimitValueHow to change it
Synchronous execution wait900 seconds—
Task retries3—
Proxy request timeout30 secondsSet config.timeout on the function
Log entries per execution2,000—
Log payload per execution1 MiB—
Single log message10,000 characters—
Functions per list page20 default, 1,000 maximumSend limit and offset
Invocations per list page20 default, 1,000 maximumSend page and page_size

An em dash means the platform sets the value and no request or function setting changes it.

Pace work inside your own code. A function that fans out requests, or one called in a tight loop, is bounded only by what its code does.

Invocation records persist for the life of the function; deleting the function deletes them.

Sandbox imports​

App-mode code may import the modules below and nothing else. An import outside the list raises ImportError listing the permitted modules.

GroupModules
Standard librarybase64 bisect collections copy csv datetime decimal functools hashlib heapq io itertools json logging math random re statistics string time urllib uuid warnings zipfile
HTTP clientshttpx requests urllib3
Data and formatsnumpy pandas tomli tomllib xml yaml
Dates and timesdateutil pytz
Text and markupbs4 jinja2 markdown
Cryptography and tokenscryptography jwt
Validationjsonschema pydantic
AI and language modelsanthropic cohere google langchain langchain_anthropic langchain_cohere langchain_community langchain_core langchain_google_genai langchain_openai langchain_text_splitters langgraph langsmith openai
Documents and imagesdocling docling_core fitz openpyxl pdfplumber PIL pypdf reportlab
Paymentsstripe
TaruviBasetaruvi

Submodules come with their parent, so import urllib.parse and from google import genai are both permitted.

Database drivers (psycopg2, sqlalchemy), AWS SDKs (boto3, botocore), and traceback are not allowed. Reach your site's data and storage through sdk_client instead.

For what function code can reach once it is running, see Security and limits.