Build sessions
Open a session
Open an isolated checkout of a workspace’s monorepo to create apps and edit files.
POST
/
workspaces
/
{workspaceId}
/
sessions
Open a session
curl --request POST \
--url https://api.zite.com/v1/workspaces/{workspaceId}/sessions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.zite.com/v1/workspaces/{workspaceId}/sessions"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zite.com/v1/workspaces/{workspaceId}/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zite.com/v1/workspaces/{workspaceId}/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zite.com/v1/workspaces/{workspaceId}/sessions"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.zite.com/v1/workspaces/{workspaceId}/sessions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zite.com/v1/workspaces/{workspaceId}/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"sessionId": "sbx:8bce4d1edc51710f:2f0c9a1e-77f4-4b3e-9f2a-1c7b40e8d316",
"workspaceId": "8bce4d1edc51710f",
"apps": [
{
"id": "a1b2c3d4e5",
"name": "Agent console",
"type": "zite",
"updatedAt": "2026-07-13T18:04:11.000Z",
"published": false
}
],
"files": [
"apps/agent-console/src/App.tsx",
"..."
],
"integrations": [],
"guide": "# Building Zite apps: framework guide\n..."
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "API authorization header missing"
}{
"statusCode": 403,
"error": "Forbidden",
"message": "No access to this workspace"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Workspace not found"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Workspace not found"
}A build session is an isolated checkout of a workspace’s monorepo, the same concept as the Zite MCP
sandbox. You create apps and edit files inside a session, then
commit to build and version your changes.
The response includes the workspace’s file tree, its apps, and the framework guide: the same spec
agents receive, describing the project layout and conventions.
- Every file and commit call takes the
sessionIdreturned here. - Use one session per concurrent build so parallel jobs don’t clobber each other.
- Sessions auto-stop when idle and re-boot transparently on the next call.
- If the workspace pins an older
zitejsthan the current release, the response includeszitejsUpdatewith the command to update it.
Response
The open session
⌘I
Open a session
curl --request POST \
--url https://api.zite.com/v1/workspaces/{workspaceId}/sessions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.zite.com/v1/workspaces/{workspaceId}/sessions"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zite.com/v1/workspaces/{workspaceId}/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zite.com/v1/workspaces/{workspaceId}/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zite.com/v1/workspaces/{workspaceId}/sessions"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.zite.com/v1/workspaces/{workspaceId}/sessions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zite.com/v1/workspaces/{workspaceId}/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"sessionId": "sbx:8bce4d1edc51710f:2f0c9a1e-77f4-4b3e-9f2a-1c7b40e8d316",
"workspaceId": "8bce4d1edc51710f",
"apps": [
{
"id": "a1b2c3d4e5",
"name": "Agent console",
"type": "zite",
"updatedAt": "2026-07-13T18:04:11.000Z",
"published": false
}
],
"files": [
"apps/agent-console/src/App.tsx",
"..."
],
"integrations": [],
"guide": "# Building Zite apps: framework guide\n..."
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "API authorization header missing"
}{
"statusCode": 403,
"error": "Forbidden",
"message": "No access to this workspace"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Workspace not found"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Workspace not found"
}