# Backfill historical data for a new connection

When a user links a new account, you usually want their full history, not just what changes from today forward.

## Page through each resource

```bash
curl "https://api.seedlink.dev/v1/connections/8f9ab02c-78c2-4292-a43d-79a327a4efd5/facilities/fac_C11-0000123-LIC/packages?page=1&per_page=100" \
  -H "Authorization: Bearer sl_at_..."
```

Check `pagination.total_pages` in the response and keep incrementing `page` until you've covered it. `per_page` maxes out at 100.

## Repeat per resource type

There's no single endpoint that returns everything at once. Backfilling a connection means running the same paged loop against `packages`, `plants`, `harvests`, `transfers`, `sales`, and `lab_results` separately.

## Switch to steady-state after

Once the backfill finishes, move to the ongoing sync pattern (either polling on a schedule, or webhooks for the events you care about) rather than re-running a full backfill.

## Gotchas

There's no `modified_since` filter, so a full backfill is the only option. There's also no bulk export across resource types. Budget for the number of paged requests this takes on a facility with a lot of history.

