# API reference

> The v1 API: authentication, endpoints, errors, idempotency and rate limits.

Base URL: `https://api.verifyngn.com/v1`. The full contract is the OpenAPI 3.1 file at [https://verifyngn.com/openapi.json](https://verifyngn.com/openapi.json).

## Authentication

Send your key (Dashboard, **API keys**) as `Authorization: Bearer vk_live_...`.

## Endpoints

| Method and path | What it does |
|---|---|
| `POST /verify` | One address: `{"email", "mode": "standard", "max_age_days": 30}` → a Result |
| `POST /verify/batch` | Up to 100 addresses, answered in order: `{"emails": [...]}` → `{"results", "credits_used"}` |
| `POST /lists` | A list as a job: JSON `{"name", "emails"}`, or a multipart `file` (`email_column`: its header) → 202 and the List |
| `GET /lists` | Your lists, newest first: `status` (queued, running, completed, failed), `limit`, `cursor` → `{"data", "next_cursor"}` |
| `GET /lists/{id}` | Progress; with `Accept: text/event-stream`, `progress` events, then `completed` or `failed` |
| `GET /lists/{id}/results` | `format=json` (pages of Results: `{"data", "next_cursor"}`) or `format=csv` (one file, your columns first); `status=valid,catch_all`; 409 `list_not_ready` until it completes |
| `POST /lists/{id}/cancel` | Stop a list; unchecked addresses are refunded |
| `DELETE /lists/{id}` | Delete a list and its results now |
| `POST /find` | Find an email: `{"domain", "first_name", "last_name"}` (5 credits when found) |
| `POST /feedback` | Report an outcome: `{"email", "outcome": "bounced" \| "delivered" \| "complained", "at"}` → `{"ok": true}` |
| `GET /credits` | `{"balance", "low_balance_threshold"}` |
| `GET`, `POST /webhooks`, `DELETE /webhooks/{id}` | [Webhooks](https://verifyngn.com/docs/webhooks) |

List ids look like `lst_...`, webhook ids `wh_...`.

## Idempotency

Send `Idempotency-Key: <a unique string>` with any POST or DELETE. The first answer is kept for 24 hours and replayed (with `Idempotent-Replayed: true`) when the same request comes again; the same key with a different body answers 409 `idempotency_conflict`.

## Rate limits

120 requests a minute per key. Every answer carries `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`; past the limit, 429 with `Retry-After`.

## Errors

Errors are [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem details (`application/problem+json`) with a `code` for programs, a `detail` that says what to do, and a `request_id` (also the `Verify-Request-Id` header on every answer). See [Errors](https://verifyngn.com/docs/errors).
