# Log in once. Hear only about what changed.

A session keeps a site's login between jobs, so later runs skip straight past it. A schedule runs a program on a cron, compares each result with the last, and sends an event only when the data actually changed.

## Save the session after login

A checkpoint can save the browser's session under a name. A program that resumes from that session starts at the checkpoint after the login whenever the session is still valid, and logs in again when it is not.

```
{ "options": { "session": "acme", "resume_from_session": true },
  "steps": [
    { "goto": "https://portal.example.test/login" },
    …,
    { "checkpoint": { "name": "logged_in", "save_session": "acme" } },
    { "extract": { "plan": ".plan-name" } }
  ] }
```

## Schedules with a timezone

A schedule is a program, its inputs and a cron in an IANA timezone. Daylight saving is handled, overlapping runs are skipped, and missed runs are not replayed unless you ask.

```
curl -X POST https://api.kaab.ist/v1/schedules \
  -H "Authorization: Bearer $KAAB_API_KEY" \
  -d '{
    "program": "plan-watch",
    "cron": "0 9 * * *",
    "timezone": "Europe/Istanbul",
    "change_detection": { "enabled": true, "fields": ["plan", "price"] }
  }'
```

## Only what changed

Each successful run's data, limited to the fields you name, is compared with the previous run's. When it differs you get a schedule.changed event with the changed paths and a JSON Patch of the difference.

## Questions

### What happens when credits run out?

Schedules pause instead of failing, and pick up again once there are credits to run on.
