# Export events to your own S3 bucket

> Get a copy of every raw event in your organisation's own Amazon S3 bucket each night, partitioned by site and date.

Source: https://docs.bifrostorbit.com/insights/developers/s3-export/

The S3 export writes every raw event of every site to your organisation's own bucket each night, for a data warehouse or your own records. It comes with the Enterprise plan.

## Prepare the bucket

1. Make a bucket in the region you want, such as `eu-central-1`. Keep it private.
2. Make a user or role for Insights Orbit alone, with a policy that only lets it add files under one folder:

```json
{
  "Version": "2012-10-17",
  "Statement": [
    { "Effect": "Allow", "Action": "s3:PutObject", "Resource": "arn:aws:s3:::northwilds-insights-export/insights/*" }
  ]
}
```

3. Make an access key for it.

Storage that works like S3 outside Amazon, such as IONOS or Scaleway, works too: give its endpoint as well.

## Set it up

1. An Admin opens **S3 export** under **Developers**.
2. Enter the bucket, region, folder, access key id and secret access key.
3. Select **Test the connection**. Insights Orbit writes a small file, `_insights-orbit-check.txt`, to the folder, and says what is wrong if it can't.
4. Select **Set up the export**.

The secret is kept sealed and never shown again. To change it, enter a new one; leave it empty to keep the old one. **Pause** stops the export until you start it again, and **Remove** forgets the bucket and key, leaving the files already written. Every change is in the [audit trail](https://docs.bifrostorbit.com/insights/everyone/audit-trail/).

## The files

Every night, once the day is over in every site's time zone (and after 02:00 UTC at the earliest), Insights Orbit exports the day before, for each site that had events. A site's day runs from midnight to midnight in its own time zone, and `date=` is that local date:

```
insights/site=SITE_KEY/date=2026-10-21/events-0000.ndjson.gz
```

- Each file is gzipped, with one event per line as JSON, oldest first, with the same fields as the [raw event API](https://docs.bifrostorbit.com/insights/developers/raw-event-api/) and the site's key as `site`.
- A day with more than 100,000 events is split into `events-0000`, `events-0001` and so on.
- The `site=` and `date=` folders let Athena, BigQuery, Snowflake and similar tools read the files as partitions.
- Exporting a day again writes the same names, so a file is replaced rather than doubled.

The first export is for the day after you set it up. If the bucket can't be reached, **S3 export** shows why, and Insights Orbit tries again every few hours and catches up on up to seven missed days.
