Skip to main content
mutation StagedFileUploadCreate($input: StagedFileUploadInput!) {
  stagedFileUploadCreate(input: $input) {
    stagedFileUpload {
      signedUploadUrl
      signedUploadUrlExpiryDate
      file {
        createdAt
        filename
        formattedSize
        id
        mimeType
        size
        staged
        updatedAt
        ... on Document {
          url
        }
        ... on Image {
          url
        }
        ... on Media {
          url
        }
      }
    }
    userErrors {
      code
      field
      message
    }
  }
}
{
  "data": {
    "stagedFileUploadCreate": {
      "stagedFileUpload": {
        "signedUploadUrl": "https://example.com",
        "signedUploadUrlExpiryDate": "2025-01-15T10:30:00Z",
        "file": {
          "createdAt": "2025-01-15T10:30:00Z",
          "filename": "document.pdf",
          "formattedSize": "example-formatted-size",
          "id": "gid://ownright/FileRecord/1",
          "mimeType": "DOCUMENT_DOC",
          "size": 1024,
          "staged": true,
          "updatedAt": "2025-01-15T10:30:00Z",
          "url": "https://example.com"
        }
      },
      "userErrors": []
    }
  }
}

Mutation field

stagedFileUploadCreate

Arguments

input
StagedFileUploadInput!
required
Input required to make a staged file upload.

Return fields

stagedFileUpload
StagedFileUpload
The newly created staged file upload.
userErrors
[StagedFileUploadCreateUserError!]!
required
List of errors that occurred while executing the mutation.

Types

enum FileMimeType {
  DOCUMENT_DOC # Represents the `application/msword` MIME type.
  DOCUMENT_DOCX # Represents the `application/vnd.openxmlformats-officedocument.wordprocessingml.documents` MIME type.
  DOCUMENT_PDF # Represents the `application/pdf` MIME type.
  IMAGE_HEIC # Represents the `image/heic` MIME type.
  IMAGE_JPEG # Represents the `image/jpeg` MIME type.
  IMAGE_PNG # Represents the `image/png` MIME type.
  IMAGE_TIFF # Represents the `image/tiff` MIME type.
}

enum StagedFileUploadCreateUserErrorCode {
  INVALID_FILENAME # The supplied filename is invalid.
}

scalar FileRecordGID # A global identifier for a FileRecord object in format of 'gid://ownright/FileRecord/ID'.
scalar ISO8601DateTime # An ISO 8601-encoded datetime
scalar Url # A valid URL, transported as a string.