Save several app files

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Saves several files into the app in one call, the way the builder's visual editor does.

Send up to 50 files. Every path is validated before anything is written, so one bad path fails the whole batch with a 400 and leaves the app untouched. An empty files list is a 400 rather than a no-op.

This route never deploys, so it refuses backend code: a path under functions/ answers 422 rather than writing source that the live function wouldn't match. Use Save an app file for those, one at a time, and this one for the frontend files a visual edit touches.

Internally this route can follow a feature branch, but the parameter that selects one isn't part of the public API, so writes through this endpoint land on the app's main line.

The response is the app document as it stands after the change, the same shape Get app returns.

<Note>This endpoint accepts a personal API key. Workspace API keys are not authorized for it and are rejected with a 403.</Note>

<Warning>The response includes fields beyond the ones documented here. Don't rely on undocumented response fields, as they can change at any time. Send only the fields documented here. Other request fields are not supported and their behavior can change.</Warning>

post/api/apps/{app_id}/coding/write-batch

Path parameters

app_idstring required

ID of the app whose code to change.

ID of the app whose code to change.

Request body

Response

The app after the writes.

idstring nullable

ID of the app.

namestring nullable

Display name of the app.

slugstring nullable

URL slug for the app, auto generated from the name and app ID or set to a custom value, or null if the app has no slug yet. The published URL is built from it.

user_descriptionstring nullable

Description of the app, or null if none was set. On a newly created app this holds the original prompt text.

created_bystring nullable

Email of the user who created the app.

created_datestring date-time nullable

Time the app was created, as a UTC timestamp in ISO 8601 format.

updated_datestring date-time nullable

Time the app document was last written, as a UTC timestamp in ISO 8601 format.

last_deployed_atstring date-time nullable

Time the app was last published, as a UTC timestamp in ISO 8601 format, or null if it has never been published.

screenshot_urlstring nullable

URL of a screenshot of the published app. Captured shortly after each publish, so it can briefly lag or be null right after publishing.

preview_screenshot_urlstring nullable

URL of a preview screenshot taken before publishing, distinct from screenshot_url, or null if none has been captured.

Example response

{
  "id": "6820f3a4e7b91d003c45a1f2",
  "name": "My CRM",
  "slug": "my-crm-3c45a1f2",
  "user_description": "A CRM to track leads and deals",
  "created_by": "developer@example.com",
  "created_date": "2026-08-01T09:15:00",
  "updated_date": "2026-08-02T14:30:00",
  "status": {
    "state": "ready",
    "details": "Publishing app",
    "request_id": "a1b2c3d4e5f67890abcdef12",
    "last_updated_date": "2026-08-02T14:30:00Z",
    "error_source": "build",
    "paywall_context": {
      "billing_organization_id": "67e0b12c4d8a3f005b21c9e4",
      "user_id": "6706af53b9c1e2004a37d85f",
      "evaluated_at": "2026-08-02T14:30:00Z"
    }
  },
  "last_deployed_at": "2026-08-02T14:30:00",
  "screenshot_url": "https://storage.base44.com/screenshots/6820f3a4e7b91d003c45a1f2.png",
  "preview_screenshot_url": "https://storage.base44.com/previews/6820f3a4e7b91d003c45a1f2.png"
}

Changes

Changed in 1 of the 4 revisions of this API.1