---
title: "Start a data import"
method: POST
path: "/data-import/{id}/start"
tags: ["Data Import"]
---

# Start a data import

`POST /data-import/{id}/start`

## Request

- Base URL: `https://api.surense.com/api/v1`
- URL: `https://api.surense.com/api/v1/data-import/{id}/start`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `https://api.surense.com/oauth/token`

Second step of an import, to call once the ZIP archive has been uploaded to the `uploadUrl` returned by `initiateDataImport`. Marks the record as `UPLOADED` and dispatches it for processing (queued per creating user, or launched as a processing task); progress is then followed with `getDataImportRecord`.

**Idempotent:** calling it again for a record that is no longer `INITIATED` does not start a second import; it returns the current record (and re-queues an `UPLOADED` record that has not started yet).

**Authorization:** any authenticated user; the record must belong to the caller's tenant.

**Errors:** 400 if the record does not exist in the caller's tenant; 500 if the provider has no processing task configured.

## Path parameters

- `id` string, uuid, required

## Response `200`

The data import record

- DataImportRecordValue: A data import: one set of files imported with a provider into an agency, with its status and results.
  - `tenantId` string, uuid
  - `agencyId` string, uuid: Agency the data is imported into.
  - `createdDate` string, date-time
  - `createdBy` string, uuid
  - `creatorName` string
  - `lastModifiedDate` string, date-time
  - `lastModifiedBy` string, uuid
  - `version` integer
  - `id` string, uuid: Data import record ID.
  - `provider` string, uuid: ID of the import provider.
  - `subProvider` string, uuid: ID of the resolved sub-provider, when the provider has sub-providers.
  - `files` DataImportFile[]: The files of the import (names and sizes).
    - `fileName` string, required
    - `fileSize` integer
  - `params` object: The provider-specific parameters given at initiation (e.g. `subProvider`, `validityMonth`, `customerManager`).
  - `status` 'INITIATED' | 'UPLOADED' | 'PROCESSING' | 'PROCESSED' | 'FAILED': Import status: `INITIATED` (waiting for upload), `UPLOADED` (queued), `PROCESSING`, `PROCESSED` or `FAILED`.
  - `results` DataImportResults[]: Processing results per file group: counters in `params` (e.g. `customerCount`, `productCount`) and info/warning/error messages.
    - `files` DataImportFile[]
      - `fileName` string, required
      - `fileSize` integer
    - `params` object
    - `infos` string[]
    - `warnings` string[]
    - `errors` string[]
  - `failureReason` string: Why the import failed, when `status` is `FAILED`.
  - `revertedBy` string, uuid: ID of the user who reverted the import, if reverted.
  - `revertedAt` string, date-time: When the import was reverted, if reverted.

## Other responses

- `400`: The record does not exist in the caller's tenant

---

[API](https://skmtc.dev/surense/apis/data-import-api.md) - [All operations](https://skmtc.dev/surense/apis/data-import-api/llms.txt) - [OpenAPI document](https://skmtc.dev/surense/apis/data-import-api/revisions/cf169afb2d5b?raw)
