> ## Documentation Index
> Fetch the complete documentation index at: https://dev.ownright.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Staged File Upload Create

> Creates a staged file upload.

<RequestExample>
  ```graphql Request [expandable] theme={null}
  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
      }
    }
  }
  ```

  ```graphql Variables theme={null}
  {
    "input": {
      "filename": "document.pdf",
      "mimeType": "DOCUMENT_DOC"
    }
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "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": []
      }
    }
  }
  ```
</ResponseExample>

## Mutation field

`stagedFileUploadCreate`

### Arguments

<ParamField path="input" type="StagedFileUploadInput!" required>
  Input required to make a staged file upload.

  <Expandable title="properties">
    <ParamField path="filename" type="String!" required>
      The name of the file that is being uploaded.
    </ParamField>

    <ParamField path="mimeType" type="FileMimeType!" required>
      The MIME type of the file that is being uploaded.
    </ParamField>
  </Expandable>
</ParamField>

### Return fields

<ResponseField name="stagedFileUpload" type="StagedFileUpload">
  The newly created staged file upload.

  <Expandable title="properties">
    <ResponseField name="file" type="File!" required>
      The file that is staged for upload.

      <Expandable title="properties">
        <ResponseField name="createdAt" type="ISO8601DateTime!" required>
          The date the file was created.
        </ResponseField>

        <ResponseField name="filename" type="String!" required>
          The name of the file.
        </ResponseField>

        <ResponseField name="formattedSize" type="String!" required>
          The size of the file in a human-readable format.
        </ResponseField>

        <ResponseField name="id" type="FileRecordGID!" required>
          The GID of the file record.
        </ResponseField>

        <ResponseField name="mimeType" type="FileMimeType!" required>
          The MIME type of the file.
        </ResponseField>

        <ResponseField name="size" type="Int!" required>
          The size of the file in bytes.
        </ResponseField>

        <ResponseField name="staged" type="Boolean!" required>
          Whether the file is staged for upload or not.
        </ResponseField>

        <ResponseField name="updatedAt" type="ISO8601DateTime!" required>
          The date the file was last updated.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="signedUploadUrl" type="Url!" required>
      A signed upload URL to use when uploading file.
    </ResponseField>

    <ResponseField name="signedUploadUrlExpiryDate" type="ISO8601DateTime!" required>
      Date when upload URL expires.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="userErrors" type="[StagedFileUploadCreateUserError!]!" required>
  List of errors that occurred while executing the mutation.

  <Expandable title="properties">
    <ResponseField name="code" type="StagedFileUploadCreateUserErrorCode">
      Error code associated with the error.
    </ResponseField>

    <ResponseField name="field" type="[String!]">
      The path to the input field that caused the error.
    </ResponseField>

    <ResponseField name="message" type="String!" required>
      A description of the error.
    </ResponseField>
  </Expandable>
</ResponseField>

### Types

* [`File`](/lender-api/reference/members/interfaces/file) (interface) — Represents a file.
* [`FileMimeType`](/lender-api/reference/members/enums/file-mime-type) (enum) — Possible MIME types for files.
* [`FileRecordGID`](/lender-api/reference/members/scalars/file-record-gid) (scalar) — A global identifier for a FileRecord object in format of 'gid://ownright/FileRecord/ID'.
* [`ISO8601DateTime`](/lender-api/reference/members/scalars/iso8601-date-time) (scalar) — An ISO 8601-encoded datetime
* [`StagedFileUpload`](/lender-api/reference/members/objects/staged-file-upload) (object) — Represents a staged file upload.
* [`StagedFileUploadCreatePayload`](/lender-api/reference/members/objects/staged-file-upload-create-payload) (object) — Return type for the `stagedFileUploadCreate` mutation.
* [`StagedFileUploadCreateUserError`](/lender-api/reference/members/objects/staged-file-upload-create-user-error) (object) — An error that could occur during the execution of the `stagedFileUploadCreate` mutation.
* [`StagedFileUploadCreateUserErrorCode`](/lender-api/reference/members/enums/staged-file-upload-create-user-error-code) (enum) — Possible error codes that can be returned by StagedFileUploadCreateUserError.
* [`StagedFileUploadInput`](/lender-api/reference/members/inputs/staged-file-upload-input) (input) — Input to create a staged file upload.
* [`Url`](/lender-api/reference/members/scalars/url) (scalar) — A valid URL, transported as a string.
