Visitor data requests: access, export, and deletion

Answer a visitor's access or erasure request straight from Databuddy, for one website.

  1. Find the visitor ID
  2. Export or delete
  3. Keep the requestId
  4. Check until completed
curl -X POST https://api.databuddy.cc/visitor-data/export \
  -H "x-api-key: $DATABUDDY_API_KEY" \
  -H "content-type: application/json" \
  -d '{"websiteId": "your-website-id", "visitorId": "user_123"}'

Needs a key with manage:websites, which also allows deletion.

One request covers
On the websitePageviews and custom events, errors, web vitals, engagement, outgoing link clicks, MCP tool calls recorded with their user ID, revenue attribution, identity links, profile traits and their history, session recordings and their summaries
Sent without a websiteCustom events and MCP tool calls your servers sent with an API key and no website ID, when they name the visitor's profile ID or one of their browser IDs
NeverAnother organization's events

Find the visitor

VisitorVisitor ID to send
IdentifiedThe profile ID you pass to identify(); from an email, look it up with POST /profiles/findByEmail
AnonymousThe visitor ID on the user's page in the dashboard

Databuddy links the ID to that visitor's browsers and sessions. On a browser another identified profile also used, only this visitor's sessions are included, so one person's request doesn't remove someone else's data. Naming a shared browser directly covers its sessions that belong to no identified profile.

With the default anonymizeVisitorIds setting, each browser gets a new stored ID every day. Without an identified profile, a request reaches only the days whose stored ID you have. An identified profile reaches the days the browser was identified on, including that day's visits before identify(), but not anonymous visits from earlier days.

Browser identify() tags the visitor's later events with the profile ID, so a request reaches them. A browser ID you pass to server-side identify() is kept as sent, while its events are stored under the daily ID. The request then covers that profile, its traits and events tagged with it, but not the browser's untagged visits.

Export every page

Export returns a filename and the JSON document in data.

ContentsAnalytics rows, the profile with decrypted name and email, trait changes, browsers linked to the profile, opt-outs naming the visitor, recording metadata
Page sizeUp to 50,000 rows per analytics table; pass a smaller positive integer in pageSize
More rowsA table's truncated is true. Send the same IDs with "page" set to the exact data.nextPage string, and append rows until nextPage is gone.
HTTP 400An edited token, one for another website or visitor, or one more than an hour after the first page; start again
Repeated on each pageProfile, browser links, opt-outs and recording metadata

The event-time cutoff stays fixed, but late arrivals or erasures during export can change the rows between requests.

Check a deletion

Delete returns a requestId and the profiles and recordings removed, with status pending; analyticsRows is always empty, because a daily pass erases events. Keep the requestId: calling delete again creates a new request.

curl -X POST https://api.databuddy.cc/visitor-data/deletion-status \
  -H "x-api-key: $DATABUDDY_API_KEY" \
  -H "content-type: application/json" \
  -d '{"websiteId": "your-website-id", "requestId": "the-request-id"}'
StatusMeans
pendingNo daily pass has issued the deletes for the visitor's events yet, or the latest pass failed and will retry
submittedQueued events recorded before the request are still being erased
completedWith completedAt: the seven-day window has closed and no report shows anything the request covers
What happensWhen
Events, and traits and identity links copied into analyticsLeave every report within about a day, and the disk within about a week after that
The visitor's IDs, kept to find themUp to two weeks after the pass's last run, then dropped
Queued events recorded before the requestErased the same way for seven days
Events stamped up to an hour after the requestErased too, because device clocks up to an hour fast are accepted
Identify calls recorded before the requestDropped instead of recreating the profile
The request itselfKeeps only its ID, website, requester and timestamps
Stripe paymentsErased with renewals and refunds that name only the visitor's Stripe customer, unless another visitor also paid through it. Payments not yet recorded lose the visitor's IDs; one recorded within the seven days is kept without the visitor's IDs or Stripe customer.

Know what a request keeps

KeptWhy
An opt-outIf the visitor opted out, in their browser or through your server's optOut(), Databuddy keeps the website, the IDs the opt-out named (the browser's anonymous ID, or the IDs your server sent), and when, so later events are still dropped. It's included in an export. A browser opt-out goes when that browser opts back in, a server one when your server calls optIn(); both go when you delete the website.
Visits after the requestNew data, collected as usual unless they opted out. Stop calling identify() for them if they objected some other way.
Audit logWho exported or deleted visitor data, or was refused for permission or too many requests, without the visitor ID
Stripe payments made after an opt-outOnly their Stripe customer ID, which a request doesn't search
Later renewals and refunds, and those of a shared Stripe customerTheir Stripe customer ID. Stripe also keeps Databuddy IDs your checkout added to subscription metadata, so a renewal after the seven days is credited again unless you remove it in Stripe.
Replay billing receiptsA session ID
Rate-limit and replay counters keyed by IP or sessionExpire on their own within a day
Feature flag rules and saved analysisAny ID you typed into them yourself
DataKept for
Events and profiles, including errors, web vitals, MCP tool calls, traits and their historyNo automatic expiry; until you delete the visitor, group or website
Session recordings30 days
Anything recorded for a websiteErased when you delete the website

To keep less, delete visitors or groups on your own schedule through the API.

Erase an organization or other group

curl -X POST https://api.databuddy.cc/visitor-data/delete-group \
  -H "x-api-key: $DATABUDDY_API_KEY" \
  -H "content-type: application/json" \
  -d '{"websiteId": "your-website-id", "groupType": "organization", "groupKey": "org_123"}'

When one of your customer organizations is deleted, erase what Databuddy recorded for it, including events sent without a visitor ID. Send the group's key exactly as you sent it: events with group_organization: "org_123", or group() calls with that type and key, use organization and org_123. It needs the same keys as a visitor deletion.

ErasedNot erased
Pageviews, custom events, outgoing link clicks and MCP tool calls whose group_<type> property is the key, as a string or numberThe people in the group: their profiles, traits, identity links, recordings and events without the property. Send a visitor deletion for each.
The group's traits, from group() calls and Stripe metadataErrors, web vitals, engagement and revenue rows, which carry no group properties
Account labels and the account review Databuddy derivedCustom events sent with an API key and no website ID
Insights and investigations that named the account
The same key under another group type, or anything recorded after the request

An event carrying the key is erased whole, so one with both group_organization and group_workspace takes the workspace's activity too. A session that also held other events can drop out of overview session totals, while its remaining events still count elsewhere. The email_domain type is refused with 400, because those accounts come from stored people's emails and would come back; delete each member instead.

Delete returns a requestId, rows erased per table, and groups: 1 when a stored group was removed. POST /visitor-data/group-deletion-status reports the same statuses with the same seven-day window. The request drops group() calls recorded before it, erases events stamped up to an hour after, then keeps only its ID, website, group type, requester and timestamps. The audit log records who deleted group data, without the key.

While earlier deletions are still being applied, group deletes answer 429 with code RATE_LIMITED, a Retry-After header and retryAfter in the body, in seconds. Nothing is recorded, so resend once that time passes.

How is this guide?