---
title: "Create Provider Contact Import"
method: POST
path: "/v1/contacts/imports/provider"
tags: ["Contacts"]
---

# Create Provider Contact Import

`POST /v1/contacts/imports/provider`

## Request

- Base URL: `https://api.migma.ai`
- URL: `https://api.migma.ai/v1/contacts/imports/provider`
- Auth: API key in header `Authorization`

Import contacts from one or more sources on a connected Klaviyo, Mailchimp, or HubSpot account. Processing runs in the background; poll `GET /v1/contacts/imports/{id}` for status and counts. Each import creates a tag and a saved segment named after the source(s). Unsubscribed contacts stay unsubscribed. Requires API key with audience:write.

## Headers

- `Idempotency-Key` string

## Request body

- CreateProviderContactImportRequest
  - `projectId` string, required: Brand (project) ID
  - `provider` 'klaviyo' | 'mailchimp' | 'hubspot', required
  - `sources` ProviderImportSource[], required
    - `id` string, required: Provider-specific source identifier
    - `type` 'audience' | 'segment' | 'tag' | 'list', required
    - `name` string, required
  - `consentMode` 'subscribed-only' | 'include-all': Whether to import only contacts with clear marketing consent
  - `connectionId` string: Connected integration account ID when multiple accounts are linked

## Response `201`

Import accepted for background processing

- ApiResponseProviderContactImport
  - `success` boolean, required
  - `data` object, nullable
    - `object` string
    - `id` string: Import job ID. Poll GET /v1/contacts/imports/{id} for status.
    - `status` string
    - `tag` object
      - `id` string
      - `name` string
    - `segment` object
      - `id` string
      - `name` string
  - `error` string, nullable

## Other responses

- `400`: Bad request (code: INTEGRATION_ACCOUNT_REQUIRED when multiple accounts are connected and connectionId is omitted)
- `401`: Unauthorized
- `403`: Forbidden - Missing required permissions or access denied
- `409`: Provider not connected or reconnect required (codes: PROVIDER_NOT_CONNECTED, PROVIDER_RECONNECT_REQUIRED). The error message includes a connect link; `data.connectUrl` has the same URL.

## Changes

- **2026-10-03** `3559ca4c97d3`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/migma/apis/migma-ai-api-v1/changes/v1/contacts/imports/provider/post.md)

---

[API](https://skmtc.dev/migma/apis/migma-ai-api-v1.md) - [All operations](https://skmtc.dev/migma/apis/migma-ai-api-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/migma/apis/migma-ai-api-v1/revisions/2ce0e1e4d856?raw)
