Docs
Open Okidoki

API reference

Every endpoint of the Okidoki API, with parameters and examples.

Every endpoint of the Okidoki API. All addresses start with https://okidoki.sh/api/v1. See API basics for keys, answers, errors, rate limits, retries and pages. The same endpoints, with every parameter, are in the OpenAPI file at https://okidoki.sh/api/v1/openapi.json.

In the Key column: read works with any key, change needs a key that may read and change, and account needs a key for all sites that may read and change.

#Overview

MethodPathKeyWhat it does
GET/noneLists endpoints, reports, periods and filters
POST/startnoneCreates an account, a site and a key, for agents
GET/mereadThe account, its plan and what the key may do
PATCH/meaccountTurns the weekly email on or off
GET/me/weekly-emailreadThe email you would get on Monday
GET/sitesreadYour sites
POST/sitesaccountAdds a site
GET/sites/:sitereadOne site, with install details
PATCH/sites/:sitechangeSets the time zone
DELETE/sites/:siteaccountDeletes a site and its statistics
GET/sites/:site/verifyreadChecks the install
GET/sites/:site/ad-blockersreadHow to count visitors with ad blockers
POST/sites/:site/ad-blockerswriteUses an own subdomain, {"host"}
DELETE/sites/:site/ad-blockerswriteStops using the own subdomain
GET/sites/:site/summaryreadOne sentence and the totals
GET/sites/:site/insightsreadHeadline, unusual changes and question cards
GET/sites/:site/reports/:reportreadOne report
GET/sites/:site/exportread, PlusReports as CSV
GET/campaign-placesnoneWhere campaign links can be used
GET/sites/:site/campaign-linkreadMakes a campaign link
GET/sites/:site/goalsreadGoals
GET/sites/:site/goal-ideasreadSuggested goals
POST/sites/:site/goalschangeAdds a goal
DELETE/sites/:site/goals/:goalchangeRemoves a goal
GET/sites/:site/funnelsreadSaved funnels
POST/sites/:site/funnelschangeSaves a funnel
DELETE/sites/:site/funnels/:funnelchangeRemoves a funnel
GET/sites/:site/share-linksreadShare links
POST/sites/:site/share-linkschangeMakes a share link
DELETE/sites/:site/share-links/:linkchangeTurns a share link off
GET/shared/:tokennoneA shared site
GET/shared/:token/summary, /insights, /reports/:reportnoneReports of a shared site
GET/keysaccountAPI keys
POST/keysaccountMakes an API key
DELETE/keys/:keyaccountTurns an API key off
GET/sites/:site/eventsread, PlusWhat happened, newest first
GET/webhooksread, PlusWebhooks
POST/webhookschange, PlusAdds a webhook
PATCH/webhooks/:webhookchange, PlusChanges a webhook, or turns it on or off
DELETE/webhooks/:webhookchangeStops a webhook
GET/webhooks/:webhook/deliveriesread, PlusThe delivery log
GET/sites/:site/alertsreadAlerts and the kinds there are
POST/sites/:site/alertschange, PlusTurns an alert on, or changes it
DELETE/sites/:site/alerts/:alertchangeTurns an alert off
GET/sites/:site/revenuereadShop connections
POST/sites/:site/revenuechangeConnects a shop or payment platform
DELETE/sites/:site/revenue/:providerchangeDisconnects a shop
GET/sites/:site/benchmarksread, PlusYour numbers next to sites like yours
GET/sites/:site/askreadSuggested questions and questions left
POST/sites/:site/askreadAsks a question

#More endpoints

The tables on this page cover the endpoints most agents need. The API has more, one group per feature, and every one of them, with its parameters and answers, is in openapi.json:

