Skip to content

API

The Sleepwalker API lets you run AI Visibility and Content Intelligence workflows over HTTPS.

Use it to serialize pages, generate visibility prompts, queue AI Visibility runs, score content, create persisted Content Intelligence runs, and read results from your own systems.

Production API URL:

https://api.sleepwalker.ai

Use the API URL shown in the Sleepwalker app.

  1. Log in to the Sleepwalker app.
  2. Open API from the left sidebar.
  3. Click Generate.
  4. Give the key a clear name.
  5. Choose the access level or scopes.
  6. Copy the key immediately.

Sleepwalker only shows the raw key once. Store it in a server-side secret manager.

API keys start with:

sw_api_live_...

API keys are for HTTP API requests. MCP tokens start with sw_mcp_live_... and are for MCP clients.

Send the key as a bearer token:

Authorization: Bearer sw_api_live_...

Example:

Terminal window
curl -s "https://api.sleepwalker.ai/v1/tests?limit=20" \
-H "Authorization: Bearer sw_api_live_..."

Scopes limit what an API key can do.

ScopeAllows
tests:readList and inspect saved tests.
runs:readRead owned run summaries, statuses, usage, and activity.
pages:content:serializeSerialize page content.
visibility:prompts:suggestGenerate AI Visibility prompt ideas.
visibility:runs:createQueue AI Visibility runs.
content_intelligence:trends:discoverDiscover content trends.
content_intelligence:content:scoreScore content without saving a run.
content_intelligence:runs:createQueue persisted Content Intelligence runs.

Use the smallest scope set that can perform the job.

See Scopes Reference for the complete scope list.

Successful API responses currently return 200 OK.

EndpointPurposeScope
GET /v1/testsList saved Console tests.tests:read
GET /v1/tests/{test_id}Read one saved test.tests:read
GET /v1/reports/by-urlFind saved reports by URL.runs:read
GET /v1/usageRead credit balance and usage telemetry.runs:read
GET /v1/activityRead recent request activity.runs:read
GET /v1/visibility/runsList direct AI Visibility runs.runs:read
GET /v1/visibility/runs/{run_id}Read one AI Visibility run.runs:read
GET /v1/content-intelligence/runsList direct Content Intelligence runs.runs:read
GET /v1/content-intelligence/runs/{run_id}Read one Content Intelligence run.runs:read
EndpointPurposeScope
POST /v1/pages/content/serializeSerialize page content.pages:content:serialize
POST /v1/visibility/prompts/suggestGenerate AI Visibility prompt ideas.visibility:prompts:suggest
POST /v1/visibility/runsQueue an AI Visibility run.visibility:runs:create
POST /v1/content-intelligence/trends/discoverDiscover content trends.content_intelligence:trends:discover
POST /v1/content-intelligence/content/scoreScore content without saving a run.content_intelligence:content:score
POST /v1/content-intelligence/runsQueue a persisted Content Intelligence run.content_intelligence:runs:create

Sleepwalker separates single actions from persisted runs.

TypeWhat it doesSaved?
SerializationExtracts normalized page content.No
Prompt suggestionGenerates AI Visibility prompt ideas.No
Trend discoveryFinds relevant content trends for a URL.No
Content scoreScores a URL and returns recommendations.No
AI Visibility runQueues one or more prompt/platform probes.Yes
Content Intelligence runQueues a Content Intelligence analysis.Yes

Use persisted runs when you need status polling, Activity visibility, Console visibility, or later result retrieval.

Use single actions when you only need an immediate result, such as a serialized page, prompt suggestions, trends, or a score.

Run endpoints can return the statuses listed in Enums.

Common run statuses:

StatusMeaning
queuedThe run has been accepted and is waiting to start.
runningWork has started.
completedWork finished and results are available.
failed / cancelledWork could not complete. Check the response for details.

Create responses can also return partially_queued when some requested probes were queued and the rest were skipped.

AI Visibility runs also report probe counts, including queued, running, succeeded, errored, and cancelled probes.

Persisted runs are asynchronous. Create a run, then poll its status endpoint until it reaches a terminal state such as completed, failed, or cancelled.

Sleepwalker does not send webhooks or callbacks. Polling is the supported way to detect completion.

Recommended polling interval: 10 to 30 seconds.

Sleepwalker uses pay-as-you-go credits.

ActionCredits
1 AI Visibility probe1
Page content serialization1
Prompt suggestion batch1
Trend discovery1
Content score with supplied trends2
Content score without supplied trends3
Persisted CI run, score depth3
Persisted CI run, full depth6

Public pricing:

1 credit = €0.02
minimum top-up = €5.00

Read endpoints, status polling, and invalid requests that are rejected before work begins do not consume credits. Visibility probes that fail without a usable response or citations release their reserved credit.

See Credit Lifecycle for estimated, reserved, settled, released, and failed states.

AreaLimit
List endpointslimit is clamped to the endpoint maximum. Saved tests use 50. Run/activity endpoints use 100.
Page serializationmax_chars must be between 1 and 25,000. Use offset to page through long content.
Prompt textVisibility probe prompts support up to 500 characters.
Result payloadsResult endpoints return compact structured data by default. Use include flags for heavier result payloads.

See Limits for the complete limit table.

Run list endpoints return newest items first and support cursor pagination:

GET /v1/visibility/runs?limit=20&starting_after=<run_id>

Responses include has_more and next_starting_after.

See Pagination for details.

Create-run endpoints accept idempotency_key.

Use an idempotency key when your integration may retry a request after a timeout.

If the same account, source, and key are replayed while the original run record exists, Sleepwalker returns 200 OK with the existing run handle instead of creating duplicate billable work.

The key is scoped to the authenticated account and access source.

{
"idempotency_key": "daily-sleepwalker-homepage-2026-06-10"
}

Error responses use a detail field. See Errors for response shapes and machine-readable values.

StatusMeaning
400Invalid request body, unsupported filter, or missing required field.
401Missing or invalid authentication.
402Insufficient credits for a billable action.
403Key does not have the required scope, the account is suspended, or the action is unavailable.
404Resource was not found or does not belong to the authenticated user.
503The requested action is temporarily unavailable.

The current API surface is versioned under /v1 and is the supported surface for integrations.

  • Backward-incompatible changes are introduced under a new version path.
  • Additive changes, such as new endpoints or new response fields, can appear within /v1.

Build clients to tolerate new fields: ignore unknown response fields rather than failing on them.