Skip to content
v2.7

Functions

Functions: create, deploy, execute and follow executions.

Functions: create, deploy, execute and follow executions.

Class Functions: 24 methods (3 in @owbase/web, 24 in @owbase/node). The examples use the object form of the parameters; replace the values between < and > with your own.

List functions

GET /functions · method page

SDK: @owbase/node only

Get a list of all the project’s functions. You can use the query params to filter your results.

Parameter Type Required Description
queries string[] no Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId
search string no Search term to filter your list results. Max length: 256 chars.
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Access: API key with the functions.read scope.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.list({
queries: [], // optional
search: '<SEARCH>', // optional
total: false, // optional
});

Create function

POST /functions · method page

SDK: @owbase/node only

Create a new function. You can pass a list of permissions to allow different project users or team with access to execute the function using the client API.

Deployment is upload-only: the Git repository parameters are left out (see Package and upload the code).

Parameter Type Required Description
functionId string yes Function ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can’t start with a special char. Max length is 36 chars.
name string yes Function name. Max length: 128 chars.
runtime Runtime yes Execution runtime. Values: node-22 (Node 22 only on Owbase).
execute string[] no An array of role strings with execution permissions. By default no user is granted with any execute permissions. learn more about roles. Maximum of 100 roles are allowed, each 64 characters long.
events string[] no Events list. Maximum of 100 events are allowed.
schedule string no Schedule CRON syntax. Cannot be combined with interval.
timeout number no Function maximum execution time in seconds.
enabled boolean no Is function enabled? When set to ‘disabled’, users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
logging boolean no When disabled, executions will exclude logs and errors, and will be slightly faster.
entrypoint string no Entrypoint File. This path is relative to the “providerRootDirectory”.
commands string no Build Commands.
scopes ProjectKeyScopes[] no List of scopes allowed for API key auto-generated for every execution. Maximum of 200 scopes are allowed. Values: project.read, project.write, usage.read, keys.read, keys.write, platforms.read, platforms.write, mocks.read, mocks.write, policies.read, policies.write, project.policies.read, project.policies.write, project.oauth2.read, project.oauth2.write, templates.read, templates.write, stages.read, stages.write, users.read, users.write, sessions.read, sessions.write, teams.read, teams.write, databases.read, databases.write, tables.read, tables.write, columns.read, columns.write, indexes.read, indexes.write, rows.read, rows.write, embeddings.write, collections.read, collections.write, attributes.read, attributes.write, documents.read, documents.write, documentsdb.read, documentsdb.write, documentsdb.collections.read, documentsdb.collections.write, documentsdb.documents.read, documentsdb.documents.write, documentsdb.indexes.read, documentsdb.indexes.write, vectorsdb.read, vectorsdb.write, vectorsdb.collections.read, vectorsdb.collections.write, vectorsdb.documents.read, vectorsdb.documents.write, vectorsdb.indexes.read, vectorsdb.indexes.write, buckets.read, buckets.write, files.read, files.write, tokens.read, tokens.write, functions.read, functions.write, executions.read, executions.write, execution.read, execution.write, sites.read, sites.write, log.read, log.write, providers.read, providers.write, topics.read, topics.write, subscribers.read, subscribers.write, targets.read, targets.write, messages.read, messages.write, rules.read, rules.write, webhooks.read, webhooks.write, monitors.read, monitors.write, alerts.read, locale.read, avatars.read, avatars.write, health.read, assistant.read, migrations.read, migrations.write, schedules.read, schedules.write, vcs.read, vcs.write, insights.read, insights.write, reports.read, reports.write, reviews.read, reviews.write, presences.read, presences.write.
buildSpecification string no Build specification for the function deployments.
runtimeSpecification string no Runtime specification for the function executions.
deploymentRetention number no Days to keep non-active deployments before deletion. Value 0 keeps all deployments unless the server applies a default retention.
interval number no Minutes between scheduled executions. Owbase picks when within each interval the function runs. Use 0 to disable. Cannot be combined with schedule.
description string no Optional description for the function.

Access: API key with the functions.write scope.

