Skip to main content
POST
Launch coding session

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.

Headers

Idempotency-Key
string
required

A unique key for this task. Reuse it with the same runtime inputs on retries; you may omit the previously associated client_reference.

Required string length: 1 - 200
Pattern: ^[A-Za-z0-9_.:-]+$
Example:

"flag-cleanup-123"

Path Parameters

app_id
string
required

Body

application/json
prompt
string
required

The coding task to carry out and open a pull request for.

Required string length: 1 - 99611
Example:

"Remove the retired example-feature flag, preserving its enabled behavior."

title
string
required

A short name for the session.

Required string length: 1 - 200
Example:

"Remove example-feature"

existing_branch
string | null

An existing repository branch to work on, or null to create an isolated branch.

Required string length: 1 - 255
Example:

"feature/review-fixes"

source_ref
string | null

The Git ref a new branch starts from, or null for the imported base branch.

Required string length: 1 - 255
Example:

"main"

pull_request_body
string | null

Additional Markdown to include in the pull request description, or null.

Maximum string length: 20000
Example:

"Requested by the release workflow."

commit_message
string | null

An optional message for this session's commits, including any required trailers, or null for a generated message.

Required string length: 1 - 2000
Example:

"fix: remove the retired flag"

client_reference
string | null

An opaque reference used by your application to reconcile sessions, or null.

Required string length: 1 - 200
Pattern: ^[A-Za-z0-9_.:-]+$
Example:

"release-task-123"

expected_repository_full_name
string | null

The repository you expect this app to be connected to, or null to use its current connection. A mismatch refuses the launch before starting work.

Maximum string length: 201
Pattern: ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$
Example:

"acme/project"

Response

Successful Response

id
string
required

The session's opaque identifier.

Example:

"6820f3a4e7b91d003c45a1f2"

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:

"codex/session-6820f3a4e7b91d003c45a1f2"

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.

Example:

"ca00e880-1111-4444-aaaa-ccddeeff0011"