> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.twelvelabs.io/v1.3/api-reference/data-connectors/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.twelvelabs.io/_mcp/server. # Data connectors > Import files from a connected Google Drive account into the platform. Use the Google Drive data connector to import files from your users' Google Drive accounts into the platform as assets. Each user grants your application access to their account, and you import the files they select on their behalf. A connection represents an authorized link to a user's Google Drive account. After you create a connection, you generate a short-lived access token for the Google Drive Picker, the user selects files, and you import those files as assets. **Import limits**: * Video: Up to 10 GB * Audio: Up to 4 GB * Images: Up to 32 MB You can import up to 100 files per request. # Workflow **Connect an account**: The platform connects a user's account through the standard [OAuth 2.0 authorization code flow](https://oauth.net/2/grant-types/authorization-code/). Invoke the [`POST`](/v1.3/api-reference/data-connectors/authorize-a-connection) method of the `/connections:authorize` endpoint with your redirect URI to receive an authorization URL, then redirect the user to it. If you've already [authorized specific redirect URIs](#authorized-redirect-uris), this URI must be one of them. When the user grants access, the platform returns them to your redirect URI with the identifier of the new connection in the `connection_id` query parameter. Store this identifier and pass it as the `connection_id` path parameter in the following steps. **Generate a picker token**: Invoke the [`POST`](/v1.3/api-reference/data-connectors/generate-a-picker-token) method of the `/connections/{connection_id}/picker-token` endpoint to generate a short-lived, read-only access token. Use it with the Google Drive Picker so the user can select files. Store the value of the `source_id` field of each file. **Import the files**: Invoke the [`POST`](/v1.3/api-reference/data-connectors/imports/import-files) method of the `/connections/{connection_id}/imports` endpoint. Provide up to 100 items, each with a value for the `source_id` field. Each item in the response contains a field named `action`. Use it to identify which files were newly imported and which were already imported. Unless the file was rejected, the item also contains the value of its `asset_id` field. For details, see [Item actions](/v1.3/api-reference/data-connectors/imports/the-import-object#item-actions) on **The import object** page. Check the `has_failures` field in the response, and inspect the `error` object of any item the platform rejected. **Check the import status**: Invoke the [`GET`](/v1.3/api-reference/data-connectors/imports/retrieve-an-import) method of the `/connections/{connection_id}/imports/{import_id}` endpoint until each item reaches the `ready` or `failed` status. When an item reaches the `ready` status, use the value of its `asset_id` field with the rest of the API, such as the [Index content](/v1.3/api-reference/index-content) endpoints. *(Optional)* **Disconnect the account**: Invoke the [`DELETE`](/v1.3/api-reference/data-connectors/delete-a-connection) method of the `/connections/{connection_id}` endpoint. The platform revokes access at the provider and deletes the stored tokens. Assets you already imported are retained. For the fields and statuses these endpoints return, see [The connection object](/v1.3/api-reference/data-connectors/the-connection-object) and [The import object](/v1.3/api-reference/data-connectors/imports/the-import-object) pages. To review existing connections and imports, use the [List connections](/v1.3/api-reference/data-connectors/list-connections) and [List imports](/v1.3/api-reference/data-connectors/imports/list-imports) endpoints. Imported files become assets, the same as files you upload directly. Each imported asset includes a field named `source` that describes the origin of the file at the provider. # Authorized redirect URIs By default, the [Authorize a connection](/v1.3/api-reference/data-connectors/authorize-a-connection) method accepts any redirect URI. To restrict it, authorize specific redirect URIs: once you register one or more, the method accepts only those. This keeps the OAuth callback (and the connection identifier it returns) from reaching an endpoint you don't control. Use the following endpoints to manage your authorized redirect URIs: * [Register a redirect URI](/v1.3/api-reference/data-connectors/register-a-redirect-uri): Authorize a redirect URI. Each URI must use HTTPS, resolve to a public host, and contain no wildcards. * [List redirect URIs](/v1.3/api-reference/data-connectors/list-redirect-uris): Return your authorized redirect URIs. * [Delete a redirect URI](/v1.3/api-reference/data-connectors/delete-a-redirect-uri): Remove a redirect URI so it is no longer authorized. > Import files from a connected Google Drive account into the platform. ## Docs - [The connection object](https://docs.twelvelabs.io/api-reference/data-connectors/the-connection-object.md): Connection object schema for data connectors. - [The import object](https://docs.twelvelabs.io/api-reference/data-connectors/imports/the-import-object.md): Import object schema for data connectors. ## API Docs - Data connectors [Authorize a connection](https://docs.twelvelabs.io/api-reference/data-connectors/authorize-a-connection.md) - Data connectors [List connections](https://docs.twelvelabs.io/api-reference/data-connectors/list-connections.md) - Data connectors [Retrieve a connection](https://docs.twelvelabs.io/api-reference/data-connectors/retrieve-a-connection.md) - Data connectors [Delete a connection](https://docs.twelvelabs.io/api-reference/data-connectors/delete-a-connection.md) - Data connectors [Generate a picker token](https://docs.twelvelabs.io/api-reference/data-connectors/generate-a-picker-token.md) - Data connectors [Register a redirect URI](https://docs.twelvelabs.io/api-reference/data-connectors/register-a-redirect-uri.md) - Data connectors [List redirect URIs](https://docs.twelvelabs.io/api-reference/data-connectors/list-redirect-uris.md) - Data connectors [Delete a redirect URI](https://docs.twelvelabs.io/api-reference/data-connectors/delete-a-redirect-uri.md) - Imports [Import files](https://docs.twelvelabs.io/api-reference/data-connectors/imports/import-files.md) - Imports [List imports](https://docs.twelvelabs.io/api-reference/data-connectors/imports/list-imports.md) - Imports [Retrieve an import](https://docs.twelvelabs.io/api-reference/data-connectors/imports/retrieve-an-import.md) ## OpenAPI Specification The raw OpenAPI 3.1 specification for this API is available at: - [OpenAPI JSON](https://docs.twelvelabs.io/v1.3/api-reference/data-connectors/openapi.json) - [OpenAPI YAML](https://docs.twelvelabs.io/v1.3/api-reference/data-connectors/openapi.yaml)