FeatureEndpointsSee
Billing and the Plus trial/billing, /billing/checkout, /billing/trial, /billing/cancel, /billing/withdrawPlans
Give a month, get a month/me/friendPlans
Team/team, /team/:personSites and settings
Partner program/partnerPartner program
Marketing/sites/:site/marketing, /sites/:site/ad-accounts, /sites/:site/ad-costs, /sites/:site/ad-budgets, /sites/:site/ad-link-testMarketing
What gave the result/sites/:site/attribution, /sites/:site/goals/:goal/journeyFunnels and paths
Goals/sites/:site/goal-targets, /sites/:site/event-labels, /sites/:site/funnel-ideas, /sites/:site/plan, /sites/:site/plan/kindGoals
A/B tests/sites/:site/experimentsA/B tests
Occasions and changes/sites/:site/occasions, /sites/:site/occasions/notes, /sites/:site/impact, /sites/:site/whyOccasions
Segments and views/sites/:site/segments, /sites/:site/views, /sites/:site/metrics, /sites/:site/compare, /sites/:site/patterns, /sites/:site/exploreSegments, views and more
Integrations/sites/:site/google, /sites/:site/bing, /sites/:site/imports, /sites/:site/crm, /sites/:site/email-appsIntegrations
Background agent and autopilot/sites/:site/findings, /sites/:site/agent, /sites/:site/autopilot, /sites/:site/autopilot/proposals/:proposalBackground agent
Private pages and heat maps/sites/:site/private-pages, /sites/:site/heatmaps, /sites/:site/forecastsTracker
Agencies/clients, /clients/:client, /portfolioAgencies and clients
Change log/changes, /changes/:change/undoChange log
Install help/sites/:site/install-email (signed in on okidoki.sh only)Install Okidoki

#Start

#POST /start

Creates an account, adds a site and returns a key that can read and change, in one call. Made for agents setting Okidoki up for a person. No key needed.

FieldRequired
emailYesThe person's email
siteNoThe site address. Also accepted as domain or url
timezoneNoLike Europe/Stockholm. Defaults to UTC
Terminal
curl -X POST https://okidoki.sh/api/v1/start -H "Content-Type: application/json" \
  -d '{"email":"you@example.com","site":"mysite.com","timezone":"Europe/Stockholm"}'

The answer has data.api_key (keep it secret), data.site with install details, data.claim_url for the person, and data.next_steps. If the email already has an account, the answer is 409 account_exists: ask the person to sign in and make a key instead. See Set up with an agent.

#Account

#GET /me

The account's email, plan, number of sites and passkeys, whether the weekly email is on, and what the key may do in data.access.

#PATCH /me

JSON
{ "weekly_email": false }

#GET /billing

The plan, and the questions to Okidoki AI: monthly, left_this_month, extra, left and resets_at.

#GET /me/passkeys

The passkeys on the account. Removing a passkey and closing the account can only be done signed in on okidoki.sh, in Settings → Account.

#GET /me/weekly-email

The email the account would get next Monday, with subject, text and html.

#Sites

#GET /sites

Every site the key can see. Each site has id, domain, site_key, timezone, created_at and install.

#POST /sites

JSON
{ "domain": "mysite.com", "timezone": "Europe/Stockholm" }

Returns the site with 201. The message holds the install sentence. Errors: bad_domain, bad_timezone, site_limit (the plan has no room), site_exists, site_taken (another account has it).

#GET /sites/:site

One site. Its install holds everything needed to install Okidoki:

FieldWhat it is
script_tagThe tag for <head>
reactHow to use the React component
tag_managerThe same tag as a few lines of script for Google Tag Manager's Custom HTML, which strips data-* from a plain tag
agent_promptThe sentence for a site builder: the tag, an allowance in any Content Security Policy, a line in AGENTS.md, and a request to publish or deploy
agent_prompt_policyThe same sentence, which also adds a line about Okidoki to the site's privacy policy. Use it only when the person asks for the line
privacy_policyThe optional privacy policy sentence, as text, markdown and html, with a note on how to offer it
one_clickBuilders where signing in there puts the tag on the site
ad_blockersWhere to read how to count visitors with ad blockers

#PATCH /sites/:site

JSON
{ "timezone": "America/New_York" }

#DELETE /sites/:site

