Skip to content
v2.7

Sites

Static and SSR sites: create, publish by upload, deployments, request logs and variables.

Static and SSR sites: create, publish by upload, deployments, request logs and variables.

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

List sites

GET /sites · method page

SDK: @owbase/node only

Get a list of all the project’s sites. 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, framework, deploymentId, buildCommand, installCommand, outputDirectory, 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 sites.read scope.

@owbase/node
import { Client, Sites } 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 sites = new Sites(client);
const result = await sites.list({
queries: [], // optional
search: '<SEARCH>', // optional
total: false, // optional
});

Create site

POST /sites · method page

SDK: @owbase/node only

Create a new site.

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

Parameter Type Required Description
siteId string yes Site 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 Site name. Max length: 128 chars.
framework Framework yes Sites framework. Values: analog, angular, nextjs, react, nuxt, vue, sveltekit, astro, tanstack-start, remix, lynx, react-native, vite, other (Node frameworks only on Owbase).
buildRuntime BuildRuntime yes Runtime to use during build step. Values: node-22 (Node 22 only on Owbase).
enabled boolean no Is site enabled? When set to ‘disabled’, users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
logging boolean no When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
timeout number no Maximum request time in seconds.
installCommand string no Install Command.
buildCommand string no Build Command.
startCommand string no Custom start command. Leave empty to use default.
outputDirectory string no Output Directory for site.
adapter Adapter no Framework adapter defining rendering strategy. Allowed values are: static, ssr Values: static, ssr.
fallbackFile string no Fallback file for single page application sites.
buildSpecification string no Build specification for the site deployments.
runtimeSpecification string no Runtime specification for the SSR executions.
deploymentRetention number no Days to keep non-active deployments before deletion. Value 0 keeps all deployments unless the server applies a default retention. New sites default to 30 days.
scopes ProjectKeyScopes[] no List of scopes allowed for API key auto-generated for every site build and SSR 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.
description string no Optional description for the site.

Access: API key with the sites.write scope.

@owbase/node
import { Client, Sites, Framework, BuildRuntime, Adapter, 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 sites = new Sites(client);
const result = await sites.create({
siteId: '<SITE_ID>',
name: '<NAME>',
framework: Framework.Nextjs,
buildRuntime: BuildRuntime.Node22,
enabled: false, // optional
logging: false, // optional
timeout: 1, // optional
installCommand: '<INSTALL_COMMAND>', // optional
buildCommand: '<BUILD_COMMAND>', // optional
startCommand: '<START_COMMAND>', // optional
outputDirectory: '<OUTPUT_DIRECTORY>', // optional
adapter: Adapter.Static, // optional
fallbackFile: '<FALLBACK_FILE>', // optional
buildSpecification: 's-1vcpu-512mb', // optional
runtimeSpecification: 's-1vcpu-512mb', // optional
deploymentRetention: 0, // optional
scopes: [ProjectKeyScopes.ProjectRead], // optional
description: '<DESCRIPTION>', // optional
});

List frameworks

GET /sites/frameworks · method page

SDK: @owbase/node only

Get a list of all frameworks that are currently available on the server 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, Sites } 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 sites = new Sites(client);
const result = await sites.listFrameworks({
total: false, // optional
});

List specifications

GET /sites/specifications · method page

SDK: @owbase/node only

List allowed site 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 sites.read scope.

@owbase/node
import { Client, Sites } 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 sites = new Sites(client);
const result = await sites.listSpecifications({
type: 'runtimes', // optional
total: false, // optional
});

Get site

GET /sites/{siteId} · method page

SDK: @owbase/node only

Get a site by its unique ID.

Parameter Type Required Description
siteId string yes Site ID.

Access: API key with the sites.read scope.

@owbase/node
import { Client, Sites } 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 sites = new Sites(client);
const result = await sites.get({
siteId: '<SITE_ID>',
});

Update site

PUT /sites/{siteId} · method page

SDK: @owbase/node only

Update site by its unique ID.

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

Parameter Type Required Description
siteId string yes Site ID.
name string yes Site name. Max length: 128 chars.
framework Framework yes Sites framework. Values: analog, angular, nextjs, react, nuxt, vue, sveltekit, astro, tanstack-start, remix, lynx, react-native, vite, other (Node frameworks only on Owbase).
enabled boolean no Is site enabled? When set to ‘disabled’, users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
logging boolean no When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
timeout number no Maximum request time in seconds.
installCommand string no Install Command.
buildCommand string no Build Command.
startCommand string no Custom start command. Leave empty to use default.
outputDirectory string no Output Directory for site.
buildRuntime BuildRuntime no Runtime to use during build step. Values: node-22 (Node 22 only on Owbase).
adapter Adapter no Framework adapter defining rendering strategy. Allowed values are: static, ssr Values: static, ssr.
fallbackFile string no Fallback file for single page application sites.
buildSpecification string no Build specification for the site deployments.
runtimeSpecification string no Runtime specification for the SSR executions.
deploymentRetention number no Days to keep non-active deployments before deletion. Value 0 keeps all deployments unless the server applies a default retention. Leave it out to keep the current value.
scopes ProjectKeyScopes[] no List of scopes allowed for API key auto-generated for every site build and SSR 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.
description string no Optional description for the site.

