Skip to main content
POST
Cancel coding session on an imported app

Authorizations

Authorization
string
header
required

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

session_id
string
required

The session's identifier.

Pattern: ^[a-f0-9]{24}$
Example:

"6820f3a4e7b91d003c45a1f2"

app_id
string
required

Response

Successful Response

id
string
required

The session's opaque identifier.

Example:

"6820f3a4e7b91d003c45a1f2"

created_by_user_id
string
required

The ID of the user who launched the session. A session launched with a workspace API key reports the key's owner.

Example:

"6820f3a4e7b91d003c45a1f4"

state
enum<string>
required

The session's state: queued, running, opening_pull_request, needs_input, completed, failed, cancelling, or cancelled.

Available options:
queued,
running,
opening_pull_request,
needs_input,
completed,
failed,
cancelling,
cancelled
Example:

"running"

message_id
string | null
required

The UUID of the session's user message, or null before dispatch. Queued processing updates it to the UUID used for the turn.

Example:

"ca00e880-1111-4444-aaaa-ccddeeff0011"

repository_full_name
string
required

The connected repository the session runs in.

Example:

"acme/project"

branch_id
string | null
required

The session's Base Code branch identifier, or null before provisioning.

Example:

"6820f3a4e7b91d003c45a1f3"

branch_name
string | null
required

The session's working Git branch, or null before provisioning.

Example:

"base-code/fix-login-redirect-45a1f2"

session_url
string | null
required

The Base Code editor URL for inspecting the session or answering pending questions, or null until its branch is provisioned.

Example:

"https://app.base44.com/apps/6820f3a4e7b91d003c45a1f2/editor/preview"

pull_request
SessionPullRequest · object | null
required

The session's pull request, or null until one is opened.

Example:
error_code
string | null
required

The stable failure cause, or null if there is no failure.

Example:

"execution_failed"

launch_key
string | null

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.

Example:

"flag-cleanup-123"

client_reference
string | null

Your application reconciliation reference, or null.

Example:

"release-task-123"

input_request_id
string | null

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. To answer, use the input_request_id from Get a coding session's open question.

Example:

"ca00e880-1111-4444-aaaa-ccddeeff0011"

error_reason
string | null

A short, human-readable explanation of error_code and what to do next, or null if there is no failure.

Example:

"The branch's sandbox ran out of disk space. Crash dumps were removed; send the message again."

outcome
enum<string> | null

How a completed session ended: pull_request when it opened or updated a pull request, answer when it ended without one and replied instead; has_unpublished_changes says whether that branch still changes files. null until the session completes.

Available options:
pull_request,
answer
Example:

"pull_request"

summary
string | null

The session's final reply in Markdown, up to 10,000 characters: the answer for an answer outcome, the change summary for a pull_request outcome. null until the session publishes.

Example:

"Removed the retired flag and kept the enabled behavior."

has_unpublished_changes
boolean
default:false

true when an answer session's branch changes files that no pull request carries yet: send a message asking for one to have the agent open it. false otherwise.

Example:

false

push_failed
boolean
default:false

true when a pull_request session's last changes did not reach the pull request's branch on GitHub because the push failed; summary then starts with a warning that says where the work is. false otherwise.

Example:

false