Deletes the site and all its statistics. It cannot be undone.

#Check the install

#GET /sites/:site/verify

Says whether Okidoki counts visits, and if not, what to do.

data.statusMeaning
workingA visit arrived in the last 24 hours
quietVisits arrived before, but none in the last 24 hours
waitingNo visit yet

When it is not working, Okidoki opens the home page and says in the message whether the tag was found, and data.page has reachable and tag_found. See Check that it works.

#Ad blockers

#GET /sites/:site/ad-blockers

How to load Okidoki from the site's own address, so ad blockers let it through. data.own_address is the subdomain with status (waiting or ready), the DNS records to add and the new script_tag, or null. data.suggested_host is a good name for it. data.proxy has the path, the script_tag, an agent_prompt for a builder and recipes for Next.js, Vercel, Netlify, Cloudflare and Node. See Count visitors with ad blockers.

#POST /sites/:site/ad-blockers

Body {"host": "x7f3k.mysite.com"}, or empty for the suggested name. Answers like the GET, with the record to add. 400 bad_host for a name outside the site or one ad blockers block everywhere, like stats.. Okidoki never changes DNS: add the record yourself, then GET again until status is ready.

#DELETE /sites/:site/ad-blockers

Stops using the subdomain. Put the okidoki.sh tag back on the site first.

#Reports

All report endpoints take period, from, to, compare, limit and the filters. See API basics. On Free, a period reaching further back than 12 months is cut at the limit and the answer has history_from and history_note; a period entirely before it is 402 history_limit.

An API key can ask 20 questions a month on Free and 2,000 on Plus. Reads of reports (summary, insights and reports together) within 3 minutes of the read that began a question are part of it. The count starts again on the 1st (UTC); after that the answer is 429 agent_read_limit, unless a pack of extra questions has some left. The dashboard is never counted.

#GET /sites/:site/summary

One sentence about the period and the totals. Start here for how is my site doing?.

#GET /sites/:site/insights

What the top of the dashboard shows: headline, unusual (warnings and changes, up to four sentences), warnings (what broke, each with key, severity, message and often path, empty when nothing broke) and cards, each with a question, an answer, a trend, a tip and a few numbers.

#GET /sites/:site/reports/:report

:report is one of overview, pages, sources, locations, technology, events, videos, goals, revenue, deals, health, realtime, search, bing, paths, funnels, customers, campaigns, reconcile, patterns, calendar, business, forecast, uptime, notfound, speed, sitesearch, heatmap, forms, budgets, impact, metrics, rhythm.

ReportLists in data
overviewtotals, previous, change, timeseries
pagespages, entry_pages, exit_pages, read_to_end, average_scroll_pct, reading, site_search
sourceschannels, sources, campaigns, utm_sources, utm_mediums, ai_assistants, ai_crawlers
locationscountries, regions, languages
technologydevices, browsers, operating_systems, load_time
eventsevents, each with name, label, count, per_100_visitors and top_targets
goalsgoals, each with completions and the share of visitors, now and before
healthwarnings, not_found, errors, rage_clicks, load_time. See Warnings
pathsWith page: views, next, previous, left_site, left_site_share, arrived_from_outside. Without: steps (the most common page pairs)
funnelsfunnels, each with name, steps (views, from_previous, went_on, reached) and whole_way. Add steps=/pricing,/signup to count any funnel without saving it
revenuetotals (revenue, orders, average_order, revenue_per_visitor and the period before), currencies, channels, sources, campaigns, landing_pages, shops. On Plus, channels, sources and landing pages also have visitors and per_visitor: the row's orders over the row's visitors on the same days, renewals left out, null under 10 orders or 100 visitors. per_visitor explains the rules.
customersPlus. totals, months, channels and subscriptions for customers who buy again, and value: what customers actually paid in their first 90, 180 and 365 days (days_90, days_180, days_365 with customers, average and median), in total and per first-order channel. Averages are null under 30 customers. Each channel's estimate is first orders per visitor over the last 90 days times its 180-day value.