@owbase/node
import { Client, Functions, Runtime, ProjectKeyScopes } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.create({
functionId: '<FUNCTION_ID>',
name: '<NAME>',
runtime: Runtime.Node22,
execute: ['any'], // optional
events: [], // optional
schedule: '0 0 * * *', // optional
timeout: 1, // optional
enabled: false, // optional
logging: false, // optional
entrypoint: '<ENTRYPOINT>', // optional
commands: '<COMMANDS>', // optional
scopes: [ProjectKeyScopes.ProjectRead], // optional
buildSpecification: 's-1vcpu-512mb', // optional
runtimeSpecification: 's-1vcpu-512mb', // optional
deploymentRetention: 0, // optional
interval: 0, // optional
description: '<DESCRIPTION>', // optional
});

List runtimes

GET /functions/runtimes · method page

SDK: @owbase/node only

Get a list of all runtimes that are currently active on your instance.

Parameter Type Required Description
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Access: API key with no specific scope.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.listRuntimes({
total: false, // optional
});

List specifications

GET /functions/specifications · method page

SDK: @owbase/node only

List allowed function specifications for this instance.

Parameter Type Required Description
type string no Specification type to list. Can be one of: runtimes, builds. Defaults to runtimes.
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Access: API key with the functions.read scope.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.listSpecifications({
type: 'runtimes', // optional
total: false, // optional
});

Get function

GET /functions/{functionId} · method page

SDK: @owbase/node only

Get a function by its unique ID.

Parameter Type Required Description
functionId string yes Function ID.

Access: API key with the functions.read scope.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.get({
functionId: '<FUNCTION_ID>',
});

Update function

PUT /functions/{functionId} · method page

SDK: @owbase/node only

Update function by its unique ID.

Deployment is upload-only: the Git repository parameters are left out (see Package and upload the code).

Parameter Type Required Description
functionId string yes Function ID.
name string yes Function name. Max length: 128 chars.
runtime Runtime no Execution runtime. Values: node-22 (Node 22 only on Owbase).
execute string[] no An array of role strings with execution permissions. By default no user is granted with any execute permissions. learn more about roles. Maximum of 100 roles are allowed, each 64 characters long.
events string[] no Events list. Maximum of 100 events are allowed.
schedule string no Schedule CRON syntax. Cannot be combined with interval.
timeout number no Maximum execution time in seconds.
enabled boolean no Is function enabled? When set to ‘disabled’, users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
logging boolean no When disabled, executions will exclude logs and errors, and will be slightly faster.
entrypoint string no Entrypoint File. This path is relative to the “providerRootDirectory”.
commands string no Build Commands.
scopes ProjectKeyScopes[] no List of scopes allowed for API Key auto-generated for every execution. Maximum of 200 scopes are allowed. Values: project.read, project.write, usage.read, keys.read, keys.write, platforms.read, platforms.write, mocks.read, mocks.write, policies.read, policies.write, project.policies.read, project.policies.write, project.oauth2.read, project.oauth2.write, templates.read, templates.write, stages.read, stages.write, users.read, users.write, sessions.read, sessions.write, teams.read, teams.write, databases.read, databases.write, tables.read, tables.write, columns.read, columns.write, indexes.read, indexes.write, rows.read, rows.write, embeddings.write, collections.read, collections.write, attributes.read, attributes.write, documents.read, documents.write, documentsdb.read, documentsdb.write, documentsdb.collections.read, documentsdb.collections.write, documentsdb.documents.read, documentsdb.documents.write, documentsdb.indexes.read, documentsdb.indexes.write, vectorsdb.read, vectorsdb.write, vectorsdb.collections.read, vectorsdb.collections.write, vectorsdb.documents.read, vectorsdb.documents.write, vectorsdb.indexes.read, vectorsdb.indexes.write, buckets.read, buckets.write, files.read, files.write, tokens.read, tokens.write, functions.read, functions.write, executions.read, executions.write, execution.read, execution.write, sites.read, sites.write, log.read, log.write, providers.read, providers.write, topics.read, topics.write, subscribers.read, subscribers.write, targets.read, targets.write, messages.read, messages.write, rules.read, rules.write, webhooks.read, webhooks.write, monitors.read, monitors.write, alerts.read, locale.read, avatars.read, avatars.write, health.read, assistant.read, migrations.read, migrations.write, schedules.read, schedules.write, vcs.read, vcs.write, insights.read, insights.write, reports.read, reports.write, reviews.read, reviews.write, presences.read, presences.write.
buildSpecification string no Build specification for the function deployments.
runtimeSpecification string no Runtime specification for the function executions.
deploymentRetention number no Days to keep non-active deployments before deletion. Value 0 keeps all deployments unless the server applies a default retention.
interval number no Minutes between scheduled executions. Owbase picks when within each interval the function runs. Use 0 to disable. Cannot be combined with schedule. When omitted, the current interval is kept unless schedule is set.
description string no Optional description for the function.

