Skip to main content
POST
Import a Claude Code or Codex 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

A value you generate for this import, 8 to 100 characters, such as a UUID. Send the same value when you retry the import, and a new one for every other import. A retry with the same value, file, and source_branch within 24 hours returns the first response instead of importing again. Keys are scoped to the user and the app.

Required string length: 8 - 100

Path Parameters

app_id
string
required

ID of the imported app to import the session into.

Body

multipart/form-data

A Claude Code or Codex session to import.

file
file
required

The session file, a Claude Code .jsonl transcript or a Codex rollout-*.jsonl file of up to 25 MB.

source_branch
string | null

The Git branch the session is on now. It wins over the branch recorded in the file, which can predate a push. Leave it out to use the file's branch.

Maximum string length: 255
Example:

"fix-login-redirect"

Response

The branch the session was imported into.

branch_id
string
required

ID of the Base Code branch the session was imported into.

Example:

"6820f3a4e7b91d003c45a1f3"

branch_name
string
required

Name of that branch. When continued is true, it's the session's own Git branch.

Example:

"fix-login-redirect"

source
enum<string>
required

The tool that recorded the session. Either "claude_code" or "codex".

Available options:
claude_code,
codex
Example:

"claude_code"

turn_count
integer
required

Number of messages written to the branch's chat.

Example:

42

branch_url
string
required

Path of the branch in the app editor. Append it to the Base44 address to open it.

Example:

"/apps/6820f3a4e7b91d003c45a1f1/editor/preview?branch=fix-login-redirect"

continued
boolean
required

Whether the session continues on its own branch. The value is true when Base Code adopted the session's branch and false when it created a new branch from source_ref.

Example:

true

source_ref
string
required

Git branch the Base Code branch comes from. It's the session's branch when that's in the repository, and the repository's default branch when it isn't.

Example:

"fix-login-redirect"