The REST API is the surface underneath the CLI and the MCP server: everything they do is a call documented here. It is a conventional JSON API over HTTPS. If you have used one before, the only things worth reading carefully are how a request names its organization, idempotency on scan creation, and the scan quote.
The complete, generated description is the OpenAPI 3.1 document at /api/v1/openapi.json. It is built from the route registry on every deploy, so it cannot drift from the code. Load it into Postman, Insomnia, Bruno, or any OpenAPI code generator.
Base URL and versioning
https://whereamimentioned.com/api/v1
Every response, success or failure, carries X-Wam-Api-Version: 1. The version is one integer, not a semver string, and it only changes when a response shape changes incompatibly. The request's own X-Wam-Api-Version header is ignored: there is no negotiation. Clients should read the response header and refuse to parse a version they were not built for; the CLI exits with api_version_mismatch when it sees a higher one.
Additive changes (a new field, a new endpoint, a new enum value) happen without a version change. Write clients that ignore unknown fields.
The seven free site checks live outside the versioned surface, at /api/site/*, because they need no key and no organization. They are covered below.
Authentication
Every /api/v1 route except the OpenAPI document needs an API key:
Authorization: Bearer wam_live_...
Keys are created in the dashboard under Settings, API keys, or by wam auth login. Authentication and keys explains the two kinds of key, scopes and role ceilings. Two facts matter for every call:
- API access needs a paid plan. An organization on the free floor gets 403
feature_not_availableon every organization-scoped route, withdetails.billingUrl. Three routes are exempt:GET /api/v1/organizations,POST /api/v1/organizationsandDELETE /api/v1/keys/self. - Session cookies are not accepted. A request that carries an
Authorizationheader never falls back to a cookie, and a request with only a cookie is 403insufficient_scope.
Naming the organization
Paths name a workspace (/workspaces/{workspaceSlug}/...) or a scan (/scans/{scanId}), never an organization. The organization comes from the key:
- An organization key is bound to one organization. Send nothing else. If you do send
X-Wam-Org, it must name the same organization; any other value is 404not_found. - An account-wide key reaches several, so every organization-scoped request must carry
X-Wam-Org: <orgSlug>. Without it, 422validation_failedwithdetails.hintpointing atGET /api/v1/organizations, which lists the slugs the key may name.
Three routes resolve no organization and ignore the header: listing organizations, creating one, and revoking the calling key.
A resource that exists but belongs to an organization the key cannot reach is answered exactly like a resource that does not exist: 404 not_found. The API never confirms that something exists elsewhere.
Requests
- Request bodies are JSON with
Content-Type: application/json. A body that is not valid JSON is 400bad_request. A body that is valid JSON but does not match the schema is 422validation_failedwith the issues listed indetails.issues. - Body schemas are strict: an unknown field is a 422, never silently dropped. That includes trying to put
orgSlugin a body; the organization is never read from a body. - Query parameters are validated the same way. An unknown query parameter is a 422.
- Identifiers are UUIDs. Slugs are lowercase letters, digits and hyphens, up to 64 characters.
- Timestamps are ISO 8601 strings in UTC.
- Set a
User-Agentthat names your integration. It appears in the audit log next to the key.
Responses
Success responses return the resource (200), the created resource (201), or an existing resource on an idempotent replay (200 with X-Idempotent-Replay: true). Lists return a page envelope:
{
"data": [ ... ],
"pagination": { "nextCursor": "eyJ0cyI6...", "hasMore": true, "limit": 25 }
}
Every response carries these headers:
| Header | Meaning |
|---|---|
X-Request-Id |
req_ followed by a 26-character ULID. Unique per request. Quote it when you contact support; it correlates with the server log and with error tracking. |
X-Wam-Api-Version |
The API version that produced the response. Currently 1. |
X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset |
Present on every response a rate limiter ran for. The tightest bucket that applied. Reset is a Unix timestamp in seconds. |
Retry-After |
On a 429 only. Seconds to wait. |
X-Idempotent-Replay |
true on a 200 from a create route that answered with an existing resource. |
Errors, on every non-2xx response, use one envelope:
{
"error": {
"code": "insufficient_credits",
"message": "This scan needs 24 credits and the organization has 10.",
"requestId": "req_01J9X4Z2M8K7Q3R5T6V8W9Y0ZA",
"details": { "required": 24, "available": 10, "billingUrl": "https://whereamimentioned.com/acme/billing" }
}
}
code is one of twelve stable strings; branch on it, not on message, which is written for people and may change. details is a code-specific structured object, never prose. Errors and rate limits lists every code and every details shape.
Pagination
Lists are cursor-paginated, newest first, ordered by creation time then id. Offsets do not exist, because an offset skips rows when a scan lands mid-iteration.
limit: 1 to 100, default 25 (20 on the answers list).cursor: thenextCursorof the previous page. It is opaque; do not construct one. A cursor this API did not issue is a 422.pagination.hasMoresays whether to continue;pagination.nextCursoris null on the last page.
curl -s "$BASE/workspaces/acme-main/scans?limit=50" -H "$AUTH"
curl -s "$BASE/workspaces/acme-main/scans?limit=50&cursor=eyJ0cyI6..." -H "$AUTH"
Filtering and field selection
List routes accept filters as query parameters, documented per endpoint in the reference: status, from and to on scans; enabled, source and stage on prompts; modelId, mentioned and lowConfidence on answers; scanId, status and type on recommendations; scanId and bucket on citations.
Every list accepts fields=a,b,c to keep only those fields on each item. Unknown names are ignored and id is always kept. It is a bandwidth convenience, not a security boundary.
Idempotency
Two routes require an Idempotency-Key header, because a retried request there would otherwise spend money or create a duplicate tenant: POST /workspaces/{workspaceSlug}/scans and POST /organizations. No other route accepts the header.
- The value is 1 to 128 characters from
A-Z a-z 0-9 _ . : -. Missing or malformed is 422validation_failed. - The first request with a key creates the resource and answers
201. - A later request with the same key and the same terms answers
200withX-Idempotent-Replay: trueand the existing resource, and reserves or creates nothing. For a scan, "same terms" means the same workspace; for an organization, the samenameandtype. - The same key with different terms is 409
conflictwithdetails.originalScanIdordetails.originalOrgId.
Choose a key that names the intent, not the attempt: nightly-acme-main-2026-11-07, not a random UUID per try. The CLI derives one from the organization, workspace, UTC date and CI run id, so a retried job follows the scan that already exists.
The scan quote
Starting a scan is the only call that spends money, so the API lets you see the price first and hold it.
POST /workspaces/{workspaceSlug}/scans/estimateis free. It returnscredits, thepromptscount, themodelsthat would run (ids and display names),repetitions,mode, the currentbalance, whether it issufficient, and aquotewith atokenandexpiresAt.POST /workspaces/{workspaceSlug}/scanswith{"quote": "<token>"}starts the scan only if the token verifies, was minted for the calling key, has not expired (five minutes), and its priced terms still match. A changed term (a prompt enabled since, a roster change) is 409conflictwithdetails.fieldsnaming what moved. A stale or foreign token is 409 as well.- The
quotefield is optional. Without it, the server prices the scan at the moment of the call and starts it. The CLI and the MCP server always pass one, because "estimate, then confirm" is only a real gate when the confirmation refers to a specific price.
mode and repetitions are not request parameters anywhere. The plan decides them. Scans started through the API run grounded with the plan's default repetitions; a person can choose otherwise for one scan in the dashboard.
Scan lifecycle over the API
POST .../scans/estimate price it (free)
POST .../scans create: 201 { id, status: "queued", credits, pollUrl }
GET /scans/{id} poll: status queued | running | done | failed, progress { done, total, totalIsFinal }
GET /scans/{id}/report 404 with details.status until done; then the report
GET /scans/{id}/answers the evidence, paginated
Poll every 10 seconds or so; the CLI polls at 10 by default and refuses anything under 5. progress.total grows while the scan runs, so compute a percentage only when totalIsFinal is true. One scan runs per workspace at a time: a create while one is in flight is 409 scan_already_running with details.scanId and details.pollUrl, which you should adopt rather than retry.
Credits are reserved at creation (creditsReserved) and settled when the scan finishes (creditsSpent); answers that never ran are refunded. A failed scan carries an error string.
Rate limits
Limits are sliding windows. When one denies a request the answer is 429 rate_limited with details.retryAfterSeconds and a Retry-After header. The full table, including the CLI and MCP buckets, is on the errors page. The ones a REST client meets:
| Limit | Scope | Window |
|---|---|---|
| 30 failed authentications | per client IP | 1 minute |
| 120 reads | per key | 1 minute |
| 30 writes | per key | 1 minute |
| 300 requests | per organization, all its keys together | 1 minute |
| 3 scan starts | per key | 60 minutes |
| 3 organization creations | per account | 1 hour |
The per-organization ceiling exists so that an organization cannot multiply its rate by minting keys. The scan-start ceiling is about money, not traffic: no script should be able to start a fourth scan in an hour, whatever it was told.
Rate limiting fails closed: if the limiter itself is unavailable in production, requests are refused rather than waved through.
The free site routes
Seven routes at /api/site/* run the no-account site checks. They take no key, resolve no organization and spend no credits. Each is a POST with a JSON body naming the url, and each answers the full structured result the CLI and the MCP server render.
| Route | Body | Limit |
|---|---|---|
POST /api/site/check-crawlers |
{ "url" } |
30 per hour per IP |
POST /api/site/validate-llms-txt |
{ "url" } |
30 per hour per IP |
POST /api/site/generate-llms-txt |
{ "url", "depth"?: "index" or "full", "siteName"?, "description"? } |
10 per hour per IP |
POST /api/site/generate-sitemap |
{ "url" } |
10 per hour per IP |
POST /api/site/validate-structured-data |
{ "url" } |
30 per hour per IP |
POST /api/site/check-meta |
{ "url", "keyword"? } |
30 per hour per IP |
POST /api/site/analyze-chunks |
{ "url" } |
30 per hour per IP |
The server fetches the URL, never the client, so the checks see the site from the public internet. Three conditions are reported as 422 validation_failed with a details.reason: unsafe_url (a private, loopback or link-local address, which the server refuses to fetch), upstream_unavailable (the site did not answer; details.upstreamStatus carries its status) and crawl_refused (the site's robots.txt disallows the crawler and nothing could be read). Response bodies are capped at 2 MB per fetched page. The result shapes are in the reference.
A complete example
Price and run a scan, wait for it, and print the score, with curl and jq:
#!/usr/bin/env bash
set -euo pipefail
BASE=https://whereamimentioned.com/api/v1
AUTH="Authorization: Bearer $WAM_TOKEN"
WS=acme-main
estimate=$(curl -sf -X POST "$BASE/workspaces/$WS/scans/estimate" -H "$AUTH" \
-H "Content-Type: application/json" -d '{}')
echo "Cost: $(jq -r .credits <<<"$estimate") credits, balance $(jq -r .balance <<<"$estimate")"
jq -e .sufficient <<<"$estimate" >/dev/null || { echo "Not enough credits"; exit 4; }
quote=$(jq -r .quote.token <<<"$estimate")
created=$(curl -sf -X POST "$BASE/workspaces/$WS/scans" -H "$AUTH" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: nightly-$WS-$(date -u +%F)" \
-d "{\"quote\":\"$quote\"}")
id=$(jq -r .id <<<"$created")
while :; do
status=$(curl -sf "$BASE/scans/$id" -H "$AUTH")
state=$(jq -r .status <<<"$status")
echo "$state: $(jq -r '.progress | "\(.done) of \(.total) answers"' <<<"$status")"
[[ "$state" == "done" || "$state" == "failed" ]] && break
sleep 10
done
[[ "$state" == "done" ]] || { jq -r .error <<<"$status"; exit 6; }
curl -sf "$BASE/scans/$id/report" -H "$AUTH" | jq '{score, presenceRate, presenceCiLow, presenceCiHigh, sov}'
The same program in TypeScript is about twenty lines with the typed client.
What the API does not do
Being explicit about this saves a search:
- No webhooks. Poll
GET /scans/{id}, or use the CLI's--wait. - No deleting organizations or workspaces, no member or role management, no billing changes. Those are dashboard actions by a signed-in person.
- No editing a prompt's text, no editing or removing a competitor. Remove and re-add, or use the dashboard.
- No choosing scan mode or repetitions. The plan decides.
- No OAuth yet. The 401 response already carries a
WWW-Authenticateheader that names an OAuth resource-metadata URL, so that clients built for it will find it when it ships; today that URL answers 404 and API keys are the only credential.