Build sessions
Commit
Commit and push session changes, then build and snapshot in the background.
POST
/
sessions
/
{sessionId}
/
commit
Commit
curl --request POST \
--url https://api.zite.com/v1/sessions/{sessionId}/commit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "Add ticket list endpoint and UI"
}
'import requests
url = "https://api.zite.com/v1/sessions/{sessionId}/commit"
payload = { "message": "Add ticket list endpoint and UI" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({message: 'Add ticket list endpoint and UI'})
};
fetch('https://api.zite.com/v1/sessions/{sessionId}/commit', 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/sessions/{sessionId}/commit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'message' => 'Add ticket list endpoint and UI'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zite.com/v1/sessions/{sessionId}/commit"
payload := strings.NewReader("{\n \"message\": \"Add ticket list endpoint and UI\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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/sessions/{sessionId}/commit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"Add ticket list endpoint and UI\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zite.com/v1/sessions/{sessionId}/commit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"Add ticket list endpoint and UI\"\n}"
response = http.request(request)
puts response.read_body{
"commitSha": "3c24814",
"changedApps": [
{
"id": "app_a1b2c3",
"name": "Agent console",
"buildStatus": "building",
"editorUrl": "https://app.zite.com/editor/zite/app_a1b2c3"
}
]
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Missing or invalid API key."
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Workspace not found."
}
}{
"error": {
"code": "CONFLICT",
"message": "The workspace has newer commits. Pull and rebase inside the session, then commit again."
}
}commit regenerates types, commits and pushes, then builds and snapshots in the background — the
returned changedApps report buildStatus: "building". Poll
GET /apps/{appId} until the build is success, then
publish.
If the workspace has newer commits than your session,
commit returns CONFLICT. Pull and rebase
inside the session (POST /bash with git pull --rebase origin main),
resolve, and commit again.Authorizations
Enter your Zite API key. Format: Bearer <api_key>
Path Parameters
The build session ID from Open a session.
Body
application/json
Commit message.
Example:
"Add ticket list endpoint and UI"
⌘I
Commit
curl --request POST \
--url https://api.zite.com/v1/sessions/{sessionId}/commit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "Add ticket list endpoint and UI"
}
'import requests
url = "https://api.zite.com/v1/sessions/{sessionId}/commit"
payload = { "message": "Add ticket list endpoint and UI" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({message: 'Add ticket list endpoint and UI'})
};
fetch('https://api.zite.com/v1/sessions/{sessionId}/commit', 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/sessions/{sessionId}/commit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'message' => 'Add ticket list endpoint and UI'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zite.com/v1/sessions/{sessionId}/commit"
payload := strings.NewReader("{\n \"message\": \"Add ticket list endpoint and UI\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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/sessions/{sessionId}/commit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"Add ticket list endpoint and UI\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zite.com/v1/sessions/{sessionId}/commit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"Add ticket list endpoint and UI\"\n}"
response = http.request(request)
puts response.read_body{
"commitSha": "3c24814",
"changedApps": [
{
"id": "app_a1b2c3",
"name": "Agent console",
"buildStatus": "building",
"editorUrl": "https://app.zite.com/editor/zite/app_a1b2c3"
}
]
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Missing or invalid API key."
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Workspace not found."
}
}{
"error": {
"code": "CONFLICT",
"message": "The workspace has newer commits. Pull and rebase inside the session, then commit again."
}
}