Every report also has period and filters. Rates like bounce_rate are between 0 and 1. Times are in milliseconds.

Terminal
curl -H "Authorization: Bearer oks_..." \
  "https://okidoki.sh/api/v1/sites/mysite.com/reports/sources?period=last_month&limit=20"

#GET /sites/:site/export

Plus. report is all (the default) or one report. Returns a CSV file; add format=json to get file and csv inside JSON. See Export.

#GET /campaign-places

The places a campaign link can be made for, with the utm_source and utm_medium each uses.

ParameterRequired
placeYesOne of the places, like meta_ads or newsletter
campaignYesLike spring sale. Turned into spring-sale
pageNoA path, like /pricing. Defaults to /
sourceFor otherWhere, like partner-blog
contentNoTo tell ads apart, like video

Returns url and the tags. Nothing is stored. See Campaign links.

#Goals

#GET /sites/:site/goals

The site's goals, each with id, name, kind (page, event or engaged), match and target.

#GET /sites/:site/goal-ideas

Up to six goals worth tracking, from what visitors did in the last 30 days, then the engagement goals (engaged with read, time or pages), each with how often it happened. All ready to add.

#POST /sites/:site/goals

Give name and one of page, event or engaged:

JSON
{ "name": "Reached /thanks", "page": "/thanks" }
JSON
{ "name": "Downloaded the guide", "event": "download", "target": "/guide.pdf" }
JSON
{ "name": "Stayed over a minute", "engaged": "time", "seconds": 60 }

