Skip to content
v2.7

Update site's deployment

Update the site active deployment.

PATCH/sites/{siteId}/deploymentScope sites.write

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.

siteId string required

Site ID.

deploymentId string required

Deployment ID.

Access: API key with the sites.write scope.

200Success
400Invalid or missing parameter
401No session, no permission on the resource or key without the scope
404Resource in the path not found
429Rate limit

Every error comes as JSON with code, type and message: see Errors.

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>',
});
Response200 OK
{
"$id": "5e5ea5c16897e",
"$createdAt": "2020-10-15T06:38:00.000+00:00",
"$updatedAt": "2020-10-15T06:38:00.000+00:00",
"name": "My Site",
"description": "Marketing site for the spring launch.",
"enabled": false,
"live": false,
"logging": false,
"framework": "react",
"deploymentRetention": 7,
"deploymentId": "5e5ea5c16897e",
"deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00",
"deploymentScreenshotLight": "5e5ea5c16897e",
"deploymentScreenshotDark": "5e5ea5c16897e",
"latestDeploymentId": "5e5ea5c16897e",
"latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00",
"latestDeploymentStatus": "ready",
"scopes": [
"users.read"
],
"vars": [
{
"$id": "5e5ea5c16897e",
"$createdAt": "2020-10-15T06:38:00.000+00:00",
"$updatedAt": "2020-10-15T06:38:00.000+00:00",
"key": "API_KEY",
"description": "Stripe secret key used at checkout.",
"value": "myPa$$word1",
"secret": false,
"resourceType": "function",
"resourceId": "myAwesomeFunction"
}
],
"timeout": 300,
"installCommand": "npm install",
"buildCommand": "npm run build",
"startCommand": "node custom-server.mjs",
"outputDirectory": "build",
"installationId": "6m40at4ejk5h2u9s1hboo",
"providerRepositoryId": "owbase",
"providerBranch": "main",
"providerRootDirectory": "sites/helloWorld",
"providerSilentMode": false,
"providerBranches": [
"main",
"feat/*"
],
"providerPaths": [
"src/**",
"!docs/**"
],
"buildSpecification": "s-1vcpu-512mb",
"runtimeSpecification": "s-1vcpu-512mb",
"buildRuntime": "node-22",
"adapter": "static",
"fallbackFile": "index.html"
}

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?