> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kaireonai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Export & Import

> Export full tenant configuration and import it into another environment.

The Export/Import APIs enable configuration portability between environments. Export produces a JSON snapshot of all tenant entities; Import recreates them in the target tenant.

## GET /api/v1/export/full

Export the full tenant configuration as a JSON file. Includes decision flows, categories, offers, channels, connectors, schemas, pipelines, models, experiments, rules, policies, guardrails, and segments. Rate limited to 10 requests/min. **Admin only.**

<Warning>
  Connector `authConfig` (credentials) is deliberately excluded from exports for security.
</Warning>

### Response

Returns a JSON file download with `Content-Disposition: attachment`.

```json theme={null}
{
  "exportType": "full",
  "exportedAt": "2026-03-18T12:00:00.000Z",
  "version": 1,
  "data": {
    "decisionFlows": [ ... ],
    "categories": [ ... ],
    "offers": [ ... ],
    "channels": [ ... ],
    "connectors": [ ... ],
    "schemas": [ ... ],
    "pipelines": [ ... ],
    "models": [ ... ],
    "experiments": [ ... ],
    "qualificationRules": [ ... ],
    "contactPolicies": [ ... ],
    "guardrailRules": [ ... ],
    "segments": [ ... ]
  }
}
```

***

## DELETE /api/v1/export/full

GDPR customer data erasure. Deletes all interaction history, summaries, and variant assignments for a customer, invalidates cached data, and verifies complete removal. **Admin only.**

### Request Body

| Field        | Type   | Required | Description          |
| ------------ | ------ | -------- | -------------------- |
| `customerId` | string | Yes      | Customer ID to erase |

### Response

```json theme={null}
{
  "customerId": "C-1234",
  "tenantId": "my-tenant",
  "erasedAt": "2026-03-18T12:00:00.000Z",
  "deleted": {
    "interactionHistory": 142,
    "interactionSummary": 15,
    "variantAssignment": 3
  },
  "cacheInvalidated": true,
  "verification": {
    "passed": true,
    "remainingRecords": {
      "interactionHistory": 0,
      "interactionSummary": 0,
      "variantAssignment": 0
    }
  },
  "totalRecordsDeleted": 160
}
```

***

## GET /api/v1/export/decision-flows/{id}

Export a single decision flow as a JSON file. **Editor or Admin.**

### Response

```json theme={null}
{
  "exportType": "decision_flow",
  "exportedAt": "2026-03-18T12:00:00.000Z",
  "version": 1,
  "data": { ... }
}
```

***

## GET /api/v1/export/models/{id}

Export a single algorithm model (including all versions) as a JSON file. **Editor or Admin.**

### Response

```json theme={null}
{
  "exportType": "model",
  "exportedAt": "2026-03-18T12:00:00.000Z",
  "version": 1,
  "data": { ... }
}
```

***

## POST /api/v1/import

Import configuration from an export file. All entities are created in a single transaction — if any fail, all changes roll back. Rate limited to 10 requests/min. Max payload: 10 MB. **Editor or Admin.**

### Request Body

| Field        | Type   | Required | Description                                           |
| ------------ | ------ | -------- | ----------------------------------------------------- |
| `exportType` | string | Yes      | Type: `decisionFlow`, `blueprint`, `model`, or `full` |
| `version`    | number | No       | Export format version                                 |
| `data`       | object | Yes      | The exported data payload                             |

### Import Behavior

* Imported entities get a `-imported-` suffix on their key to avoid conflicts
* Names get ` (imported)` appended
* All imported entities start in `draft` status
* Connector credentials (`authConfig`) are cleared for security
* Max 500 items per entity type in full imports

### Example

```bash theme={null}
curl -X POST https://playground.kaireonai.com/api/v1/import \
  -H "Content-Type: application/json" \
  -H "X-Tenant-Id: my-tenant" \
  -d @kaireon-export-2026-03-18.json
```

### Response

```json theme={null}
{
  "success": true,
  "summary": {
    "decisionFlows": 3,
    "models": 2,
    "connectors": 5
  }
}
```
