curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/coding/write-batch \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '
{
"files": [
{
"file_path": "src/pages/About.jsx",
"content": "export default function About() {\n return <h1>About</h1>;\n}\n"
},
{
"file_path": "src/pages/Home.jsx",
"content": "export default function Home() {\n return <h1>Home</h1>;\n}\n"
}
]
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/coding/write-batch"
payload = { "files": [
{
"file_path": "src/pages/About.jsx",
"content": "export default function About() {
return <h1>About</h1>;
}
"
},
{
"file_path": "src/pages/Home.jsx",
"content": "export default function Home() {
return <h1>Home</h1>;
}
"
}
] }
headers = {
"api_key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {api_key: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
files: [
{
file_path: 'src/pages/About.jsx',
content: 'export default function About() {\n return <h1>About</h1>;\n}\n'
},
{
file_path: 'src/pages/Home.jsx',
content: 'export default function Home() {\n return <h1>Home</h1>;\n}\n'
}
]
})
};
fetch('https://app.base44.com/api/apps/{app_id}/coding/write-batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.base44.com/api/apps/{app_id}/coding/write-batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'files' => [
[
'file_path' => 'src/pages/About.jsx',
'content' => 'export default function About() {
return <h1>About</h1>;
}
'
],
[
'file_path' => 'src/pages/Home.jsx',
'content' => 'export default function Home() {
return <h1>Home</h1>;
}
'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.base44.com/api/apps/{app_id}/coding/write-batch"
payload := strings.NewReader("{\n \"files\": [\n {\n \"file_path\": \"src/pages/About.jsx\",\n \"content\": \"export default function About() {\\n return <h1>About</h1>;\\n}\\n\"\n },\n {\n \"file_path\": \"src/pages/Home.jsx\",\n \"content\": \"export default function Home() {\\n return <h1>Home</h1>;\\n}\\n\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api_key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.base44.com/api/apps/{app_id}/coding/write-batch")
.header("api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"files\": [\n {\n \"file_path\": \"src/pages/About.jsx\",\n \"content\": \"export default function About() {\\n return <h1>About</h1>;\\n}\\n\"\n },\n {\n \"file_path\": \"src/pages/Home.jsx\",\n \"content\": \"export default function Home() {\\n return <h1>Home</h1>;\\n}\\n\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/coding/write-batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"files\": [\n {\n \"file_path\": \"src/pages/About.jsx\",\n \"content\": \"export default function About() {\\n return <h1>About</h1>;\\n}\\n\"\n },\n {\n \"file_path\": \"src/pages/Home.jsx\",\n \"content\": \"export default function Home() {\\n return <h1>Home</h1>;\\n}\\n\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"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"
}Save several app files
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.
Unlike the single-file route, this one follows the branch you are working on, so the writes land on that branch’s own sandbox rather than on main.
The response is the app document as it stands after the change, the same shape Get app returns.
curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/coding/write-batch \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '
{
"files": [
{
"file_path": "src/pages/About.jsx",
"content": "export default function About() {\n return <h1>About</h1>;\n}\n"
},
{
"file_path": "src/pages/Home.jsx",
"content": "export default function Home() {\n return <h1>Home</h1>;\n}\n"
}
]
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/coding/write-batch"
payload = { "files": [
{
"file_path": "src/pages/About.jsx",
"content": "export default function About() {
return <h1>About</h1>;
}
"
},
{
"file_path": "src/pages/Home.jsx",
"content": "export default function Home() {
return <h1>Home</h1>;
}
"
}
] }
headers = {
"api_key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {api_key: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
files: [
{
file_path: 'src/pages/About.jsx',
content: 'export default function About() {\n return <h1>About</h1>;\n}\n'
},
{
file_path: 'src/pages/Home.jsx',
content: 'export default function Home() {\n return <h1>Home</h1>;\n}\n'
}
]
})
};
fetch('https://app.base44.com/api/apps/{app_id}/coding/write-batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.base44.com/api/apps/{app_id}/coding/write-batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'files' => [
[
'file_path' => 'src/pages/About.jsx',
'content' => 'export default function About() {
return <h1>About</h1>;
}
'
],
[
'file_path' => 'src/pages/Home.jsx',
'content' => 'export default function Home() {
return <h1>Home</h1>;
}
'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.base44.com/api/apps/{app_id}/coding/write-batch"
payload := strings.NewReader("{\n \"files\": [\n {\n \"file_path\": \"src/pages/About.jsx\",\n \"content\": \"export default function About() {\\n return <h1>About</h1>;\\n}\\n\"\n },\n {\n \"file_path\": \"src/pages/Home.jsx\",\n \"content\": \"export default function Home() {\\n return <h1>Home</h1>;\\n}\\n\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api_key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.base44.com/api/apps/{app_id}/coding/write-batch")
.header("api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"files\": [\n {\n \"file_path\": \"src/pages/About.jsx\",\n \"content\": \"export default function About() {\\n return <h1>About</h1>;\\n}\\n\"\n },\n {\n \"file_path\": \"src/pages/Home.jsx\",\n \"content\": \"export default function Home() {\\n return <h1>Home</h1>;\\n}\\n\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/coding/write-batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"files\": [\n {\n \"file_path\": \"src/pages/About.jsx\",\n \"content\": \"export default function About() {\\n return <h1>About</h1>;\\n}\\n\"\n },\n {\n \"file_path\": \"src/pages/Home.jsx\",\n \"content\": \"export default function Home() {\\n return <h1>Home</h1>;\\n}\\n\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"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"
}Authorizations
Personal API key.
Path Parameters
ID of the app whose code to change.
Body
The files to save, 1 to 50 of them. All are validated before any is written.
1 - 50 elementsShow child attributes
Show child attributes
Response
The app after the writes.
An app in a workspace, limited to the properties the caller requested.
ID of the app.
"6820f3a4e7b91d003c45a1f2"
Display name of the app.
"My CRM"
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.
"my-crm-3c45a1f2"
Description of the app, or null if none was set. On a newly created app this holds the original prompt text.
"A CRM to track leads and deals"
Email of the user who created the app.
"developer@example.com"
Time the app was created, as a UTC timestamp in ISO 8601 format.
"2026-08-01T09:15:00"
Time the app document was last written, as a UTC timestamp in ISO 8601 format.
"2026-08-02T14:30:00"
The app's current build status. Poll while a build is in progress to watch it finish. This tracks building, not publishing.
Show child attributes
Show child attributes
Time the app was last published, as a UTC timestamp in ISO 8601 format, or null if it has never been published.
"2026-08-02T14:30:00"
URL of a screenshot of the published app. Captured shortly after each publish, so it can briefly lag or be null right after publishing.
"https://storage.base44.com/screenshots/6820f3a4e7b91d003c45a1f2.png"
URL of a preview screenshot taken before publishing, distinct from screenshot_url, or null if none has been captured.
"https://storage.base44.com/previews/6820f3a4e7b91d003c45a1f2.png"
Was this page helpful?