Sources

Import files from a connection

Changed on

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.

post/v1/sources/{id}/import

Request

  • Base URL
    https://api.talonic.com
  • Auth
    HTTP bearer

Path parameters

id, string uuid required
Example:a1b2c3d4-e5f6-7890-abcd-ef1234567890

Resource UUID.

Request body

object required
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

Without async. What was imported, skipped or failed.

SourceImportResult required
imported, string[]

Document ids created.

skipped, string[]

File ids already imported.

errors, object[]

Changes

    • info

      added the optional property found to the response with the status

    • info

      added the new optional request property async

    • info

      added the new optional request property folder_ids

    3 more changes in this revision