Access: API key with the sites.write scope.

@owbase/node
import { Client, Sites, Framework, BuildRuntime, Adapter, 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 sites = new Sites(client);
const result = await sites.update({
siteId: '<SITE_ID>',
name: '<NAME>',
framework: Framework.Nextjs,
enabled: false, // optional
logging: false, // optional
timeout: 1, // optional
installCommand: '<INSTALL_COMMAND>', // optional
buildCommand: '<BUILD_COMMAND>', // optional
startCommand: '<START_COMMAND>', // optional
outputDirectory: '<OUTPUT_DIRECTORY>', // optional
buildRuntime: BuildRuntime.Node22, // optional
adapter: Adapter.Static, // optional
fallbackFile: '<FALLBACK_FILE>', // optional
buildSpecification: 's-1vcpu-512mb', // optional
runtimeSpecification: 's-1vcpu-512mb', // optional
deploymentRetention: 0, // optional
scopes: [ProjectKeyScopes.ProjectRead], // optional
description: '<DESCRIPTION>', // optional
});

Delete site

DELETE /sites/{siteId} · method page

SDK: @owbase/node only

Delete a site by its unique ID.

Parameter Type Required Description
siteId string yes Site ID.

Access: API key with the sites.write scope.

@owbase/node
import { Client, Sites } 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 sites = new Sites(client);
const result = await sites.delete({
siteId: '<SITE_ID>',
});

Update site’s deployment

PATCH /sites/{siteId}/deployment · method page

SDK: @owbase/node only

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

Parameter Type Required Description
siteId string yes Site ID.
deploymentId string yes Deployment ID.

Access: API key with the sites.write scope.

@owbase/node
import { Client, Sites } 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 sites = new Sites(client);
const result = await sites.updateSiteDeployment({
siteId: '<SITE_ID>',
deploymentId: '<DEPLOYMENT_ID>',
});

List deployments

GET /sites/{siteId}/deployments · method page

SDK: @owbase/node only

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

Parameter Type Required Description
siteId string yes Site 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 sites.read scope.

@owbase/node
import { Client, Sites } 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 sites = new Sites(client);
const result = await sites.listDeployments({
siteId: '<SITE_ID>',
queries: [], // optional
search: '<SEARCH>', // optional
total: false, // optional
});

Create deployment

POST /sites/{siteId}/deployments · method page

SDK: @owbase/node only

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

Parameter Type Required Description
siteId string yes Site 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.
installCommand string no Install Commands.
buildCommand string no Build Commands.
outputDirectory string no Output Directory.
activate boolean no Automatically activate the deployment when it is finished building.
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 sites.write scope.

@owbase/node
import { Client, Sites } 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 sites = new Sites(client);
const result = await sites.createDeployment({
siteId: '<SITE_ID>',
code: InputFile.fromPath('/path/to/file', 'filename'),
installCommand: '<INSTALL_COMMAND>', // optional
buildCommand: '<BUILD_COMMAND>', // optional
outputDirectory: '<OUTPUT_DIRECTORY>', // optional
activate: false, // optional
});

Create duplicate deployment

POST /sites/{siteId}/deployments/duplicate · method page

SDK: @owbase/node only

Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory 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
siteId string yes Site ID.
deploymentId string yes Deployment ID.

Access: API key with the sites.write scope.

@owbase/node
import { Client, Sites } 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 sites = new Sites(client);
const result = await sites.createDuplicateDeployment({
siteId: '<SITE_ID>',
deploymentId: '<DEPLOYMENT_ID>',
});

Get deployment

GET /sites/{siteId}/deployments/{deploymentId} · method page

SDK: @owbase/node only

Get a site deployment by its unique ID.

Parameter Type Required Description
siteId string yes Site ID.
deploymentId string yes Deployment ID.

Access: API key with the sites.read scope.

@owbase/node
import { Client, Sites } 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 sites = new Sites(client);
const result = await sites.getDeployment({
siteId: '<SITE_ID>',
deploymentId: '<DEPLOYMENT_ID>',
});

Delete deployment

DELETE /sites/{siteId}/deployments/{deploymentId} · method page

SDK: @owbase/node only

Delete a site deployment by its unique ID.

Parameter Type Required Description
siteId string yes Site ID.
deploymentId string yes Deployment ID.

Access: API key with the sites.write scope.

@owbase/node
import { Client, Sites } 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 sites = new Sites(client);
const result = await sites.deleteDeployment({
siteId: '<SITE_ID>',
deploymentId: '<DEPLOYMENT_ID>',
});

Get deployment download

GET /sites/{siteId}/deployments/{deploymentId}/download · method page

SDK: @owbase/node only

Get a site 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
siteId string yes Site 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 sites.read scope or user session (the resource’s permissions apply).

@owbase/node
import { Client, Sites, 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 sites = new Sites(client);
const result = await sites.getDeploymentDownload({
siteId: '<SITE_ID>',
deploymentId: '<DEPLOYMENT_ID>',
type: DeploymentDownloadType.Source, // optional
token: '<TOKEN>', // optional
});

Update deployment status

PATCH /sites/{siteId}/deployments/{deploymentId}/status · method page

SDK: @owbase/node only

Cancel an ongoing site 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
siteId string yes Site ID.
deploymentId string yes Deployment ID.

Access: API key with the sites.write scope.

@owbase/node
import { Client, Sites } 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 sites = new Sites(client);
const result = await sites.updateDeploymentStatus({
siteId: '<SITE_ID>',
deploymentId: '<DEPLOYMENT_ID>',
});

List logs

GET /sites/{siteId}/logs · method page

SDK: @owbase/node only

Get a list of all site logs. You can use the query params to filter your results.

Parameter Type Required Description
siteId string yes Site 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 log.read scope.

@owbase/node
import { Client, Sites } 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 sites = new Sites(client);
const result = await sites.listLogs({
siteId: '<SITE_ID>',
queries: [], // optional
total: false, // optional
});

Get log

GET /sites/{siteId}/logs/{logId} · method page

SDK: @owbase/node only

Get a site request log by its unique ID.

Parameter Type Required Description
siteId string yes Site ID.
logId string yes Log ID.

Access: API key with the log.read scope.

@owbase/node
import { Client, Sites } 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 sites = new Sites(client);
const result = await sites.getLog({
siteId: '<SITE_ID>',
logId: '<LOG_ID>',
});

Delete log

DELETE /sites/{siteId}/logs/{logId} · method page

SDK: @owbase/node only

Delete a site log by its unique ID.

Parameter Type Required Description
siteId string yes Site ID.
logId string yes Log ID.

Access: API key with the log.write scope.

@owbase/node
import { Client, Sites } 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 sites = new Sites(client);
const result = await sites.deleteLog({
siteId: '<SITE_ID>',
logId: '<LOG_ID>',
});

List variables

GET /sites/{siteId}/variables · method page

SDK: @owbase/node only

Get a list of all variables of a specific site.

Parameter Type Required Description
siteId string yes Site 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 sites.read scope.

@owbase/node
import { Client, Sites } 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 sites = new Sites(client);
const result = await sites.listVariables({
siteId: '<SITE_ID>',
queries: [], // optional
total: false, // optional
});

Create variable

POST /sites/{siteId}/variables · method page

SDK: @owbase/node only

Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.

Parameter Type Required Description
siteId string yes Site 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 sites can read them during build and runtime.
description string no Optional description for the variable.

Access: API key with the sites.write scope.

@owbase/node
import { Client, Sites } 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 sites = new Sites(client);
const result = await sites.createVariable({
siteId: '<SITE_ID>',
variableId: '<VARIABLE_ID>',
key: '<KEY>',
value: '<VALUE>',
secret: false, // optional
description: '<DESCRIPTION>', // optional
});

Get variable

GET /sites/{siteId}/variables/{variableId} · method page

SDK: @owbase/node only

Get a variable by its unique ID.

Parameter Type Required Description
siteId string yes Site unique ID.
variableId string yes Variable unique ID.

Access: API key with the sites.read scope.

@owbase/node
import { Client, Sites } 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 sites = new Sites(client);
const result = await sites.getVariable({
siteId: '<SITE_ID>',
variableId: '<VARIABLE_ID>',
});

Update variable

PUT /sites/{siteId}/variables/{variableId} · method page

SDK: @owbase/node only

Update variable by its unique ID.

Parameter Type Required Description
siteId string yes Site 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 sites can read them during build and runtime.
description string no Optional description for the variable.

Access: API key with the sites.write scope.

@owbase/node
import { Client, Sites } 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 sites = new Sites(client);
const result = await sites.updateVariable({
siteId: '<SITE_ID>',
variableId: '<VARIABLE_ID>',
key: '<KEY>', // optional
value: '<VALUE>', // optional
secret: false, // optional
description: '<DESCRIPTION>', // optional
});

Delete variable

DELETE /sites/{siteId}/variables/{variableId} · method page

SDK: @owbase/node only

Delete a variable by its unique ID.

Parameter Type Required Description
siteId string yes Site unique ID.
variableId string yes Variable unique ID.

Access: API key with the sites.write scope.

@owbase/node
import { Client, Sites } 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 sites = new Sites(client);
const result = await sites.deleteVariable({
siteId: '<SITE_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?