---
title: "Import contacts from CSV"
method: POST
path: "/contact-imports"
tags: ["Campaigns"]
---

# Import contacts from CSV

`POST /contact-imports`

## Request

- Base URL: `https://sendhq.cc/api/v1`
- URL: `https://sendhq.cc/api/v1/contact-imports`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/sendhq/apis/sendhq-api/docs/contact-imports/post.ts> (a function with typed inputs; its response is checked against the schema)

Import up to 5,000 rows (5 MB) per request. The header row needs an `email` column; `name` (or `first_name` and `last_name`), `status`, and `tags` (separated by `;` or `|`) are recognized and other columns become custom fields. `consent_basis` is required and is recorded on every new contact. Optional `tags` are added to every accepted row. Rows whose status says unsubscribed import as unsubscribed. Existing contacts keep their status; set `update_existing` to merge names and fields. Duplicate rows are skipped and invalid rows are reported by line.

## Request body

- object
  - `csv` string, required
  - `list_id` string, required
  - `consent_basis` string, required
  - `tags` string[], required
  - `update_existing` boolean, required

## Response `201`

Successful response

- object
  - `id` string, required
  - `listId` string, required
  - `consentBasis` string, required
  - `totalRows` integer, required
  - `accepted` integer, required
  - `created` integer, required
  - `existing` integer, required
  - `skipped` integer, required
  - `invalid` integer, required
  - `errors` object[], required
    - `line` integer, required
    - `reason` string, required
  - `tags` string[], required
  - `createdAt` string, date-time, required

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid authentication
- `402`: A paid entitlement is required for this recipient or feature
- `403`: The workspace, domain, policy, or suppression state forbids the operation
- `404`: Tenant-scoped resource not found
- `409`: Resource state or idempotency conflict
- `413`: Attachment count or bytes exceed the accepted limit
- `422`: Request validation or suppression check failed
- `423`: Sending is paused for this sender identity or workspace; the message gives the reason and how to appeal
- `429`: A monthly, daily, or trial usage limit was reached
- `500`: Unexpected server error
- `502`: An upstream provider operation failed
- `503`: A required provider or signing configuration is unavailable
- `default`: An error response using SendHQ's standard JSON envelope

---

[API](https://skmtc.dev/sendhq/apis/sendhq-api.md) - [All operations](https://skmtc.dev/sendhq/apis/sendhq-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sendhq/apis/sendhq-api/revisions/98e39e48cb9a?raw)
