---
title: "Consent to and start a background history import"
method: POST
path: "/api/assistant/preview"
tags: ["Mailzero Assistant"]
---

# Consent to and start a background history import

`POST /api/assistant/preview`

## Request

- Base URL: `https://domani.run`
- URL: `https://domani.run/api/assistant/preview`
- Auth: HTTP bearer

Records the current explicit AI consent, enables shadow processing on the selected user-owned mailboxes, and creates a resumable background import of recent history. The client may close immediately and poll GET /api/assistant/backfill. Requires the assistant:write scope.

## Request body

- object
  - `mailbox_ids` string[], required
  - `history_window_days` integer
  - `consent` true, required
  - `consent_version` 'mailzero-personal-ai.v1', required

## Response `200`

Consent recorded and resumable background import created

- object
  - `ok` boolean
  - `preview` object
    - `mailbox_ids` string[]
    - `history_window_days` integer
    - `background` boolean
    - `backfill_id` string

## Other responses

- `401`: Missing or invalid API key
- `403`: A mailbox is not owned by the caller (MAILBOX_SCOPE_DENIED)
- `429`: Rate limit exceeded - wait and retry

---

[API](https://skmtc.dev/domani/apis/domani-run-api.md) · [All operations](https://skmtc.dev/domani/apis/domani-run-api/llms.txt) · [OpenAPI document](https://skmtc.dev/domani/apis/domani-run-api/revisions/7679f8159533?raw)