Access: API key with the functions.write scope.

@owbase/node
import { Client, Functions, Runtime, ProjectKeyScopes } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.update({
functionId: '<FUNCTION_ID>',
name: '<NAME>',
runtime: Runtime.Node22, // optional
execute: ['any'], // optional
events: [], // optional
schedule: '0 0 * * *', // optional
timeout: 1, // optional
enabled: false, // optional
logging: false, // optional
entrypoint: '<ENTRYPOINT>', // optional
commands: '<COMMANDS>', // optional
scopes: [ProjectKeyScopes.ProjectRead], // optional
buildSpecification: 's-1vcpu-512mb', // optional
runtimeSpecification: 's-1vcpu-512mb', // optional
deploymentRetention: 0, // optional
interval: 0, // optional
description: '<DESCRIPTION>', // optional
});

Delete function

DELETE /functions/{functionId} · method page

SDK: @owbase/node only

Delete a function by its unique ID.

Parameter Type Required Description
functionId string yes Function ID.

Access: API key with the functions.write scope.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.delete({
functionId: '<FUNCTION_ID>',
});

Update function’s deployment

PATCH /functions/{functionId}/deployment · method page

SDK: @owbase/node only

Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.

Parameter Type Required Description
functionId string yes Function ID.
deploymentId string yes Deployment ID.

Access: API key with the functions.write scope.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.updateFunctionDeployment({
functionId: '<FUNCTION_ID>',
deploymentId: '<DEPLOYMENT_ID>',
});

List deployments

GET /functions/{functionId}/deployments · method page

SDK: @owbase/node only

Get a list of all the function’s code deployments. You can use the query params to filter your results.

Parameter Type Required Description
functionId string yes Function ID.
queries string[] no Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
search string no Search term to filter your list results. Max length: 256 chars.
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Access: API key with the functions.read scope.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.listDeployments({
functionId: '<FUNCTION_ID>',
queries: [], // optional
search: '<SEARCH>', // optional
total: false, // optional
});

Create deployment

POST /functions/{functionId}/deployments · method page

SDK: @owbase/node only

Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you’ll need to update the function’s deployment to use your new deployment UID.

This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the Owbase Cloud Functions tutorial.

Use the “command” param to set the entrypoint used to execute your code.

Parameter Type Required Description
functionId string yes Function ID.
code File (in node, also InputFile) yes Gzip file with your code package. When used with the Owbase CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.
activate boolean yes Automatically activate the deployment when it is finished building.
entrypoint string no Entrypoint File.
commands string no Build Commands.
onProgress (progress: UploadProgress) => void no Callback called after each uploaded chunk with the upload progress ($id, progress in percent, sizeUploaded, chunksTotal, chunksUploaded).

Access: API key with the functions.write scope.

@owbase/node
import { Client, Functions } from '@owbase/node';
import { InputFile } from '@owbase/node/file';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.createDeployment({
functionId: '<FUNCTION_ID>',
code: InputFile.fromPath('/path/to/file', 'filename'),
activate: false,
entrypoint: '<ENTRYPOINT>', // optional
commands: '<COMMANDS>', // optional
});

Create duplicate deployment

POST /functions/{functionId}/deployments/duplicate · method page

SDK: @owbase/node only

Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment’s code will be preserved and used for the new build.

Parameter Type Required Description
functionId string yes Function ID.
deploymentId string yes Deployment ID.
buildId string no Build unique ID.

Access: API key with the functions.write scope.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.createDuplicateDeployment({
functionId: '<FUNCTION_ID>',
deploymentId: '<DEPLOYMENT_ID>',
buildId: '<BUILD_ID>', // optional
});

Get deployment

GET /functions/{functionId}/deployments/{deploymentId} · method page

