---
title: "Match pasted text or a CSV before adding"
method: POST
path: "/lists/{id}/import/preview"
tags: ["Lists"]
---

# Match pasted text or a CSV before adding

`POST /lists/{id}/import/preview`

## Request

- Base URL: `https://api.companystack.co.uk`
- URL: `https://api.companystack.co.uk/lists/{id}/import/preview`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-Api-Key`

Paste company numbers or names (one per line), or send a CSV file's text with `source: "csv"`. The company number column is found by its header ("Company number", "CRN", "Reg no"…) or its contents; names are matched against the register (exact name after ignoring punctuation and LIMITED/LTD; a registered postcode column settles ties). Your reference, tags, note and postcode columns are picked up too. Nothing is added: send the matched numbers to POST /lists/{id}/items. Rows come back as matched, ambiguous (with up to 5 candidates to choose from), not_found or already_on_list, and rejected rows carry the reason. CSV import needs a plan with CSV (Pro, Team or a paid API plan); pasting is on every plan.

## Path parameters

- `id` integer, required

## Request body

- object
  - `text` string, required
  - `source` 'paste' | 'csv'

## Response `200`

Preview

## Other responses

- `400`: Invalid input; `error` says what to change
- `401`: API key missing, malformed or revoked
- `403`: Plan limit or feature not included
- `429`: Fair use (`code: fair_use_limit`): import previews are limited to 30 an hour and 100 a day for each account. A refused call is not counted; `Retry-After` says when to try again. A 429 with `code: rate_limited` is the request quota.

---

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