Nurama Developers
Scratch

Finish a multipart upload for a scratch row.

Same shape as `POST /v1/assets/complete-upload`. Server runs `CompleteMultipartUploadCommand` against the media bucket, HEADs the resulting object to learn the real Content-Length, increments workspace storage usage via `storageService`, writes the `StorageUsageEvent` audit row, and flips status to `active`. Creator-only — service returns 403 when `Scratch.creatorId !== req.user.id`. Idempotent: calling it on an already-`active` row returns the same `{ id, url }` without touching the bucket.

POST
/scratch/{scratchId}/complete-upload

Same shape as POST /v1/assets/complete-upload. Server runs CompleteMultipartUploadCommand against the media bucket, HEADs the resulting object to learn the real Content-Length, increments workspace storage usage via storageService, writes the StorageUsageEvent audit row, and flips status to active. Creator-only — service returns 403 when Scratch.creatorId !== req.user.id. Idempotent: calling it on an already-active row returns the same { id, url } without touching the bucket.

Authorization

AuthorizationBearer <token>

OAuth 2.1 authorization code flow with PKCE (required of every client, public or confidential). Scopes are a ceiling on the credential, not a grant of access: a token also cannot exceed what the user who approved it may already do. A write scope does not imply its matching read — ask for both.

In: header

Scope: assets:write

Path Parameters

id*string
Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/scratch/{scratchId}/complete-upload" \  -H "Content-Type: application/json" \  -d '{    "uploadId": "string",    "parts": [      {        "ETag": "string",        "PartNumber": 1      }    ]  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "url": "string"}