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

# Import external file

> Import external file.

`importExternalFile(input: ExternalStorageImportInput!): ExternalStorageImport!`

Requires project.uploads.write.

## Arguments

| Argument | Type | Required |
| - | - | - |
| `input` | [`ExternalStorageImportInput!`](https://veryfront.com/docs/cloud/graphql/types/externalstorageimportinput) | Yes |

## Input fields

### input

[`ExternalStorageImportInput`](https://veryfront.com/docs/cloud/graphql/types/externalstorageimportinput)

| Field | Type | Required | Description |
| - | - | - | - |
| `provider` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | Yes | Storage provider accessed through the caller's own personal connection. A human caller is required; agent, run, and service-account credentials are refused. |
| `projectReference` | [`String`](https://veryfront.com/docs/cloud/graphql/types/string) | No | Project 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. |
| `fileId` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | Yes | |
| `basePath` | [`String`](https://veryfront.com/docs/cloud/graphql/types/string) | No | |
| `folderPath` | [`String`](https://veryfront.com/docs/cloud/graphql/types/string) | No | Destination folder inside Uploads; the Uploads root when omitted. |
| `timestampPrefix` | [`Boolean`](https://veryfront.com/docs/cloud/graphql/types/boolean) | No | |
| `visibility` | [`UploadFolderVisibility`](https://veryfront.com/docs/cloud/graphql/types/uploadfoldervisibility) | No | Visibility of the new upload; inherited from the destination when omitted. Setting it needs upload admin access on the destination, and public a paid plan. |
| `idempotencyKey` | [`String`](https://veryfront.com/docs/cloud/graphql/types/string) | No | 1-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!`](https://veryfront.com/docs/cloud/graphql/types/externalstorageimport). Open the type for its fields and nested types.

| Field | Type | Description |
| - | - | - |
| `upload` | [`ExternalFileImportUpload!`](https://veryfront.com/docs/cloud/graphql/types/externalfileimportupload) | The upload the file was copied into. |
| `source` | [`ExternalFileImportSource!`](https://veryfront.com/docs/cloud/graphql/types/externalfileimportsource) | The provider file that was imported. |

Types marked with `!` cannot be null. Lists use `[Type]` notation. The [type index](https://veryfront.com/docs/cloud/graphql/schema.md) lists all published input and response types.

## Example

```graphql title="query.graphql" theme={null}
mutation ImportExternalFile($input: ExternalStorageImportInput!) {
  importExternalFile(input: $input) {
    upload {
      id
      projectId
      name
      mimeType
      path
    }
    source {
      fileId
      provider
    }
  }
}
```

```json title="variables.json" theme={null}
{
  "input": {
    "provider": "drive",
    "projectReference": "example-project",
    "fileId": "00000000-0000-4000-8000-000000000001"
  }
}
```

<details>
  <summary>Try this mutation</summary>

  Calls use `https://api.veryfront.com/graphql`. Replace sample values with resources you can access. See [Authentication](https://veryfront.com/docs/cloud/authentication.md) for credentials and permissions.

  Bearer token or API key

  Stored in this tab's session. Clear credential

  Mutation

  Variables (JSON)
</details>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.