Skip to content

Area: Developers

Export a profile's data

POST https://releva.ai/api/v0/profiles/exports collects everything Releva holds about one person and e-mails a download link to the address you give.

GDPR gives users the right to access the personal data held about them. Call it from your server to fulfil such a data subject access request in an automated way. The export holds the profile, its devices, its events and its attribution records, including those of profiles merged into it. To read only the profile fields, Get a profile is faster.

Send your shop’s Secret Key as a bearer token, from your server only:

authorization: Bearer $RELEVA_SECRET_KEY

Find the key under Settings › Shop & Integration; see Find your Access Token and Secret Key. Authentication failures answer 400, not 401 (see Errors).

POST /api/v0/profiles/exports with content-type: application/json.

Field Type Required Notes
sendToEmail string yes Where the download link goes, for example your privacy team.
email string exactly one of email, profileId, phoneNumber The person’s email address.
profileId string Your customer id.
phoneNumber string International form only: + and digits.
curl -X POST 'https://releva.ai/api/v0/profiles/exports' \
-H "authorization: Bearer $RELEVA_SECRET_KEY" \
-H 'content-type: application/json' \
-d '{ "email": "maria@example.com", "sendToEmail": "privacy@demo-store.example.com" }'

To find the person by your customer id or phone number instead, replace email in the body:

curl -X POST 'https://releva.ai/api/v0/profiles/exports' \
-H "authorization: Bearer $RELEVA_SECRET_KEY" \
-H 'content-type: application/json' \
-d '{ "profileId": "DEMO-1001", "sendToEmail": "privacy@demo-store.example.com" }'
curl -X POST 'https://releva.ai/api/v0/profiles/exports' \
-H "authorization: Bearer $RELEVA_SECRET_KEY" \
-H 'content-type: application/json' \
-d '{ "phoneNumber": "+15555550199", "sendToEmail": "privacy@demo-store.example.com" }'

202 Accepted with the body {}. The export runs in the background after the response. When it is ready, sendToEmail gets an e-mail with the subject <your shop URL> - Data request result ready to download and a Download Data Dump button. The e-mail says the link is valid for 7 days.

The file is JSON Lines: one JSON object per line, each with one key that names the record type: profile, device, event, attribution or productAttribution.

Errors have one shape, { "message": "..." }.

Status When Message
400 No authorization header Authorization header is missing.
400 The header is not Bearer <token> Authorization header is malformed. It should look like `Bearer <string>`.
400 The token is not a UUID Authorization header contains an invalid Bearer token.
400 No shop has this key Domain with the provided secret key cannot be found.
400 Missing sendToEmail The 'sendToEmail' field is required.
400 No identifier, or more than one Exactly one of (profileId, phoneNumber, email) is required.
400 Unknown key, for example format The object '' contains forbidden keys: 'format'.
400 National phone number phoneNumber must be a valid telephone number starting with + and international code, e.g. +1. Got 0888000111 instead.
402 The shop is disabled Domain is disabled. Please reach out to support@releva.ai to enable it.
413 Body larger than 800 KB request entity too large
500 Unexpected error An internal error occurred. Retry later.
  • One person per request.
  • Rate limits: none on this endpoint.
  • The 202 means the export was queued, not that a profile matched.