Skip to main content
Client App BuilderVersion: v3

Register, rename or remove a React Native app's screens.

POST/ai-builder-api/cli/projects/{projectId}/sandbox/extension-routes

Changes the screen list of a React Native app (react_native_app_kernel_v1) once its screen files are written with POST .../sandbox/edit: app-extensions/routes.ts is generated from these changes, never written as text. Send several changes as one batch: all of them apply or none does, and a resent batch that is already in effect changes nothing (a repeated single add is refused as duplicate_id). The run started next with externalAgent: true checks the screens, saves them as a mobile revision and deploys the preview.

Authorizations

Authorizationstringheaderrequired

Bearer authentication header of the form Bearer <token>, where <token> is your access token.

Scope:clientportal-ai.write
Auth methods:OAuthPrivate Integration
Token type:Sub-Account Token

Request​

Headers

Versionstringrequired

The API version.

Available optionsv3
Example:v3

Path Parameters

projectIdstringrequired

Project identifier.

Possible values: Value must match regular expression ^prj_[A-Za-z0-9_-]+$

Example:prj_01HXQ8Z6J9K2

Body

actionobjectrequired

One change, or several as { "action": "batch", "changes": [...] }. A change is { "action": "add", "route": { "id", "label", "icon", "requires"?, "parent"?, "copyKey"?, "filledIcon"? } }, { "action": "rename", "id", "newId", "label"? } or { "action": "remove", "id" }. id is kebab-case and names the screen file; icon is one of the kernel's icon names, and an unknown one is refused; parent makes the screen a detail pushed from that route.

Response

The route change, or why it was refused (ok false with reason and error).

okbooleanrequired

Whether the change applied. False changes nothing; reason, error and problems say why.

Example:true
actionstring

The action that applied.

Available optionsaddrenameremovebatch
Example:batch
changedobject

The route id a single change added, renamed to or removed; for a batch, every such id.

unchangedstring[]

Ids whose change in the batch was already in effect.

Example:[]
routesobject[]

The app's routes after the change.

summarystring

What changed, in one sentence.

Example:Added class-schedule.
reasonstring

Why the change was refused, as a code.

Example:duplicate_id
errorstring

Why the change was refused, in words.

Example:change 0: screen id "class-schedule" is already registered
problemsobject[]

Every problem a refused batch found, so one answer fixes them all.