---
title: "Import files from a connection"
method: POST
path: "/v1/sources/{id}/import"
tags: ["Sources"]
---

# Import files from a connection

`POST /v1/sources/{id}/import`

## Request

- Base URL: `https://api.talonic.com`
- URL: `https://api.talonic.com/v1/sources/{id}/import`
- Auth: HTTP bearer

Brings the named files (ids from `GET /v1/sources/{id}/browse`) in as documents of the workspace, attributed to the caller's person, and processes them. Files already imported are skipped. A personal connection can be imported from only by the person who connected it. A key that belongs to no person (one created before keys named their creator) is refused with 403.

**Two ways.** Without `async` the call imports before it answers (`201` with what was imported, skipped or failed): fit for a few files, since every file is fetched and read inside the request. With `async: true` the import is recorded and answered at once (`202` with the import run), then carried out in the background as the same person; read its progress and outcome from `GET /v1/sources/{id}/import-runs/{runId}`. Files that fail do not stop the others, and importing the same selection again brings in only what is not in yet. `folder_ids` (a mail, a thread: the files directly inside each are imported; a directory of a file store: everything under it, subfolders included) exist only with `async: true`.

**Scope:** `documents:write`. A key holding only the legacy `write` scope does not satisfy it.

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `file_ids` string[]: File ids to import. Required unless `async` is true and `folder_ids` names something.
  - `folder_ids` string[]: Folder ids from browse. A mail or a thread: the files directly inside are imported. A directory of a file store (Google Drive, Dropbox, S3, Azure Blob, SharePoint, OneDrive): everything under it, subfolders included. Each folder counts as one item of the run; files beyond the per-folder limit are named in its outcome. Only with `async: true`.
  - `async` boolean: True records the import and answers `202` with the run; the files are imported in the background.
  - `tags` string[]: Tags applied to every imported document.

## Response `201`

Without `async`. What was imported, skipped or failed.

- SourceImportResult
  - `imported` string[]: Document ids created.
  - `skipped` string[]: File ids already imported.
  - `errors` object[]
    - `fileId` string
    - `error` string: The raw failure message.
    - `reason` string: Why the file could not be imported, in words for a person.

## Other responses

- `202`: With `async: true`. The import run, still queued.
- `400`: The request is invalid.
- `401`: Missing or invalid API key.
- `403`: The API key does not have the required scope.
- `404`: The requested resource was not found.
- `429`: Daily rate limit exceeded.

## Changes

- **2026-12-04** `907c112dbe85`: 1 info
  - added the optional property `found` to the response with the `202` status
- **2026-11-30** `96fd856599f6`: 5 info
  - added the new optional request property `async`
  - added the new optional request property `folder_ids`
  - the request property `file_ids` became optional
  - added the optional property `errors/items/reason` to the response with the `201` status
  - …1 more
- **2026-11-26** `622d429de7ea`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/talonic/apis/talonic-api/changes/v1/sources/:id/import/post.md)

---

[API](https://skmtc.dev/talonic/apis/talonic-api.md) - [All operations](https://skmtc.dev/talonic/apis/talonic-api/llms.txt) - [OpenAPI document](https://skmtc.dev/talonic/apis/talonic-api/revisions/9f6d53e2ab5e?raw)