SDK: @owbase/node only

Get a function deployment by its unique ID.

Parameter Type Required Description
functionId string yes Function ID.
deploymentId string yes Deployment ID.

Access: API key with the functions.read scope.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.getDeployment({
functionId: '<FUNCTION_ID>',
deploymentId: '<DEPLOYMENT_ID>',
});

Delete deployment

DELETE /functions/{functionId}/deployments/{deploymentId} · method page

SDK: @owbase/node only

Delete a code deployment by its unique ID.

Parameter Type Required Description
functionId string yes Function ID.
deploymentId string yes Deployment ID.

Access: API key with the functions.write scope.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.deleteDeployment({
functionId: '<FUNCTION_ID>',
deploymentId: '<DEPLOYMENT_ID>',
});

Get deployment download

GET /functions/{functionId}/deployments/{deploymentId}/download · method page

SDK: @owbase/node only

Get a function deployment content by its unique ID. The endpoint response return with a ‘Content-Disposition: attachment’ header that tells the browser to start downloading the file to user downloads directory.

Parameter Type Required Description
functionId string yes Function ID.
deploymentId string yes Deployment ID.
type DeploymentDownloadType no Deployment file to download. Can be: “source”, “output”. Values: source, output.
token string no Presigned source-download token for accessing this deployment without a session (jobs-service).

Access: API key with the functions.read scope or user session (the resource’s permissions apply).

@owbase/node
import { Client, Functions, DeploymentDownloadType } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.getDeploymentDownload({
functionId: '<FUNCTION_ID>',
deploymentId: '<DEPLOYMENT_ID>',
type: DeploymentDownloadType.Source, // optional
token: '<TOKEN>', // optional
});

Update deployment status

PATCH /functions/{functionId}/deployments/{deploymentId}/status · method page

SDK: @owbase/node only

Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn’t started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status ‘ready’) or failed. The response includes the final build status and details.

Parameter Type Required Description
functionId string yes Function ID.
deploymentId string yes Deployment ID.

Access: API key with the functions.write scope.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.updateDeploymentStatus({
functionId: '<FUNCTION_ID>',
deploymentId: '<DEPLOYMENT_ID>',
});

List executions

GET /functions/{functionId}/executions · method page

SDK: @owbase/web and @owbase/node

Get a list of all the current user function execution logs. You can use the query params to filter your results.

Parameter Type Required Description
functionId string yes Function ID.
queries string[] no Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Access: API key with the executions.read scope (also accepts execution.read) or user session (the resource’s permissions apply).

@owbase/web
import { Client, Functions } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const functions = new Functions(client);
const result = await functions.listExecutions({
functionId: '<FUNCTION_ID>',
queries: [], // optional
total: false, // optional
});
console.log(result);
@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const functions = new Functions(client);
const result = await functions.listExecutions({
functionId: '<FUNCTION_ID>',
queries: [], // optional
total: false, // optional
});

Create execution

POST /functions/{functionId}/executions · method page

SDK: @owbase/web and @owbase/node

Trigger a function execution. The returned object will return you the current execution status. You can ping the Get Execution endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.

Parameter Type Required Description
functionId string yes Function ID.
body string no HTTP body of execution. Default value is empty string.
async boolean no Execute code in the background. Default value is false.
xpath string no HTTP path of execution. Path can include query params. Default value is /
method ExecutionMethod no HTTP method of execution. Default value is POST. Values: GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD.
headers object no HTTP headers of execution. Defaults to empty.
scheduledAt string no Scheduled execution time in ISO 8601 format. DateTime value must be in future with precision in minutes.

Access: API key with the executions.write scope (also accepts execution.write) or user session, or even no session (the resource’s permissions apply).

@owbase/web
import { Client, Functions, ExecutionMethod } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const functions = new Functions(client);
const result = await functions.createExecution({
functionId: '<FUNCTION_ID>',
body: '<BODY>', // optional
async: false, // optional
xpath: '<PATH>', // optional
method: ExecutionMethod.GET, // optional
headers: {}, // optional
scheduledAt: '<SCHEDULED_AT>', // optional
});
console.log(result);
@owbase/node
import { Client, Functions, ExecutionMethod } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const functions = new Functions(client);
const result = await functions.createExecution({
functionId: '<FUNCTION_ID>',
body: '<BODY>', // optional
async: false, // optional
xpath: '<PATH>', // optional
method: ExecutionMethod.GET, // optional
headers: {}, // optional
scheduledAt: '<SCHEDULED_AT>', // optional
});

