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

# trigger_import

> Launch the import of a data table, a quota or a whole integration from the system it syncs from, and return the import runs to follow with get_import.

Launch the import of a data table, a quota or a whole integration from the
system it syncs from, and return the runs it launched.

Pass exactly one of `data_table_id`, `quota_id` or `integration_id`:

* A data table or a quota is synced alone, as its **Refresh data** button does
  in the Qobra web app.
* An integration syncs every data table and quota it feeds, in up to two runs
  (its data tables, then its quotas).

The sync overwrites the records and targets with what the source holds.

## When to use it

Use it as the first step of a close. An import runs in the background, and the
company's imports run one after another, so the runs come back `scheduled`.
Follow each run with [`get_import`](https://docs.qobra.co/mcp_documentation/tools/get_import) until
its status is `finished`, and check its batches for errors. Then recalculate the
statements. A recalculation started before the import finishes computes on the
data as it was.

## Already running imports

When an import of the same data table or quota, or of a table or quota of the
integration, is already scheduled or running, the tool launches nothing. The
result lists those runs with `already_in_progress` true. Follow them rather than
calling again.

The tool is not idempotent: each call that finds nothing in progress launches a
new import.

## Refused resources

Only what an integration syncs can be imported. The tool refuses, with a
readable message:

* A data table or a quota entered in Qobra (not synced from an integration).
* An archived quota.
* A quota of a sandbox. Integrations sync the live environment only, so the tool
  takes no `sandbox_id`.
* An integration that is paused or being deleted.
* An integration that syncs no data table and no quota.
* Anything fed through the Public API.

## Permissions

The tool is available to a user with write permission on data tables, on quotas
or on integration settings. Qobra then checks the permission that matches the
resource passed:

* `data_table_id` needs write permission on data tables.
* `quota_id` needs write permission on quotas.
* `integration_id` needs write permission on integration settings.

The run records you as its author, which `get_import` shows. A run of an
integration over resources you may not read (its data tables or its quotas) is
not listed, whether this call launched it or found it already under way.

Unlike other write tools, triggering an import records no event in the audit
trail. The import
itself shows up in [`list_imports`](https://docs.qobra.co/mcp_documentation/tools/list_imports).

## Example

```json theme={null}
{
  "integration_id": "65f1c2a9e4b0a1d2c3f4e5a6"
}
```

## Parameters

> [accordion] Body
>
> **data\_table\_id** `string`
>
> Id of the data table to sync from its integration — the id
> [`list_data_tables`](https://docs.qobra.co/mcp_documentation/tools/list_data_tables) returns.
> Pass this, `quota_id` or `integration_id`: exactly one of them.
>
> **quota\_id** `string`
>
> Id of the quota to sync from its integration — the id
> [`list_quotas`](https://docs.qobra.co/mcp_documentation/tools/list_quotas) returns. Pass this,
> `data_table_id` or `integration_id`: exactly one of them.
>
> **integration\_id** `string`
>
> Id of the integration to sync every data table and quota of — the id
> [`list_integrations`](https://docs.qobra.co/mcp_documentation/tools/list_integrations) returns.
> Pass this, `data_table_id` or `quota_id`: exactly one of them.

## Response

> [accordion] Body
>
> **imports** `object[]`
>
> The runs syncing what you asked for, oldest first: the ones launched — one
> for a data table or a quota, up to two for an integration (its data tables,
> then its quotas) — or the ones already in progress. Follow each with
> get\_import until its status is 'finished'.
>
> **object properties**
>
> **id** `string`
>
> **resource\_url** `string`
>
> Deep link that opens this import expanded in the Qobra web app, on the
> history page of a resource type it touched. Null only for an import with
> no batch yet, which no history page lists.
>
> **status** `string`
>
> Overall status: 'scheduled', 'started' or 'finished'. One of:
> `scheduled`, `started`, `finished`.
>
> **trigger** `string`
>
> What kicked the import off, e.g. 'scheduled\_refresh',
> 'integration\_refresh' or 'quota\_sync'. Null when unknown. One of:
> `scheduled_refresh`, `integration_refresh`,
> `integrations_with_frequency_refresh`, `braqoffice_refresh`,
> `users_creation`, `user_integration_sync`, `user_file_import_refresh`,
> `user_attributes_creation`, `user_attribute_sync`, `groups_creation`,
> `data_table_refresh`, `data_table_settings_update`, `field_creation`,
> `quota_creation`, `quota_sync`, `quota_refresh`,
> `quota_settings_update`.
>
> **progress** `integer`
>
> Overall completion 0–100, averaged across the import's batches (100 when
> it has no batch).
>
> **error** `boolean`
>
> True when a batch you can read ended in error; get\_import says which and
> why.
>
> **warning** `boolean`
>
> True when a batch you can read finished but rejected or skipped some
> rows; get\_import lists them. A run can carry a warning without an error.
>
> **resource\_types** `string[]`
>
> Distinct resource types the import touched — any of 'data\_table',
> 'quota', 'user'.
>
> **author** `object`
>
> The user who triggered the import; null for a system or scheduled
> import.
>
> **object properties**
>
> **id** `string`
>
> **email** `string`
>
> **name** `string`
>
> **created\_at** `string`
>
> **launched\_at** `string`
>
> **finished\_at** `string`
>
> **already\_in\_progress** `boolean`
>
> True when nothing was launched because an import of it was already scheduled
> or running: imports lists those runs instead. Follow them rather than
> triggering another.
