Functions
Your TypeScript/JavaScript run in the SalesOS sandbox: versions, deploys, secrets, triggers, HTTP invoke
Limits, scopes, event types and starter code for the editor
Authorization
AuthorizationRequiredBearer <token>Session token from the SalesOS web app.
In: header
X-API-Key<token>API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.
In: header
List functions
Authorization
AuthorizationRequiredBearer <token>Session token from the SalesOS web app.
In: header
X-API-Key<token>API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.
In: header
ServerlessFunctionViewArray
Create a function (optionally with version 1, deployed)
Authorization
AuthorizationRequiredBearer <token>Session token from the SalesOS web app.
In: header
X-API-Key<token>API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.
In: header
Request Body
application/jsonRequiredapiNameRequiredstringStable identifier (workflow steps, HTTP path)
"^[a-z][a-z0-9_]{1,47}$"nameRequiredstring120descriptionstring1000sourcestringSource of version 1; when given, it is compiled and deployed
262144languagestring"typescript"Value in: "javascript" | "typescript"envVarsobjectNon-secret configuration, readable as env (UPPER_SNAKE_CASE names)
timeoutMsnumber10000Minimum: 1000Maximum: 30000memoryMbnumber128Minimum: 16Maximum: 128allowedHostsarray<string>Hosts fetch() may reach: api.example.com or *.example.com Items: at most 20.
runAsUserIdstringMember the salesos.* client acts as (default: you)
runAsAdminbooleanKeep the run-as user's admin visibility (off: an admin runs as a regular member)
falsescopesarray<string>READ_/WRITE_ scopes for salesos.* Items: at most 64.
httpEnabledbooleanExpose POST /functions/:id/invoke
falseeventTypesarray<string>Catalog event types that trigger the function Items: at most 20.
schedulestringFive-field cron (UTC), at most every 5 minutes; null to clear
120isActivebooleantrueHeader Parameters
Idempotency-KeystringUnique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.
255ServerlessFunctionDetail
A function with its settings and secret names
Authorization
AuthorizationRequiredBearer <token>Session token from the SalesOS web app.
In: header
X-API-Key<token>API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.
In: header
Path Parameters
idRequiredstringServerlessFunctionDetail
Update settings (triggers, limits, network allow-list, scopes)
Authorization
AuthorizationRequiredBearer <token>Session token from the SalesOS web app.
In: header
X-API-Key<token>API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.
In: header
Request Body
application/jsonRequirednamestring120descriptionstring1000envVarsobjectNon-secret configuration, readable as env (UPPER_SNAKE_CASE names)
timeoutMsnumber10000Minimum: 1000Maximum: 30000memoryMbnumber128Minimum: 16Maximum: 128allowedHostsarray<string>Hosts fetch() may reach: api.example.com or *.example.com Items: at most 20.
runAsUserIdstringMember the salesos.* client acts as (default: you)
runAsAdminbooleanKeep the run-as user's admin visibility (off: an admin runs as a regular member)
falsescopesarray<string>READ_/WRITE_ scopes for salesos.* Items: at most 64.
httpEnabledbooleanExpose POST /functions/:id/invoke
falseeventTypesarray<string>Catalog event types that trigger the function Items: at most 20.
schedulestringFive-field cron (UTC), at most every 5 minutes; null to clear
120isActivebooleantruePath Parameters
idRequiredstringHeader Parameters
Idempotency-KeystringUnique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.
255ServerlessFunctionDetail
Delete a function, its versions, secrets and schedule
Authorization
AuthorizationRequiredBearer <token>Session token from the SalesOS web app.
In: header
X-API-Key<token>API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.
In: header
Path Parameters
idRequiredstringDeletedResponse
Versions, newest first (server-paged, without source)
Authorization
AuthorizationRequiredBearer <token>Session token from the SalesOS web app.
In: header
X-API-Key<token>API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.
In: header
Path Parameters
idRequiredstringQuery Parameters
pagestring1limitstring20ServerlessFunctionVersionPage
Save a new immutable version (compiled now; syntax errors are a 400)
Authorization
AuthorizationRequiredBearer <token>Session token from the SalesOS web app.
In: header
X-API-Key<token>API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.
In: header
Request Body
application/jsonRequiredsourceRequiredstringTypeScript or JavaScript exporting a default (input, context) handler
262144languageRequiredstring"javascript" | "typescript"notestring500deploybooleanDeploy the new version immediately
falsePath Parameters
idRequiredstringHeader Parameters
Idempotency-KeystringUnique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.
255ServerlessFunctionVersionSummary
One version with its source
Authorization
AuthorizationRequiredBearer <token>Session token from the SalesOS web app.
In: header
X-API-Key<token>API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.
In: header
Path Parameters
idRequiredstringversionIdRequiredstringServerlessFunctionVersion
Make a version the one that runs
Authorization
AuthorizationRequiredBearer <token>Session token from the SalesOS web app.
In: header
X-API-Key<token>API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.
In: header
Request Body
application/jsonRequiredversionIdRequiredstringPath Parameters
idRequiredstringHeader Parameters
Idempotency-KeystringUnique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.
255ServerlessFunctionDetail
Deploy the version before the active one
Authorization
AuthorizationRequiredBearer <token>Session token from the SalesOS web app.
In: header
X-API-Key<token>API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.
In: header
Path Parameters
idRequiredstringHeader Parameters
Idempotency-KeystringUnique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.
255ServerlessFunctionDetail
Secret names (values are never returned)
Authorization
AuthorizationRequiredBearer <token>Session token from the SalesOS web app.
In: header
X-API-Key<token>API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.
In: header
Path Parameters
idRequiredstringFunctionSecretNameArray
Delete a secret
Authorization
AuthorizationRequiredBearer <token>Session token from the SalesOS web app.
In: header
X-API-Key<token>API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.
In: header
Path Parameters
idRequiredstringnameRequiredstringDeletedResponse
Set a secret (stored encrypted)
Authorization
AuthorizationRequiredBearer <token>Session token from the SalesOS web app.
In: header
X-API-Key<token>API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.
In: header
Request Body
application/jsonRequiredvalueRequiredstringStored encrypted; never returned
8192Path Parameters
idRequiredstringnameRequiredstringFunctionSecretSaved
Run with sample input (saved version or unsaved source); logs are returned
Authorization
AuthorizationRequiredBearer <token>Session token from the SalesOS web app.
In: header
X-API-Key<token>API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.
In: header
Request Body
application/jsonRequiredinputobjectSample input
sourcestringUnsaved source to run instead of a saved version
262144languagestring"javascript" | "typescript"versionIdstringRun this saved version (default: the deployed one)
Path Parameters
idRequiredstringHeader Parameters
Idempotency-KeystringUnique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.
255FunctionRunResult
Invocation log (server-paged)
Authorization
AuthorizationRequiredBearer <token>Session token from the SalesOS web app.
In: header
X-API-Key<token>API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.
In: header
Path Parameters
idRequiredstringQuery Parameters
pagestring1limitstring20statusstring"SUCCEEDED" | "FAILED" | "TIMEOUT" | "MEMORY_LIMIT" | "THROTTLED" | "CRASHED"triggerstring"HTTP" | "WORKFLOW" | "ACTION" | "EVENT" | "SCHEDULE" | "TEST"ServerlessFunctionInvocationPage
One invocation with input, output and captured logs
Authorization
AuthorizationRequiredBearer <token>Session token from the SalesOS web app.
In: header
X-API-Key<token>API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.
In: header
Path Parameters
idRequiredstringinvocationIdRequiredstringServerlessFunctionInvocation
Invoke a function over HTTP (id or apiName); needs INVOKE_FUNCTIONS for keys and tokens
Authorization
AuthorizationRequiredBearer <token>Session token from the SalesOS web app.
In: header
X-API-Key<token>API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.
In: header
Request Body
application/jsonRequiredinputobjectPassed to the handler as input
Path Parameters
idRequiredstringHeader Parameters
x-salesos-function-depthRequiredstringIdempotency-KeystringUnique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.
255FunctionInvokeResult