A page ending in * matches every page below it. target is optional: for an event its target, for engaged the page or section it must happen on, like /blog/*. engaged is read (scrolled to the end and stayed 15 seconds), time (on screen for seconds, 10 to 1800, 60 when left out) or pages (went on to another page, once per visit). A site can have 10 goals. Errors: bad_goal, goal_exists, goal_limit.

#DELETE /sites/:site/goals/:goal

Removes the goal. Get its id from the goals list.

#Funnels

Paths and funnels are counted as page pairs. Each page view knows only the page on your site right before it, so nobody is followed: a funnel counts how many went straight from one step to the next, and whole_way is an estimate made from those steps.

#GET /sites/:site/funnels

The site's saved funnels, each with id, name and steps.

#POST /sites/:site/funnels

Give 2 to 5 paths in order, as a list or comma separated. name is optional.

JSON
{ "name": "Pricing to signup", "steps": ["/pricing", "/signup", "/welcome"] }

A path ending in * matches every page below it. A site can have 10 funnels. Errors: bad_funnel, funnel_exists, funnel_limit.

#DELETE /sites/:site/funnels/:funnel

Removes the funnel. Get its id from the funnels list.

Active share links, each with id, url (the page) and api (the read-only API address).

#POST /sites/:site/share-links

Makes a new link and returns it with 201.

Turns the link off. It stops working at once.

#GET /shared/:token

No key needed. The shared site's domain, time zone and reports. Revenue is never shared. Then use /shared/:token/summary, /shared/:token/insights and /shared/:token/reports/:report, with the same parameters as the signed-in endpoints.

#Alerts

Plus, to turn on. See Alerts.

#GET /sites/:site/alerts

The alerts that are on, each with id, kind, name, goal, days, email, chats (the chat channels that also get it), slack and last_fired_at, and the kinds there are.

#POST /sites/:site/alerts

Field
kindspike, quiet or goal
goalFor goal: the goal's id or name
daysFor goal: 1 to 30. Defaults to 3
emailtrue (the default) or false
chat_urlOptional incoming webhook address from Slack, Microsoft Teams or Discord. It becomes a chat channel for this site that gets this alert. slack_url works too

Sending the same kind again changes the alert that is on. An alert needs email or a chat channel, or both.

#DELETE /sites/:site/alerts/:alert

Turns the alert off.

#Events and webhooks

Plus. The full guide, with signature checks in Node.js and Python, is Webhooks.

#GET /sites/:site/events

What happened on a site, newest first, kept 90 days: traffic jumps, a day without visitors, sales, goals reached or gone quiet, and the Monday check-in.

Parameter
sinceOnly after this time, like 2026-11-10T08:00:00Z. Defaults to 7 days ago
typeOnly this kind of event
limit1 to 100. Defaults to 20
cursornext_cursor from the page before
Terminal
curl -H "Authorization: Bearer oks_..." "https://okidoki.sh/api/v1/sites/mysite.com/events?since=2026-11-13T00:00:00Z"

An agent that checks in on a schedule keeps the time of its last check and passes it as since.

#POST /webhooks

Adds a webhook. Body: url (https), and optionally events (a list, or comma separated), site and label. The answer has the secret, shown once.

#PATCH /webhooks/:webhook

Changes url, events or label. {"on": true} turns a webhook that stopped after failures on again and sends at once; {"on": false} pauses it.

#GET /webhooks/:webhook/deliveries

Every attempt to send, newest first, for 30 days, with limit and cursor. POST /webhooks/:webhook/deliveries/:delivery/retry sends one again. POST /webhooks/:webhook/rotate-secret makes a new secret; the old one signs too for 24 hours.

#Chat channels

Plus. Alerts, sales and the Monday check-in as a message in Slack, Microsoft Teams or Discord. See Alerts.

#GET /chat-channels

The channels, each with id, kind (slack, teams or discord), address (only its last characters), site (all or a domain), events, label, on and last_sent_at, and the events there are. The full address is never shown.

#POST /chat-channels

Field
urlThe incoming webhook address from Slack, Teams or Discord
eventsOptional, comma separated or a list: traffic_spike, quiet_day, goal_quiet, sale, goal_reached, weekly_brief, or all. Defaults to all but goal_reached
siteOptional. Only this site; leave out for all sites
labelOptional, like #marketing

Okidoki sends a first message right away. If the chat does not take it, nothing is saved and the answer says why (chat_failed). The address is stored encrypted.

#PATCH /chat-channels/:channel

Change events or label.

#POST /chat-channels/:channel/test

Sends a test message and says whether it arrived (data.ok). A test that works turns a channel on again after it failed too many times in a row.

#DELETE /chat-channels/:channel

Stops sending to the channel.

#Revenue

Connecting works on every plan; Free reads the last 30 days in total and by channel. See Revenue.

#GET /sites/:site/revenue

The connected shops, each with provider, webhook_url, ready, last_order_at and the steps to finish.

#POST /sites/:site/revenue

Send {"provider":"stripe"}, or any other platform from Revenue, to start: the answer has the webhook address and the steps. Send it again with secret, the signing secret from the shop, to finish. Stripe secrets start with whsec_.

#DELETE /sites/:site/revenue/:provider

Disconnects the shop. Orders already received stay in the report.

#Benchmarks

#GET /sites/:site/benchmarks

Plus. Your last 30 days next to the median of sites of a similar size. Until 1,000 sites use Okidoki, data.enabled is false. See Benchmarks.

#API keys

#GET /keys

Active keys, with label, preview, access, site, created_at and last_used_at. Never the secret.

#POST /keys

Field
siteOptional. Limits the key to one site
accessread (the default) or write
labelOptional name, up to 80 characters

The secret is in data.secret, only in this answer.

#DELETE /keys/:key

Turns the key off. It stops working at once. Use current as the key to turn off the key the request is made with, for example after an app has used a key from a sign-in once.

#Okidoki AI

#GET /sites/:site/ask

Suggested questions that fit the site (suggestions), how many questions are left (questions), and whether questions are switched on (available).

#POST /sites/:site/ask

JSON
{
  "question": "Which campaign brought the most visitors last month?",
  "history": [{ "question": "How many came last week?", "answer": "312 visitors came..." }]
}

history is optional, for follow-up questions; the last 3 turns are used. The answer is in message and data.answer, with the reports it read and the questions left. A question that fails with 502 ask_failed is not counted. See Okidoki AI.