Skip to main content
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 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.

Example

Parameters

Body

string
Id of the data table to sync from its integration — the id list_data_tables returns. Pass this, quota_id or integration_id: exactly one of them.
string
Id of the quota to sync from its integration — the id list_quotas returns. Pass this, data_table_id or integration_id: exactly one of them.
string
Id of the integration to sync every data table and quota of — the id list_integrations returns. Pass this, data_table_id or quota_id: exactly one of them.

Response

Body

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’.
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.