# Import & Export (/reference/rest/import-export)



Import [#import]

Endpoint [#endpoint]

```
POST /import/:type
```

Import entities in bulk. Supports JSON arrays and NDJSON (newline-delimited JSON).

JSON Import [#json-import]

```bash
curl -X POST "https://db.headless.ly/import/Contact" \
  -H "Authorization: Bearer hly_your_api_key" \
  -H "Content-Type: application/json" \
  -d '[
    {"name": "Alice Chen", "email": "alice@acme.com", "stage": "Lead"},
    {"name": "Bob Park", "email": "bob@widget.io", "stage": "Qualified"}
  ]'
```

NDJSON Import [#ndjson-import]

```bash
curl -X POST "https://db.headless.ly/import/Contact" \
  -H "Authorization: Bearer hly_your_api_key" \
  -H "Content-Type: application/x-ndjson" \
  --data-binary @contacts.ndjson
```

Response [#response]

```json
{
  "success": true,
  "imported": 150,
  "errors": 2,
  "details": [
    {"row": 42, "error": "Missing required field: name"},
    {"row": 99, "error": "Duplicate email: alice@acme.com"}
  ]
}
```

Export [#export]

Endpoint [#endpoint-1]

```
GET /export/:type
```

Export all entities of a type. Supports JSON, CSV, and Parquet formats.

Parameters [#parameters]

| Parameter | Type        | Default | Description                                |
| --------- | ----------- | ------- | ------------------------------------------ |
| `format`  | string      | `json`  | Export format: `json`, `csv`, or `parquet` |
| `filter`  | JSON string | `{}`    | Optional filter                            |

Examples [#examples]

```bash
