# /distributors/import/confirm - Execute validated distributor import **POST /distributors/import/confirm** Confirm and execute a previously validated distributor import. Reuses `POST /distributors` (CREATE) and `PUT /distributors/{id}` (UPDATE) for each row. **Inputs** - `import_id` — from the `/validate` response. Must still be valid (sessions expire after 30 min). - `override` — global flag. When `true`, every row with status `warning` (a distributor with the same VAT already exists in the DB) is UPDATEd with the CSV values; name, description, address, city, main_contact, email, phone, language, notes all get overwritten. When omitted/false, warning rows are skipped. - `resolutions` — not applicable to distributors. **Behaviour per row status** | status | `override` false | `override` true | |--------|------------------|------------------| | `valid` | CREATE | CREATE | | `error` | skipped (`reason: error`) | skipped (`reason: error`) | | `warning` | skipped (`reason: warning_not_overridden`) | UPDATE — all custom_data fields overwritten from CSV (name is the lookup key, never changed) | **Atomicity** — non-atomic: failures during creation/update are reported per-row; rows that succeeded before the failure are kept. ## Servers - Backend API server (port 8080): https://api.your-domain.com/api (Backend API server (port 8080)) - Collect API server (port 8081): https://collect.your-domain.com/api (Collect API server (port 8081)) ## Authentication methods - Bearer auth ## Parameters ### Body: application/json (object) - **import_id** (string(uuid)) Import session ID from the validate response. Sessions expire after 30 min. - **override** (boolean) When `true`, all rows with status `warning` are UPDATEd using the CSV values (existing entity is looked up by email/name and overwritten field-by-field). When `false` or omitted, warning rows are skipped. - **resolutions** (object) Per-row organization choices for `ambiguous` rows, keyed by row number as a string (e.g. `"7"`). The chosen `organization_id` must be one of the `candidates[].logto_id` values returned by `/import/validate` for that row. Ambiguous rows without a resolution are skipped. ## Responses ### 200 Import results #### Body: application/json (object) - **code** (integer) - **message** (string) - **data** (object) Per-row outcome of `/import/confirm`. The operation is non-atomic: a partial failure does not roll back the rows that were already created or updated. The four counters always sum to `total_rows` of the validate response. ### 400 Bad request - validation error #### Body: application/json (object) - **code** (integer) HTTP error code - **message** (string) Error message - **data** (object) ### 401 Unauthorized - invalid or missing token #### Body: application/json (object) - **code** (integer) - **message** (string) - **data** (object | null) ### 403 Forbidden - insufficient permissions #### Body: application/json (object) - **code** (integer) - **message** (string) - **data** (object | null) [Powered by Bump.sh](https://bump.sh)