Import external file

importExternalFile(input: ExternalStorageImportInput!): ExternalStorageImport!

Requires project.uploads.write.

Arguments

ArgumentTypeRequired
inputExternalStorageImportInput!Yes

Input fields

input

ExternalStorageImportInput

FieldTypeRequiredDescription
providerString!YesStorage provider accessed through the caller's own personal connection. A human caller is required; agent, run, and service-account credentials are refused.
projectReferenceStringNoProject ID or slug. Requires project.uploads.write and destination upload edit permission; quota and plan limits apply. Uses the caller's own personal provider connection.
fileIdString!Yes
basePathStringNo
folderPathStringNoDestination folder inside Uploads; the Uploads root when omitted.
timestampPrefixBooleanNo
visibilityUploadFolderVisibilityNoVisibility of the new upload; inherited from the destination when omitted. Setting it needs upload admin access on the destination, and public a paid plan.
idempotencyKeyStringNo1-128 characters without whitespace. A retry with the same key and input within 24 hours returns the first import instead of importing again.

Response

Returns ExternalStorageImport!. Open the type for its fields and nested types.

FieldTypeDescription
uploadExternalFileImportUpload!The upload the file was copied into.
sourceExternalFileImportSource!The provider file that was imported.

Types marked with ! cannot be null. Lists use [Type] notation. The type index lists all published input and response types.

Example

graphql
mutation ImportExternalFile($input: ExternalStorageImportInput!) {
  importExternalFile(input: $input) {
    upload {
      id
      projectId
      name
      mimeType
      path
    }
    source {
      fileId
      provider
    }
  }
}
json
{
  "input": {
    "provider": "drive",
    "projectReference": "example-project",
    "fileId": "00000000-0000-4000-8000-000000000001"
  }
}