Skip to main content
Version: 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.

Request​

Version stringrequired

The API version.

Available optionsv3
projectId stringrequired

Project identifier.

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

application/json

Bodyrequired

    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.

application/json

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

Schema
    okbooleanrequired

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

    actionstring

    The action that applied.

    Available optionsaddrenameremovebatch
    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.

    routesobject[]

    The app's routes after the change.

    summarystring

    What changed, in one sentence.

    reasonstring

    Why the change was refused, as a code.

    errorstring

    Why the change was refused, in words.

    problemsobject[]

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