customer_v1 schema. Each query only ever sees your organization’s rows, whatever SQL you send.
Turn it on
- In the Helium dashboard, open Settings and scroll to Data Access. Only organization Admins see this section.
- Enter a name for your secret key and click Create secret key. Copy the key right away: it is shown only once.
Your Data Access secret key is not the Helium API key you use in your app’s SDK setup. The API key cannot query data, and the secret key does not work in the SDK. Keep the secret key on your server: never put it in an app, a website or a public repository.
Send a query
Send aPOST request with your secret key as a bearer token and the SQL in the body:
customer_v1, so events and customer_v1.events are the same table.
A successful response is ClickHouse JSON:
X-Request-Id header. Include it when you contact support about a query.
Secret keys
- Secret keys belong to your organization, not to the person who created them. Admins can see and revoke every key in Settings → Data Access.
- A key expires 30 days after it was last used. Each day you use it, the 30 days start over, so a key in regular use does not expire.
- A revoked key stops working within a minute.
- Revoking your last key turns off Data Access for your organization. Create a new key to turn it back on.
- Only Data Access secret keys work with this API. Your Helium API key and other keys do not.
Data freshness
Data Access is not real-time. Data reaches Helium over time from your users’ devices and from the app stores, so the most recent hours are incomplete and recent numbers can still change.
To keep a copy of this data up to date:
- events:
event_timestampis the time on the user’s device, and Helium doesn’t expose when it received an event. Each time you sync, reload the last 7 days and upsert onevent_id, which also removes the rare duplicate events. Events that arrive more than 7 days late are missed this way, so also reload the last 30 days about once a week. - revenue:
timestampis when Helium received the store notification. Each time you sync, reload rows from a day before your last sync and upsert onnotification_id, so rows that become visible slightly late are not missed. - subscriptions and users: reload rows with a
last_updatedfrom a day before your last sync, and upsert onsubscription_idandhelium_persistent_id.
Limits
Queries are read-only. You cannot change these limits from your query.
The 4 MB response limit is usually reached long before 1,000,000 rows. A day of
events with every column is often tens of MB, so export in pages: select only the columns you need, sort on the time column and the row ID, and start each page after the last row of the previous one.
(event_timestamp, event_id) line for the first page. Stop when a page returns fewer rows than the LIMIT. If a page returns RESULT_TOO_LARGE, lower the LIMIT. Page revenue the same way on timestamp and notification_id.
Errors
Errors return a JSON body with a type and a message:Data use and privacy
- Queries can only read your organization’s data. Other organizations’ data is never visible, and you cannot read Helium’s internal tables.
- For each query, Helium records the time, the key used, the SQL, the status, how long it took and how much data it read, to run and debug the service. Helium does not store your results.
- Helium leaves out IP addresses, emails and other contact details. See Personal data. Your data still includes personal data about your app’s users, such as device IDs, user IDs and location. You are responsible for handling the data you export in line with your own privacy policy and the law that applies to you.