Read an upload

Read an upload started with POST /uploads. Its Location header names this URL.

GET https://sitepaste.com/api/v1/public/uploads/{uploadId}

Requires the media scope.

Read this when an upload fails partway. If your PUT to the upload URL times out, you cannot tell whether the bytes arrived, and status answers it. pending means send them again, uploaded means go straight to the completion.

Usage

curl "https://sitepaste.com/api/v1/public/uploads/$UPLOAD_ID" \
  -H "Authorization: Bearer $TOKEN"

Response

200 OK

{
  "id": "liuMcQRtmAmMen7IUd6wU9pA",
  "type": "direct",
  "fileName": "9f2c1ab4d0e77135.png",
  "status": "uploaded",
  "size": 20481
}
FieldMeaning
idThe upload’s id, the same handle you were given
typedirect for a single PUT, multipart for a parted upload
fileNameThe upload’s name while it is in progress. It is not the media library’s fileId, because completion converts images to WebP and gives the file a new name
statuspending until the file has been received, uploaded once it has and completion is the next step, completed once the upload has been completed into the media library
fileIdThe media library id of the completed file, for the media routes. Present only when status is completed
sizeBytes received; absent while pending

Only a direct upload reads uploaded. A multipart upload reads pending until it reads completed.

A completed upload reads back as:

{
  "id": "liuMcQRtmAmMen7IUd6wU9pA",
  "type": "direct",
  "fileName": "9f2c1ab4d0e77135.png",
  "status": "completed",
  "fileId": "f8e2a1b3c4d5.webp",
  "size": 20481
}
CodeMeaning
404The id is not one this API issued, or names an upload in another workspace.
503Storage is unavailable, so the upload’s state cannot be read. Retry later.