Docs
← chronapilot.com v 2026-05-12

Quickstart

Get from zero to your first ChronaPilot event in under a minute. This guide walks through creating a sandbox account, issuing a test API key, hitting your first endpoint, and subscribing to a webhook.

1. Create a sandbox account

Sign up at dashboard.chronapilot.com. Your first sandbox API key is issued immediately — no waitlist, no card required.

Test keys are prefixed sk_test_ and are visually distinct from live keys in the dashboard. They route to the sandbox at api-sandbox.chronapilot.com and never touch production data.

2. Make your first request

The simplest call is a server health check.

curl
curl https://api-sandbox.chronapilot.com/v1/health \
  -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc"

You should see:

JSON
{
  "status": "ok",
  "version": "2026-05-20",
  "request_id": "req_1A2b3C4d5E6f",
  "livemode": false
}

If you get a 401 authentication_failed, double-check your key starts with sk_test_ for sandbox or sk_live_ for production. The two surfaces are isolated.

3. Connect a calendar

Real value starts with a connected calendar. Spin up a Connect link for a test user:

curl
curl https://api-sandbox.chronapilot.com/v1/connections/start \
  -X POST \
  -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "google",
    "user_id": "usr_1abc2def3ghi",
    "return_url": "https://your-app.example.com/connected"
  }'

The response gives you a URL. Open it in a browser, sign in with a Google test account, and you'll be redirected back with a con_… connection ID.

4. Create an event

Now create an event on that user's calendar. ChronaPilot mirrors it to the connected provider for you.

curl
curl https://api-sandbox.chronapilot.com/v1/events \
  -X POST \
  -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "usr_1abc2def3ghi",
    "title": "Dentist appointment",
    "category": "health",
    "start_time": "2026-05-22T14:00:00-07:00",
    "end_time": "2026-05-22T15:00:00-07:00",
    "timezone": "America/Los_Angeles",
    "location": {
      "name": "Smile Dental",
      "address": "123 Main St, Anywhere CA 90210"
    },
    "travel": { "mode": "drive", "parking_buffer_min": 5 }
  }'

Within a few seconds you'll receive a departure.computed webhook with the optimal departure window — geocoded, traffic-aware, weather-aware.

5. Subscribe to webhooks

Register an endpoint:

curl
curl https://api-sandbox.chronapilot.com/v1/webhook_endpoints \
  -X POST \
  -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-app.example.com/webhooks/chronapilot",
    "events": ["event.created", "departure.computed", "departure.updated"]
  }'

You'll receive a signing secret — store it. Then verify the signature on each incoming POST:

Node.js
import { Webhook } from '@chronapilot/node';

app.post('/webhooks/chronapilot', express.raw({type:'application/json'}), (req, res) => {
  try {
    const event = Webhook.constructEvent(req.body, req.headers['chronapilot-signature'], process.env.WEBHOOK_SECRET);
    switch (event.type) {
      case 'departure.updated':
        notifyUser(event.data.object);
        break;
    }
    res.json({ received: true });
  } catch (err) {
    res.status(400).send('Invalid signature');
  }
});

6. Go further

Once you're ready to go live, swap your sk_test_ key for sk_live_ and change the base URL to api.chronapilot.com. Nothing else changes.