Getting Started
Authentication
Scrub uses Bearer auth for every protected request. There are two ways to get a token.
Auth flow
- Sign up — create an account and verify your email.
- Log in — exchange credentials for a short-lived access token (and a refresh token).
- Call the API — send
Authorization: Bearer <token>on each request. - Refresh — when the access token expires, use the refresh token to get a new one without logging in again.
For server integrations, skip the login loop: create an API key in Token Management and use that Bearer token from your backend.
JWT (dashboard / interactive)
Use this for the Scrub dashboard and any session-based client.
POST /api/v1/auth/login
Content-Type: application/json
{
"email": "you@company.ng",
"password": "your_password"
}httpAttach the returned access token:
Authorization: Bearer <access_token>http
When it expires, refresh:
POST /api/v1/auth/refresh
Content-Type: application/json
{ "refresh_token": "<refresh_token>" }httpAPI key (server-to-server)
Use this for Detect, Financial Report, and other programmatic calls from your backend.
- Sign in to the dashboard
- Open Token Management and create a key
- Send it as
Authorization: Bearer <api_token>
Do not embed API keys in frontend code.
Request headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <jwt> or Bearer <api_token> |
Content-Type | Yes (JSON POST/PUT) | application/json |
Idempotency-Key | No | Unique key for safe retries on POST |
X-Request-ID | No | Your correlation ID |
Next: Getting Started · Webhooks