POST
/v1/apps/{applicationId}/uploadsbetaapiKeyworkspace
When to use
Upload source or compiled files before saving an app draft.
For agents
Prefer client.apps.uploadFiles, which hashes bytes and performs signed PUTs. Send only returned headers to storage, never your API key. A 412 is safe to continue; saveSite verifies the stored checksum.
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.prepareUploads('appl_abcdefghijklmnopqrstuvwx', {
"files": [
{
"path": "index.html",
"sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"size": 1024
}
]
});Request body
{
"files": [
{
"path": "index.html",
"sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"size": 1024
}
]
}Response
{
"data": {
"uploads": [
{
"path": "index.html",
"url": "https://uploads.example.com/signed-file",
"headers": {
"if-none-match": "*",
"content-length": "1024",
"x-amz-checksum-sha256": "checksum-from-response"
}
}
]
}
}