---
title: "Bulk import tickets from an external source"
method: POST
path: "/v1/brands/{brandId}/import"
tags: ["import"]
---

# Bulk import tickets from an external source

`POST /v1/brands/{brandId}/import`

## Request

- Base URL: `https://api.dispatchtickets.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.dispatchtickets.com/v1/brands/{brandId}/import`
- Auth: HTTP bearer

Import up to 100 tickets per request from an external system (HappyFox, Zendesk, CSV, etc.).

**Idempotency:** Tickets are deduplicated by `source` + `sourceId`. Safe to retry failed batches.

**Auto-creation:** Statuses, categories, tags, customers, and field definitions are automatically created if they don't exist. Statuses are matched by key first, then by name (case-insensitive), then auto-created.

**Side effects skipped:** Webhooks, email notifications, usage counting, entitlement checks, and CSAT surveys are all skipped since the data is historical.

**Attachments:** Created as PENDING records and downloaded in the background via a job queue. Source URLs should be publicly accessible (presigned URLs are fine — no Authorization header is sent).

**Error isolation:** Each ticket is processed independently. One failure does not affect the rest of the batch.

## Request body

- ImportTicketsDto
  - `source` string, required: Import source identifier
  - `options` ImportOptionsDto
    - `skipDuplicates` boolean
    - `autoCreateStatuses` boolean
    - `autoCreateCategories` boolean
    - `autoCreateTags` boolean
    - `autoRegisterFields` boolean
  - `tickets` ImportTicketDto[], required: Tickets to import (max 100)
    - `sourceId` string, required: Source ticket ID for idempotency
    - `title` string, required
    - `body` string
    - `status` string: Status string (matched by key, then name, then auto-created)
    - `priority` 'low' | 'normal' | 'medium' | 'high' | 'urgent'
    - `customer` ImportCustomerDto
      - `email` string, required
      - `name` string
    - `assigneeEmail` string: Assignee email (matched against team members)
    - `category` string: Category name (matched or auto-created)
    - `tags` string[]
    - `customFields` object
    - `sourceData` object: Source-specific metadata
    - `createdAt` string: Original creation timestamp
    - `comments` ImportCommentDto[]
      - `sourceId` string: Source comment ID for idempotency
      - `body` string, required
      - `authorType` 'CUSTOMER' | 'AGENT' | 'SYSTEM', required
      - `authorEmail` string
      - `authorName` string
      - `createdAt` string
      - `attachments` ImportAttachmentDto[]
        - `url` string, required
        - `filename` string, required
        - `contentType` string
    - `attachments` ImportAttachmentDto[]
      - `url` string, required
      - `filename` string, required
      - `contentType` string

## Response `201`

Import completed. Returns summary counts, per-ticket results, and any errors.

## Other responses

- `400`: Validation error (invalid payload shape)
- `404`: Brand not found

---

[API](https://skmtc.dev/dispatchtickets/apis/dispatch-tickets-api.md) · [All operations](https://skmtc.dev/dispatchtickets/apis/dispatch-tickets-api/llms.txt) · [OpenAPI document](https://skmtc.dev/dispatchtickets/apis/dispatch-tickets-api/revisions/529e6717d295?raw)
