---
title: "Import files"
method: POST
path: "/connections/{connection_id}/imports"
tags: ["imports"]
---

# Import files

`POST /connections/{connection_id}/imports`

This method imports one or more files from the connected provider account into the platform as assets. Video files can be up to 10 GB, audio files up to 4 GB, and images up to 32 MB. Each newly imported file creates an asset in the `processing` status and is downloaded asynchronously. If you import a file that was already imported through this account, the platform returns the existing asset with its current status, which may be `ready`, without downloading the file again. The response returns one entry per requested file, in request order.

## Path parameters

- `connection_id` string, required

## Headers

- `x-api-key` string, required

## Request body

- object
  - `items` ConnectionsConnectionIdImportsPostRequestBodyContentApplicationJsonSchemaItemsItems[], required — The files to import. Provide an array of one item for a single import, or multiple items for a batch import. A maximum of 100 items can be imported per request. Each `source_id` must be unique within a request.
    - `source_id` string, required — The identifier of the file at the provider. For Google Drive, this is the Drive file identifier.

## Response `202`

The import request has been accepted. The response returns one item per requested file, in request order. An accepted item includes the `asset_id` and `status` fields. A rejected item includes an `error` object instead and omits those fields. The `has_failures` field is `true` when any item was rejected.

- ImportResult — The result of an import request, returned by the Import files endpoint.
  - `_id` string — The unique identifier of the import created for this request.
  - `has_failures` boolean — Whether any item was rejected before an asset was created. When `true`, inspect the `error` object of each item to identify the rejected ones.
  - `items` ImportItem[] — One entry per requested file, in request order.
    - `source_id` string — The identifier of the file at the provider. For Google Drive, this is the Drive file identifier.
    - `asset_id` string — The unique identifier of the asset created for this file. Absent when the item was rejected before an asset was created.
    - `status` 'processing' | 'ready' | 'failed' — The status of the asset. See [The import object](/v1.3/api-reference/data-connectors/imports/the-import-object#item-statuses) for the possible values. Absent when the item was rejected before an asset was created, in which case an `error` object is present.
    - `error` ImportItemError — Details of the rejection. Present when the item was rejected before an asset was created, in which case the `status` field is absent.
      - `code` string — A string representing the code associated with the error. See the [Error codes](/v1.3/api-reference/error-codes) page for details. Possible values include `source_unavailable`, `source_not_authorized`, `unsupported_media_type`, `video_filesize_too_large`, `audio_filesize_too_large`, and `media_filesize_too_large`.
      - `message` string — A human-readable string describing the error, intended to be suitable for display in a user interface.

## Other responses

- `400` — The request has failed.
- `404` — The specified connection does not exist.
- `409` — The connection is not in an active state.

---

[API](https://skmtc.net/twelvelabs/apis/twelvelabs-api.md) · [All operations](https://skmtc.net/twelvelabs/apis/twelvelabs-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/twelvelabs/twelvelabs-api/revisions/b6d766c2c340/schema)
