# IndexLinks REST API

Base URL: https://app.indexlinks.app. Auth: `Authorization: Bearer il_live_…` (see https://indexlinks.app/auth.md). Full contract: https://indexlinks.app/openapi.json

## Public
- `POST https://indexlinks.app/v1/public/audit` — body `{"url":"example.com"}`. Live crawlability check; returns a score, checks with status pass | warn | fail | locked, and a report id kept for 14 days. Rate limited per IP.
- `GET https://indexlinks.app/v1/public/audit/{id}` — a saved report.

## Websites
- `GET /v1/properties` — your websites.
- `POST /v1/properties` — body `{"name":"My site","url":"example.com"}`. Adds a website and queues its homepage.

## Pages
- `POST /v1/properties/{id}/submit` — body `{"urls":["https://example.com/new-page"]}` and/or `{"sitemap_url":"https://example.com/sitemap.xml"}`. Sends pages to every engine. Pages already tracked are skipped as `duplicates`; add `"resend": true` to send them again (after a redirect, merge or rewrite) — the response counts them as `resent`. Paid plan; every sent page uses the allowance.
- `GET /v1/properties/{id}/urls` — tracked pages with per-engine status, up to 1,000 per call. Query: `limit` (1–1000), `offset`, `status` (queued, processing, done, error), `url_contains`. `total` is the full count; `next_offset` is null on the last page.
- `GET /v1/properties/{id}/urls/{urlId}/status` — one page in detail.
- `GET /v1/properties/{id}/score` — website-level summary.

### Website setup
A new website has its own IndexNow key. Bing, Yandex and the other IndexNow engines accept its pages only once the site serves that key file; Google index status needs a linked Search Console site. `POST /v1/properties` returns the checklist as `setup`.
- `GET /v1/properties/{id}/setup` — checklist: IndexNow key file (URL, content, verified), Search Console, Cloudflare, Baidu, sitemap sync, and `next_steps` in order. Steps only the user can do (a Google or Cloudflare sign-in) come with a `connect_url` to open in a browser.
- `POST /v1/properties/{id}/verify` — check the hosted key file.
- `POST /v1/properties/{id}/key-file/install` — body `{"host": "cloudflare", "zone_id"?}`: host the key file through the connected Cloudflare account (a route that serves only that file), then verify.
- `POST /v1/properties/{id}/search-console` — body `{"site_url"}`: link a Search Console site the user owns.
- `POST /v1/properties/{id}/baidu` — body `{"token"}`: Baidu push token (empty disconnects).

Errors are JSON: `{"error": "…"}` with a 4xx status. 402 means the action needs a paid plan.
