Incremental export
A recipe for keeping a copy of installs and in-app events in your storage with the flat raw rows. If hourly CSV files in a bucket suit you, Cloud export does the same without polling.
Installs: by updated_at
Section titled “Installs: by updated_at”time_field=updated_at returns the installs with a version written in the window: new installs, reinstalls (a new random_user_id) and reattributions (a changed partner_id and click). Each install comes in its latest state.
- Request
/v1/report/raw/installswithrow_format=flat,time_field=updated_atand a window[from, to); page withoffsetuntil a page is shorter thanlimit. - Upsert by
app_id+affise_device_id+random_user_id; of two versions keep the one with the laterupdated_at. - Start the next window a few minutes before the previous
to(rows are written in batches, up to 60 seconds late) and end it a few minutes before now. - Keep the window short — up to an hour. Every page reads the whole window again, so a day-long window is about ten times slower per page and may hit the request timeout for large apps.
curl -X POST https://restapi.affattr.com/v1/report/raw/installs \ -H 'API-KEY: <key>' -H 'Content-Type: application/json' \ -d '{"app_id":[123],"row_format":"flat","time_field":"updated_at", "time_window":{"from_rfc3339":"2026-11-03T07:55:00Z","to_rfc3339":"2026-11-03T09:00:00Z"}, "pagination":{"offset":0,"limit":1000}}'Things to know:
updated_atof a row may be later thanto: the install was updated again after the window. It will also come in the window of that later update; the upsert keeps one row.- Do not take the
updated_atof the last row as the nextfrom: for the reason above it may skip installs. Move the window by its bounds and page inside it withoffset. - The updates are kept 90 days. A window by
updated_atolder than 90 days may come back empty or incomplete. For the initial load or a gap longer than that, load the installs with a window byreceived_atoraffise_event_timestamp, then go on byupdated_at.
Events: by received_at
Section titled “Events: by received_at”An event gets into exactly one received_at window, whenever it happened. Late events — sent from the SDK offline queue or by add_event with a past time — land in the window of the time we received them, not in a window you have already exported.
- Request
/v1/report/raw/eventswithrow_format=flat,time_field=received_at, page by page. - Upsert by
app_id+affise_device_id+random_user_id+affise_event_id. - Move the window with an overlap of a few minutes, as for installs.
The attribution of an event row — partner_id, customer_user_id, is_re_install, product_id, google_* — is that of its install at the time of the request. When an install comes back from the updated_at export reattributed, either copy these fields to the stored events with the same app_id + affise_device_id + random_user_id, or request the events of the device again with devices_search.
A window by affise_event_timestamp reads the events received up to 7 days after the day the window ends; an event received later is returned only by a received_at window.
Other reports
Section titled “Other reports”- Clicks and impressions: windows by
created_atwith an overlap of a few minutes; keyclick_id. - Conversions: windows by
created_at, keyid(conversion_uuid). A conversion may change after it is created; request the last 48 hours again to pick the changes up. - Subscriptions: windows by
received_at;updated_atis in the rows.
Do not use created_at
Section titled “Do not use created_at”created_at of installs and events is the time the row was written; it is rewritten on reattribution and is not a reliable export cursor. Time fields: Time.