curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/imported/sessions/{session_id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.base44.com/api/apps/{app_id}/imported/sessions/{session_id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.base44.com/api/apps/{app_id}/imported/sessions/{session_id}/cancel', 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://app.base44.com/api/apps/{app_id}/imported/sessions/{session_id}/cancel",
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://app.base44.com/api/apps/{app_id}/imported/sessions/{session_id}/cancel"
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://app.base44.com/api/apps/{app_id}/imported/sessions/{session_id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/imported/sessions/{session_id}/cancel")
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{
"id": "6820f3a4e7b91d003c45a1f2",
"state": "running",
"message_id": "ca00e880-1111-4444-aaaa-ccddeeff0011",
"repository_full_name": "acme/project",
"branch_id": "6820f3a4e7b91d003c45a1f3",
"branch_name": "codex/session-6820f3a4e7b91d003c45a1f2",
"session_url": "https://app.base44.com/apps/6820f3a4e7b91d003c45a1f2/editor/preview",
"pull_request": {
"number": 123,
"url": "https://github.com/acme/project/pull/123"
},
"error_code": "execution_failed",
"launch_key": "flag-cleanup-123",
"client_reference": "release-task-123",
"input_request_id": "ca00e880-1111-4444-aaaa-ccddeeff0011"
}{
"error": {
"code": "not_found",
"message": "App not found",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "App not found",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "App not found",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "App not found",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "App not found",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "App not found",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "App not found",
"details": {}
}
}Cancel coding session
Request that a coding session stop. Authenticate with a platform Bearer token whose user has write access to the app. Repeating cancellation is safe. Cancellation is cooperative and doesn’t delete commits or an already opened pull request. Shares the launch limit of 6 requests per minute per user. Responses include X-Request-Id and rate-limit headers.
curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/imported/sessions/{session_id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.base44.com/api/apps/{app_id}/imported/sessions/{session_id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.base44.com/api/apps/{app_id}/imported/sessions/{session_id}/cancel', 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://app.base44.com/api/apps/{app_id}/imported/sessions/{session_id}/cancel",
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://app.base44.com/api/apps/{app_id}/imported/sessions/{session_id}/cancel"
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://app.base44.com/api/apps/{app_id}/imported/sessions/{session_id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/imported/sessions/{session_id}/cancel")
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{
"id": "6820f3a4e7b91d003c45a1f2",
"state": "running",
"message_id": "ca00e880-1111-4444-aaaa-ccddeeff0011",
"repository_full_name": "acme/project",
"branch_id": "6820f3a4e7b91d003c45a1f3",
"branch_name": "codex/session-6820f3a4e7b91d003c45a1f2",
"session_url": "https://app.base44.com/apps/6820f3a4e7b91d003c45a1f2/editor/preview",
"pull_request": {
"number": 123,
"url": "https://github.com/acme/project/pull/123"
},
"error_code": "execution_failed",
"launch_key": "flag-cleanup-123",
"client_reference": "release-task-123",
"input_request_id": "ca00e880-1111-4444-aaaa-ccddeeff0011"
}{
"error": {
"code": "not_found",
"message": "App not found",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "App not found",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "App not found",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "App not found",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "App not found",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "App not found",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "App not found",
"details": {}
}
}Authorizations
Personal access token, sent as Authorization: Bearer <token>. Each operation lists the permission it needs: read_only or full_access. A full-access token can call every operation. A read-only token can call only the operations that list read_only; anything else returns 403 read_only_credential_route_not_allowed.
Path Parameters
The session's identifier.
^[a-f0-9]{24}$"6820f3a4e7b91d003c45a1f2"
Response
Successful Response
The session's opaque identifier.
"6820f3a4e7b91d003c45a1f2"
The session's state: queued, running, opening_pull_request, needs_input, completed, failed, cancelling, or cancelled.
queued, running, opening_pull_request, needs_input, completed, failed, cancelling, cancelled "running"
The UUID of the session's user message, or null before dispatch. Queued processing updates it to the UUID used for the turn.
"ca00e880-1111-4444-aaaa-ccddeeff0011"
The connected repository the session runs in.
"acme/project"
The session's Base Code branch identifier, or null before provisioning.
"6820f3a4e7b91d003c45a1f3"
The session's working Git branch, or null before provisioning.
"codex/session-6820f3a4e7b91d003c45a1f2"
The Base Code editor URL for inspecting the session or answering pending questions, or null until its branch is provisioned.
"https://app.base44.com/apps/6820f3a4e7b91d003c45a1f2/editor/preview"
The session's pull request, or null until one is opened.
Show child attributes
Show child attributes
{
"number": 123,
"url": "https://github.com/acme/project/pull/123"
}
The stable failure cause, or null if there is no failure.
"execution_failed"
The original Idempotency-Key, or null for sessions created before key recovery was recorded. Use the same principal and key to retry a queued launch.
"flag-cleanup-123"
Your application reconciliation reference, or null.
"release-task-123"
Opaque identifier of the current question or approval pause, or null when the session is not waiting for input or the pause predates identifier tracking. Use it to deduplicate notifications for repeated input requests.
"ca00e880-1111-4444-aaaa-ccddeeff0011"
Was this page helpful?