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

# Agent exports, deletion, and suppressions

> Export selected fields and review consequential data changes with scoped personal keys.

These tools require the imports/data rollout to be enabled. Existing personal keys receive no additional scopes. Billing, payments, credits, invoices, and subscription management are excluded from MCP.

Start with `account_get`, `teams_list`, `projects_list`, and `project_get`. Pass the intended `project_id` on every project tool call. Current membership and role capabilities intersect the key’s saved grants and scopes on every operation.

## Export contacts

Grant `exports.read` explicitly. `contacts_export` returns IDs, emails, and only the profile keys selected in `fields`. Pages contain at most 100 records through MCP and 500 through the API/SDK, with a one MiB response budget. A shortened page can still have `metadata.has_more: true`: pass `metadata.next` unchanged as `after` until complete.

Rows whose selected profile values exceed 64 KiB return `ExportRowTooLarge` without the profile payload. Narrow the field selection or correct the source data. Exports contain personal data; store the output in the customer’s intended destination.

```ts theme={null}
import Sendrealm from '@sendrealm/sdk';
import { exportContactsFile } from '@sendrealm/sdk/contact-export';
const client = new Sendrealm({
  apiKey: process.env.SENDREALM_API_KEY,
  projectId: 'PROJECT_UUID',
});
await exportContactsFile(client, './contacts.ndjson', {
  fields: ['first_name', 'last_name'],
  format: 'ndjson', // csv and json are also supported
});
```

```bash theme={null}
sendrealm-export --project-id PROJECT_UUID --file contacts.csv \
  --format csv --fields first_name,last_name
```

The helper streams pages, respects filesystem backpressure, escapes spreadsheet formulas in CSV, refuses to overwrite existing files, and removes its own incomplete output on failure. Exporting does not mutate contacts, enqueue business work, or send messages. Audit/request records contain context and operation metadata only.

## Review deletion

Use `contacts_delete_prepare`, `audiences_delete_prepare`, `audience_properties_delete_prepare`, or `topics_delete_prepare` with 1–500 explicit IDs. The first three require `audiences.delete`; topic deletion requires `topics.delete`. Review affected relation counts and consequential effects before execution.

Preparations expire after ten minutes and bind the actor, key, project, current grants, and resource versions. Execute the corresponding tool with `prepared_action_id` and a stable `idempotency_key`. Reusing the same pair returns the persisted receipt. A stale preparation requires a new review; do not automatically prepare and execute a replacement.

```ts theme={null}
const preview = await client.contacts.prepareDelete({ ids: ['CONTACT_UUID'] });
// Present preview.effects to the customer before executing.
await client.contacts.deletePrepared({
  prepared_action_id: preview.prepared_action_id,
  idempotency_key: 'customer-approved-contact-deletion-001',
});
```

Deletion archives records and related links while preserving delivery history. It does not recall queued messages or cancel already running automations. Removing a property definition preserves historical profile values; affected drafts and targeting may need correction.

Contact-deletion events default to `automation_effects: 'suppress'`. Explicit `trigger` requires `automations.trigger` and current automation-management access. Durable event publication inherits actor/key identity and policy, including queue replay; losing trigger authorization before publication downgrades it to suppression.

## Manage suppressions separately

Imports cannot clear delivery suppressions or restore existing unsubscribes. Use `suppressions_list` to inspect current project records and their latest reasons. Explicit `suppressions.write` permits `suppressions_reallow_prepare` and `suppressions_reallow`.

Reallowing creates a history entry permitting future delivery attempts; subscription preferences remain unchanged. New provider feedback invalidates stale preparations. Review the consequences and the latest reason before executing. No message is sent by the reallow operation itself.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.