Shotstash
API referenceGraphQL referenceMutations

Initiate Upload

Starts a resumable upload; parts travel over REST (see UploadSession). Needs upload.

Starts a resumable upload; parts travel over REST (see UploadSession). Needs upload.

Arguments

input*

The upload.

Returns

UploadSession!
  1. returns

One resumable upload. Parts (1 to partCount) go to PUT /api/v1/uploads/{id}/parts/{n} with a Content-MD5 header; every part but the last is partSize bytes.

id*ID!

Upload session id.

fileId?ID

The file this upload fills (status uploading until completion).

filename*String!

Name of the file being uploaded.

totalSize*BigInt!

Total size in bytes.

partSize*Int!

Size of every part but the last, in bytes.

partCount*Int!

Number of parts.

status*String!

IN_PROGRESS, COMPLETING, COMPLETED, FAILED or EXPIRED.

confirmedParts*[Int!]!

Part numbers the server already stored (a resume sends only the rest).

projectId*ID!

Target project.

folderId*ID!

Target folder.

expiresAt*DateTime!

When the session expires if not completed.

mutation InitiateUpload($input: InitiateUploadInput!) {  initiateUpload(input: $input) {    id    fileId    filename    totalSize    partSize    partCount    status    confirmedParts  }}