Use the Partner API when you need to replace a saved source file directly. Back up the original first and avoid writing while the builder is editing the same file.
Read the current files
With a key that permits apps:read, call GET /api/v1/managed_apps/APP_ID/files. The response contains a files array with each file's path, content, size and updated_at.
Replace one file
Send POST /api/v1/mcp/execute_tool with your API key in the Authorization: Bearer YOUR_KEY header and Content-Type: application/json:
{
"app_id": "APP_ID",
"tool": "overskill-write-file",
"params": {
"path": "src/example.ts",
"content": "// the complete replacement file
"
}
}
The key must permit apps:write. A successful response is HTTP 200 with success: true, the saved path, byte size, a message and preview URL. Check success, not just the HTTP status.
The write saves that file and queues a preview rebuild. It does not create an app version or publish the live app. Reading and writing files does not itself run a billed builder turn.
Verify before continuing
Read the file again and compare its content with what you intended to save. A timeout or server error does not prove that nothing was saved: persistence can succeed before a later preview step fails.
This endpoint does not provide conditional updates with an ETag or a multi-file transaction. Coordinate your own edits so you do not overwrite another writer. Check Preview after all related files are saved, then publish separately.
Custom endpoint definitions and scheduled tasks are stored separately from ordinary source files. Writing a file named server/manifest.json does not by itself install those definitions. See Exporting your data for how an export represents server code.