Skip to main content

Update an Existing Site

Publish a new version of an existing site. Uses hash deduplication — files with matching hashes are copied server-side and don’t need to be re-uploaded.
PUT /api/v1/publish/:slug

Path Parameters

slug
string
required
The site slug to update (e.g., bright-canvas-a7k2).

Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
AuthorizationYesBearer sl_live_...

Request Body

Same as Create a Site. The files array contains the complete file manifest for the new version.
files
array
required
Complete file manifest for the new version. Include all files, not just changed ones.

Example

curl -X PUT https://supalink.dev/api/v1/publish/bright-canvas-a7k2 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sl_live_your_key_here" \
  -d '{
    "files": [
      {
        "path": "index.html",
        "size": 2048,
        "contentType": "text/html",
        "hash": "newsha256hash64charslong..."
      },
      {
        "path": "style.css",
        "size": 512,
        "contentType": "text/css",
        "hash": "f6e5d4c3b2a1f6e5d4c3b2a1f6e5d4c3b2a1f6e5d4c3b2a1f6e5d4c3b2a1f6e5"
      }
    ]
  }'

Response (200)

{
  "slug": "bright-canvas-a7k2",
  "siteUrl": "https://bright-canvas-a7k2.supalink.dev/",
  "upload": {
    "versionId": "01jm4new789ghi012",
    "uploads": [
      {
        "path": "index.html",
        "method": "PUT",
        "url": "https://supalink.dev/api/v1/_upload/...",
        "headers": { "Content-Type": "text/html" }
      }
    ],
    "skipped": [
      {
        "path": "style.css",
        "reason": "hash_match"
      }
    ],
    "finalizeUrl": "https://supalink.dev/api/v1/publish/bright-canvas-a7k2/finalize",
    "expiresInSeconds": 3600
  }
}

How Deduplication Works

  1. Include the hash field (SHA-256) for each file in the manifest
  2. The API compares each hash against the previous version’s files
  3. Files with matching hashes appear in the skipped array — they are copied server-side
  4. Only files in the uploads array need to be uploaded
Always include hashes when updating. Without hashes, every file is treated as new and must be re-uploaded.
After uploading the non-skipped files, call Finalize with the new versionId.