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": "a1b2c3d4e5",
"name": "Agent console",
"buildStatus": "building"
}
],
"workspaceId": "8bce4d1edc51710f"
}{
"statusCode": 400,
"error": "Bad Request",
"message": "oldText matches 3 places in \"apps/agent-console/src/App.tsx\" - include more surrounding context to make it unique"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "API authorization header missing"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Workspace not found"
}{
"statusCode": 409,
"error": "Conflict",
"message": "Commit refused - a rebase is still in progress in /workspace, and a commit does not finish one. Finish it with `git rebase --continue` (or `git rebase --abort` to drop it), 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.
Before it commits, commit validates the workspace config and the trigger, schedule, and webhook
declarations of the workflows you changed, and returns a 400 if either is invalid. Nothing is committed
in that case. It doesn’t type-check, and a build can succeed with type errors, so run
check first.
If the workspace has newer commits than your session,
commit replays your changes on top and the
response includes a note. Re-read files before editing them again. If git can’t commit cleanly
(unresolved conflict markers, a rebase in progress, a detached HEAD, commits you made by hand with git commit, or another commit changed the same files), commit returns 409 with the files involved and the
commands to run. Fix it with
POST /bash, then commit again.Body
application/json
Response
The commit and the apps it changed
⌘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": "a1b2c3d4e5",
"name": "Agent console",
"buildStatus": "building"
}
],
"workspaceId": "8bce4d1edc51710f"
}{
"statusCode": 400,
"error": "Bad Request",
"message": "oldText matches 3 places in \"apps/agent-console/src/App.tsx\" - include more surrounding context to make it unique"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "API authorization header missing"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Workspace not found"
}{
"statusCode": 409,
"error": "Conflict",
"message": "Commit refused - a rebase is still in progress in /workspace, and a commit does not finish one. Finish it with `git rebase --continue` (or `git rebase --abort` to drop it), then commit again."
}