Getting started
Authentication
Two credentials, and they are not interchangeable.
The API takes two different credentials depending on what you are doing.
| Credential | Header | What it is for |
|---|---|---|
| API key | X-API-Key: <key> | Scraping: /scrape, /scrape/batch |
| Login token | Authorization: Bearer <token> | Everything else: keys, logs, accounts, schedules, settings, analytics |
Sending the wrong one returns auth_failed (HTTP 401).
API keys
Create and revoke keys in the console, or over the API with a login token:
curl -X POST 'https://api.helicitylabs.com/api-keys' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"label": "production worker"}'
Keys do not expire. Revoke one with DELETE /api-keys/{api_key_id}; it stops
working immediately.
Login tokens
curl -X POST 'https://api.helicitylabs.com/auth/login' \
-H 'Content-Type: application/json' \
-d '{"email": "you@example.com", "password": "..."}'
The response carries a bearer token. GET /auth/me confirms who it belongs to,
and POST /auth/logout ends the session.
POST /auth/register exists but is closed in production. Tenants are
created by hand. Ask us and we will set one up.
Keeping keys out of your repo
The API key is the credential that can spend credits, so treat it as a secret: read it from the environment, never commit it, and give each deployment its own key so you can revoke one without taking the others down.