PUT
/v1/apps/{applicationId}/sitebetaapiKeyworkspace
When to use
Save a complete uploaded site as the app draft.
For agents
Use the draft ref read before editing; a conflict requires reconciliation. Build locally with relative asset URLs. Save does not publish: use client.revisions.publish with the version token returned by revisions.list, checking that its draft matches your saved revision.
Example
import { PermuteClient } from '@permute/sdk';
const orgClient = new PermuteClient({
apiKey: process.env.PERMUTE_API_KEY!,
});
const client = orgClient.withWorkspace(process.env.PERMUTE_WORKSPACE_ID!);
const result = await client.apps.saveSite('appl_abcdefghijklmnopqrstuvwx', {
"site": {
"files": [
{
"path": "index.html",
"sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"size": 1024
}
],
"spa": true
},
"expectedDraft": {
"revisionId": "rvsn_draft123",
"sequence": 1
}
});Request body
{
"site": {
"files": [
{
"path": "index.html",
"sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"size": 1024
}
],
"spa": true
},
"expectedDraft": {
"revisionId": "rvsn_draft123",
"sequence": 1
}
}Response
{
"data": {
"id": "appl_abcdefghijklmnopqrstuvwx",
"workspaceId": "wksp_finance123",
"name": "Operations portal",
"description": "Internal operations portal",
"deployment": {
"status": "deploying",
"url": "https://operations-portal-abcdefghijklmnopqrstuvwx.permute.site",
"revisionId": "rvsn_draft123",
"error": null
},
"draft": {
"revisionId": "rvsn_draft123",
"sequence": 1
},
"createdAt": "2026-09-30T12:00:00.000Z",
"updatedAt": "2026-09-30T12:00:00.000Z"
}
}