---
title: "Cancel a contact import"
method: POST
path: "/contacts/imports/{id}/cancel"
tags: ["Contacts"]
---

# Cancel a contact import

`POST /contacts/imports/{id}/cancel`

## Request

- Base URL: `https://www.unitpost.com/api/v1`
- URL: `https://www.unitpost.com/api/v1/contacts/imports/{id}/cancel`
- Auth: HTTP bearer

Stop a `pending` or `processing` import job. A running import stops at its next chunk of rows; contacts it already imported are kept. The job's status becomes `canceled`. A job that has already finished returns 409. Check its progress first with [Retrieve a contact import](#get-contacts-imports-id). Requires the `contacts:write` capability.

## Response `200`

The canceled import job.

- ContactImport
  - `object` 'contact_import', required
  - `id` string, required
  - `status` 'pending' | 'processing' | 'completed' | 'failed' | 'canceled', required
  - `total` number, required
  - `imported` number, required
  - `skipped` number, required
  - `failed` number, required
  - `invalid` object[], required
    - `row` number, required
    - `reason` string, required
  - `error` string, nullable, required
  - `created_at` string, required
  - `updated_at` string, required

## Other responses

- `401`: Missing or invalid API key.
- `403`: Insufficient scope.
- `404`: Import job not found.
- `409`: The import has already finished; nothing left to cancel.

---

[API](https://skmtc.dev/unitpost/apis/unitpost-api.md) · [All operations](https://skmtc.dev/unitpost/apis/unitpost-api/llms.txt) · [OpenAPI document](https://skmtc.dev/unitpost/apis/unitpost-api/revisions/86ff7c890967?raw)
