Skip to content

Media uploads

Files go straight from you to storage — they never pass through our API server. An upload is three calls:

1. POST /workspaces/{id}/media/uploads → { uploadId, mediaId, uploadUrl, expiresAt }
2. PUT <uploadUrl> (the file bytes) → ETag header
3. POST /workspaces/{id}/media/{mediaId}/confirm { "uploadId": "…", "eTag": "…" }
  1. Start. Send fileName, contentType, fileSize and kind (IMAGE or VIDEO). The server checks them against your plan and returns a short-lived uploadUrl.
  2. Upload. PUT the bytes to uploadUrl with the same Content-Type. Do not send your API token here — the URL is already signed.
  3. Confirm. Send back the uploadId and the ETag from step 2. Then put the mediaId in a post’s mediaIds. The server checks the stored file again and the media is ready to attach to a post.

The upload URL expires after a short time; start again if it does. The CLI does all three steps for you: sp media upload logo.png.

Exact request fields are in the API reference.