Get execution

GET /functions/{functionId}/executions/{executionId} · method page

SDK: @owbase/web and @owbase/node

Get a function execution log by its unique ID.

Parameter Type Required Description
functionId string yes Function ID.
executionId string yes Execution ID.

Access: API key with the executions.read scope (also accepts execution.read) or user session (the resource’s permissions apply).

@owbase/web
import { Client, Functions } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const functions = new Functions(client);
const result = await functions.getExecution({
functionId: '<FUNCTION_ID>',
executionId: '<EXECUTION_ID>',
});
console.log(result);
@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const functions = new Functions(client);
const result = await functions.getExecution({
functionId: '<FUNCTION_ID>',
executionId: '<EXECUTION_ID>',
});

Delete execution

DELETE /functions/{functionId}/executions/{executionId} · method page

SDK: @owbase/node only

Delete a function execution by its unique ID.

Parameter Type Required Description
functionId string yes Function ID.
executionId string yes Execution ID.

Access: API key with the executions.write scope (also accepts execution.write).

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.deleteExecution({
functionId: '<FUNCTION_ID>',
executionId: '<EXECUTION_ID>',
});

List variables

GET /functions/{functionId}/variables · method page

SDK: @owbase/node only

Get a list of all variables of a specific function.

Parameter Type Required Description
functionId string yes Function unique ID.
queries string[] no Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Access: API key with the functions.read scope.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.listVariables({
functionId: '<FUNCTION_ID>',
queries: [], // optional
total: false, // optional
});

Create variable

POST /functions/{functionId}/variables · method page

SDK: @owbase/node only

Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.

Parameter Type Required Description
functionId string yes Function unique ID.
variableId string yes Variable ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can’t start with a special char. Max length is 36 chars.
key string yes Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars.
value string yes Variable value. Max length: 8192 chars.
secret boolean no Secret variables can be updated or deleted, but only functions can read them during build and runtime.
description string no Optional description for the variable.

Access: API key with the functions.write scope.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.createVariable({
functionId: '<FUNCTION_ID>',
variableId: '<VARIABLE_ID>',
key: '<KEY>',
value: '<VALUE>',
secret: false, // optional
description: '<DESCRIPTION>', // optional
});

Get variable

GET /functions/{functionId}/variables/{variableId} · method page

SDK: @owbase/node only

Get a variable by its unique ID.

Parameter Type Required Description
functionId string yes Function unique ID.
variableId string yes Variable unique ID.

Access: API key with the functions.read scope.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.getVariable({
functionId: '<FUNCTION_ID>',
variableId: '<VARIABLE_ID>',
});

Update variable

PUT /functions/{functionId}/variables/{variableId} · method page

SDK: @owbase/node only

Update variable by its unique ID.

Parameter Type Required Description
functionId string yes Function unique ID.
variableId string yes Variable unique ID.
key string no Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars.
value string no Variable value. Max length: 8192 chars.
secret boolean no Secret variables can be updated or deleted, but only functions can read them during build and runtime.
description string no Optional description for the variable.

Access: API key with the functions.write scope.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.updateVariable({
functionId: '<FUNCTION_ID>',
variableId: '<VARIABLE_ID>',
key: '<KEY>', // optional
value: '<VALUE>', // optional
secret: false, // optional
description: '<DESCRIPTION>', // optional
});

Delete variable

DELETE /functions/{functionId}/variables/{variableId} · method page

SDK: @owbase/node only

Delete a variable by its unique ID.

Parameter Type Required Description
functionId string yes Function unique ID.
variableId string yes Variable unique ID.

Access: API key with the functions.write scope.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.deleteVariable({
functionId: '<FUNCTION_ID>',
variableId: '<VARIABLE_ID>',
});

The descriptions on this page come from the server API specification (BSD-3-Clause license), and the examples come from the SDK generator (MIT license). The full notices are in the NOTICE file of the @owbase/web and @owbase/node packages.

Was this page helpful?