PermuteDocs
Go to Permute

Apps · appsUploadsCreate

Prepare app file uploads

Returns ten-minute signed PUT URLs bound to each file SHA-256 and byte size. Send every returned header. A 412 means the immutable file already exists; saving verifies it. Upload limits: 1,000 files, 4 MiB per file, 50 MiB total. Compiled site manifests still allow at most 200 files. Requires app write permission. This does not save or publish a revision.

POST/v1/apps/{applicationId}/uploads
betaapiKeyworkspace

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

typescript
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

json
{
  "files": [
    {
      "path": "index.html",
      "sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "size": 1024
    }
  ]
}

Response

json
{
  "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"
        }
      }
    ]
  }
}