# Export a contact's data

Source: https://kirora.io/docs/api/reference/getContactExport

`GET /v1/contacts/{id}/export`

Requires an API key with the `contacts:read` scope. [About keys and scopes](https://kirora.io/docs/api/reference/authentication)

Works with integration, agent and partner keys.

Returns everything held about one contact, for answering a right-of-access request: profile, consent changes, events, messages, lists, segments, topics, journeys, push devices (without tokens), form submissions, conversions and suppressions. Data past the retention periods is no longer held, so it is not included. The response is streamed as it is read, so a long history arrives without a length. Each export is recorded in the audit log.

## Path parameters

- `id` (string, required, 1–255 characters) — Kirora's id for the contact, your own with `idType=externalId`, or its email address with `idType=email`, URL-encoded (`@` as `%40`).

## Query parameters

- `idType` (string, optional, one of `id`, `externalId`, `email`, default `"id"`) — What `{id}` is: Kirora's id for the contact (`id`, the default), your own (`externalId`, as set with identify) or its email address (`email`, matched trimmed and without case).

## Header parameters

- `Kirora-Workspace` (string, optional, pattern `^[A-Za-z0-9._:-]{1,128}$`) — Partner keys only: the child workspace to act in, by the external id the partner gave it. Without it, a partner key acts in its own workspace. Any other key that sends it is refused with 403, and an unknown workspace is 404.

## Returns

Returns `200 OK` with a `ContactDataExport` in `data`. Otherwise returns an error; [Errors](https://kirora.io/docs/api/reference/errors) lists every code and which to retry.

- `exportedAt` (string, required, date-time) — When this export was produced.
- `contact` (ContactDetail, required)
  - `id` (string, required, uuid)
  - `externalId` (string | null, required) — Your own id for the contact, if set.
  - `email` (string | null, required, email)
  - `firstName` (string | null, required)
  - `lastName` (string | null, required)
  - `phone` (string | null, required) — Phone number in E.164 format.
  - `timezone` (string | null, required) — IANA timezone, e.g. `Europe/London`.
  - `country` (string | null, required) — ISO 3166-1 alpha-2 code: as written, or inferred from the phone, else the timezone.
  - `locale` (string | null, required) — BCP 47 tag (`fr`, `fr-CA`): the language the contact reads (its first subtag), and how merge tags format numbers, dates and money for them.
  - `rfm` (object | null, required) — The contact's RFM (recency, frequency and monetary value) group among the workspace's customers, from its purchase events (the workspace's `purchaseEvent`: an order, a paid invoice, a booking, a donation), each score from 1 to 5 (a fifth of the customers each; 5 is the most recent, most frequent or highest spend), and their purchase totals. Spend counts only purchases in the workspace's main currency; when the purchase carries no amount, `monetary` follows frequency. Recomputed daily, so a purchase today shows tomorrow; `null` for someone who has never purchased.
    - `group` (string, required, one of `champions`, `loyal`, `cant_lose_them`, `potential_loyalists`, `new_customers`, `need_attention`, `about_to_sleep`, `at_risk`, `hibernating`, `lost`)
    - `recency` (integer, required, min 1, max 5)
    - `frequency` (integer, required, min 1, max 5)
    - `monetary` (integer, required, min 1, max 5)
    - `purchaseCount` (integer, required, min > 0) — Their purchase events (the workspace's `purchaseEvent`), in any currency.
    - `totalSpent` (object | null, required) — What their purchases' amounts (`purchaseValueProperty`) add up to, in the workspace's main currency (`currency` on `GET /v1/reports/rfm`); purchases in other currencies and refunds are left out. `null` when the purchase carries no amount.
      - `currency` (string | null, required) — The currency, an ISO 4217 code; null when none was named.
      - `value` (number, required) — The amount in that currency.
    - `lastPurchasedAt` (string, required, date-time) — When their latest purchase happened.
  - `dates` (map<string, string>, required) — Named calendar dates, e.g. `birthday`, as `YYYY-MM-DD` or `--MM-DD`.
  - `attributes` (map<string, object>, required) — Custom attributes, keyed by attribute name.
  - `consent` (ContactConsent, required) — Consent on each channel.
    - `email` (boolean, required) — Whether the contact has consented to email.
    - `push` (boolean, required) — Whether the contact has consented to push.
  - `createdAt` (string, required, date-time)
  - `updatedAt` (string, required, date-time)
  - `emailSuppression` (object, required)
    - `suppressed` (boolean, required) — Whether email to this contact is blocked.
    - `reason` (string | null, required) — Why email to this contact is suppressed: `bounced`, `complained`, `complained_transactional`, `unsubscribed`, `manual`, `imported`, or `other_workspace` (a bounce or complaint in another workspace with the same owner or partner).
  - `listIds` (string[], required) — Ids of the lists the contact is in.
- `consentChanges` (object[], required)
  - `id` (string, required, uuid)
  - `channel` (string | null, required, one of `email`, `push`) — The channel consented to. With `topicId` null: consent to the channel; with both set: a per-channel topic choice.
  - `topicId` (string | null, required, uuid) — The topic consented to, if any.
  - `granted` (boolean, required) — True for a grant, false for a withdrawal.
  - `source` (string, required, one of `dashboard`, `api`, `import`, `form`, `unsubscribe`, `system`, `sdk`)
  - `sourceId` (string | null, required, uuid) — The form, when `source` is `form`.
  - `actorType` (string, required, one of `user`, `api_key`, `contact`, `system`)
  - `actorId` (string | null, required, uuid) — Member or API key id; null for the contact themselves and the system.
  - `ip` (string | null, required) — IP address the change came from.
  - `reason` (string | null, required) — Why it changed, when one was given.
  - `basis` (string | null, required, one of `opted_in`, `existing_customer`) — How the person agreed, as the workspace stated it; null when nobody did.
  - `evidence` (string | null, required) — Where and how they agreed, as stated.
  - `consentedAt` (string | null, required, date-time) — When they agreed, as stated; null means at `occurredAt`.
  - `wording` (string | null, required) — The words they agreed to, as stated.
  - `occurredAt` (string, required, date-time)
- `events` (object[], required)
  - `id` (string, required, uuid)
  - `eventName` (string, required)
  - `properties` (map<string, any>, required)
  - `occurredAt` (string, required, date-time)
- `messages` (object[], required)
  - `id` (string, required, uuid)
  - `campaignId` (string | null, required, uuid)
  - `channel` (string, required, one of `email`, `push`)
  - `messageType` (string, required, one of `marketing`, `transactional`)
  - `status` (string, required, one of `queued`, `sending`, `skipped`, `sent`, `failed`, `delivered`, `bounced`, `complained`)
  - `recipientEmail` (string | null, required) — The email address it went to; `null` for push.
  - `sentAt` (string | null, required, date-time)
  - `deliveredAt` (string | null, required, date-time)
  - `openedAt` (string | null, required, date-time)
  - `clickedAt` (string | null, required, date-time)
  - `unsubscribedAt` (string | null, required, date-time)
  - `createdAt` (string, required, date-time)
- `lists` (object[], required)
  - `id` (string, required, uuid)
  - `name` (string, required)
  - `addedAt` (string, required, date-time)
- `segments` (object[], required)
  - `id` (string, required, uuid)
  - `name` (string, required)
  - `enteredAt` (string, required, date-time)
- `topics` (object[], required)
  - `id` (string, required, uuid)
  - `name` (string, required)
  - `subscribed` (boolean, required) — Whether the contact is subscribed to the topic.
  - `updatedAt` (string, required, date-time)
- `journeys` (object[], required)
  - `journeyId` (string | null, required, uuid) — Null once the journey has been deleted.
  - `journeyName` (string | null, required) — Null once the journey has been deleted.
  - `status` (string, required, one of `active`, `completed`, `exited`)
  - `enteredAt` (string, required, date-time)
  - `endedAt` (string | null, required, date-time)
- `pushDevices` (object[], required)
  - `kind` (string, required, one of `apns_token`, `fcm_token`, `web_push_subscription`)
  - `permission` (string, required, one of `granted`, `denied`) — Notification permission on the device.
  - `active` (boolean, required) — Whether the device can still receive push.
  - `lastSeenAt` (string, required, date-time)
  - `createdAt` (string, required, date-time)
- `formSubmissions` (object[], required)
  - `formId` (string, required, uuid)
  - `formName` (string, required)
  - `outcome` (string, required, one of `created`, `updated`, `honeypot`, `pending`, `expired`)
  - `createdAt` (string, required, date-time)
  - `confirmedAt` (string | null, required, date-time)
  - `pendingContact` (map<string, any> | null, required) — What an unconfirmed signup entered, held until confirmed or for 7 days.
- `conversions` (object[], required)
  - `conversionGoalId` (string, required, uuid)
  - `value` (object | null, required) — Value recorded with the conversion, in its conversion goal's currency, if any.
    - `currency` (string | null, required) — The currency, an ISO 4217 code; null when none was named.
    - `value` (number, required) — The amount in that currency.
  - `convertedAt` (string, required, date-time)
- `suppressions` (object[], required)
  - `channel` (string, required, one of `email`, `push`)
  - `address` (string | null, required) — Set when the block is on the address itself, not the contact.
  - `reason` (string, required) — Why the channel is blocked.
  - `createdAt` (string, required, date-time)

## Example

```bash
curl https://api.kirora.io/v1/contacts/018f2a4e-6b1c-7d3e-9f40-37386ae05a6b/export \
  -H "Authorization: Bearer $KIRORA_API_KEY"
```

Response `200`:

```json
{
  "data": {
    "exportedAt": "2026-10-02T10:00:00.000Z",
    "contact": {
      "id": "0192f3a1-7c2e-7d4b-9a10-3e5f6a7b8c9d",
      "externalId": "customer-4821",
      "email": "amaka@example.com",
      "firstName": "Amaka",
      "lastName": "Obi",
      "phone": "+447700900123",
      "timezone": "Europe/London",
      "country": "GB",
      "locale": "en-NG",
      "rfm": {
        "group": "loyal",
        "recency": 3,
        "frequency": 4,
        "monetary": 5,
        "purchaseCount": 6,
        "totalSpent": {
          "currency": "USD",
          "value": 412.5
        },
        "lastPurchasedAt": "2026-03-02T18:20:00.000Z"
      },
      "dates": {
        "birthday": "1992-03-14"
      },
      "attributes": {
        "plan": "pro",
        "favourite_spice": "smoked paprika",
        "orders": 3
      },
      "consent": {
        "email": true,
        "push": false
      },
      "createdAt": "2026-09-12T08:15:00.000Z",
      "updatedAt": "2026-10-01T09:30:00.000Z",
      "emailSuppression": {
        "suppressed": false,
        "reason": null
      },
      "listIds": [
        "0192f3a2-1b3c-7e5d-8a21-4f6a7b8c9d0e"
      ]
    },
    "consentChanges": [
      {
        "id": "0192f3a5-5f70-7c91-8e65-8d0e1f2a3b4c",
        "channel": "email",
        "topicId": null,
        "granted": true,
        "source": "api",
        "sourceId": null,
        "actorType": "api_key",
        "actorId": null,
        "ip": null,
        "reason": null,
        "basis": "opted_in",
        "evidence": "Checkout opt-in on shop.example.com",
        "consentedAt": null,
        "wording": "Send me offers and news by email",
        "occurredAt": "2026-09-12T08:15:00.000Z"
      }
    ],
    "events": [
      {
        "id": "0192f3c0-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
        "eventName": "Order Completed",
        "properties": {
          "order_id": "1001",
          "total": 46.5,
          "currency": "USD"
        },
        "occurredAt": "2026-10-01T09:30:00.000Z"
      }
    ],
    "messages": [
      {
        "id": "0192f3b0-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
        "campaignId": "0192f3d3-5e6f-7071-8c83-9e0f1a2b3c4d",
        "channel": "email",
        "messageType": "marketing",
        "status": "delivered",
        "recipientEmail": "amaka@example.com",
        "sentAt": "2026-10-01T09:31:00.000Z",
        "deliveredAt": "2026-10-01T09:31:04.000Z",
        "openedAt": null,
        "clickedAt": null,
        "unsubscribedAt": null,
        "createdAt": "2026-10-01T09:30:58.000Z"
      }
    ],
    "lists": [
      {
        "id": "0192f3a2-1b3c-7e5d-8a21-4f6a7b8c9d0e",
        "name": "Newsletter",
        "addedAt": "2026-09-12T08:16:00.000Z"
      }
    ],
    "segments": [
      {
        "id": "0192f3a3-2c4d-7f6e-9b32-5a7b8c9d0e1f",
        "name": "Lapsed customers",
        "enteredAt": "2026-10-01T00:00:00.000Z"
      }
    ],
    "topics": [
      {
        "id": "0192f3b0-6a1b-7c2d-8e3f-4a5b6c7d8e9f",
        "name": "Weekly offers",
        "subscribed": true,
        "updatedAt": "2026-09-12T08:15:00.000Z"
      }
    ],
    "journeys": [
      {
        "journeyId": "0192f3a4-3d5e-7a7f-8c43-6b8c9d0e1f2a",
        "journeyName": "Welcome series",
        "status": "completed",
        "enteredAt": "2026-09-12T08:16:00.000Z",
        "endedAt": "2026-09-19T08:16:00.000Z"
      }
    ],
    "pushDevices": [],
    "formSubmissions": [],
    "conversions": [],
    "suppressions": []
  }
}
```
