The Upnatus REST API.
Every Upnatus operation over HTTP and JSON: tracking, rankings, AI answers, research, keywords, reports, the advisor. The MCP tools and the CLI run the same operations.
Signing in needs an account with access. A person requests access at upnatus.com/access; an agent cannot request it. Once access is granted, the person signs in at upnatus.com/app, and from there connects agents and creates API keys.
On this page
Base URL and contractAuthenticationFirst runFirst callsTwo-step callsIdempotencyRate limitsCreditsErrorsBase URL and contract
| Base URL | https://api.upnatus.com/v1 |
|---|---|
| Contract | OpenAPI 3.1 at https://api.upnatus.com/openapi.json. It lists paths from /v1 and has no servers entry, so set the host https://api.upnatus.com yourself. |
| Format | JSON in and out; a body is at most 1 MB. Path ids are UUIDs. Every success answers 200. |
| Status | GET /v1/status needs no sign-in and answers {"status":"ok","time":…}. |
The OpenAPI file has more operations than the 126 MCP tools. The others are for a signed-in person in the panel (an API key gets 403 G-HUMAN with the address) or need no sign-in, such as POST /v1/preview. It declares only the main answers of each route; the full list of statuses and codes is under Errors.
Authentication
Send Authorization: Bearer <token> on every call. The token is an API key from Settings → Agents in the panel (the panel calls it a token; it starts with upn_live_; read is always on, ask is on by default, propose is optional), or an OAuth access token. A session cookie is not accepted. Scopes, roles and the rules of keys are on the MCP page.
Without a valid token the API answers 401 unauthenticated (or invalid_token, with WWW-Authenticate). A key of the other region answers 421 wrong_region. A call your scopes do not allow answers 403 G-SCOPE with the missing scope.
First run
- 1Find the business Call
list_clients(GET /v1/clients). Each business has theidthat the other tools take asclient_id. - 2Check what is missing Call
get_setup_statuswith thatclient_id(GET /v1/setup-status?client_id=…).ready: truemeans every step is done. - 3Give a person the next step When
next_actionis set, give itsurlandwhyto the person: only a person pays, connects an account or approves. Then callget_setup_statusagain afterpoll_after_sseconds (30) until that step is done. Awaitkind means nobody has a step: tell the person it is not open yet and do not poll. - 4Fill the profile yourself For each name in
missing_profile, ask the person or read it from the business, then send it withset_profile(scope propose).
curl https://api.upnatus.com/v1/clients \ -H "Authorization: Bearer $UPNATUS_API_KEY"
curl "https://api.upnatus.com/v1/setup-status?client_id=$CLIENT_ID" \ -H "Authorization: Bearer $UPNATUS_API_KEY"
{
"client_id": "3f0c…",
"ready": false,
"steps": [
{ "step": "identity", "done": true },
{ "step": "payment", "done": false },
{ "step": "oauth", "done": true },
{ "step": "profile", "done": false },
{ "step": "approval", "done": true }
],
"missing_profile": ["monthly_budget", "lead_response_channel"],
"waiting_approvals": 0,
"next_action": {
"kind": "payment",
"url": "https://upnatus.com/app/…/billing",
"why": "Upnatus needs a plan. A person starts it on the billing page.",
"resume": "get_setup_status",
"poll_after_s": 30
}
}| Step | Done when | If not done |
|---|---|---|
identity | A person signed in and the organization has a business. | With no business, client_id is null and next_action.url is the start page, where a person adds a website (see "No business yet"). |
payment | The organization has an active paid plan, its trial included: Starter, Pro (the SEO and GEO plans), or a plan with ads. | next_action.kind is payment: give the billing address to the person. |
oauth | An ad account is connected. On a plan without ads it is done by itself. | next_action.kind is oauth: a person connects the account on that page. |
profile | The five facts are set: country, service area, business model, monthly budget, lead channel. | Never a next_action. The agent fills the names in missing_profile with set_profile. |
approval | No change waits for a person. | next_action.kind is approval: waiting_approvals changes wait on that page. |
No business yet.
A key or a sign-in can reach no business yet: list_clients answers {"clients": []} and get_setup_status answers client_id: null with a next_action to the start page. Two ways forward:
- Give the person the
next_action.url. They add the website there and take the free scan. - Or start the free scan yourself with
POST /v1/previewand the body{"domain": "example.com"}. Send it without anAuthorizationheader (a signed-in call answersG-HUMAN) and with anIdempotency-Key. It is a REST call only, not an MCP tool, and it counts 30 a minute per address. The answer is{scan_id, ready, claim_url, next_action}: giveclaim_urlto the person. They sign in, the business joins their organization, andlist_clientsshows it.
curl -X POST https://api.upnatus.com/v1/preview \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"domain":"example.com"}'First calls
Set UPNATUS_API_KEY and CLIENT_ID (an id from /v1/clients) first.
curl https://api.upnatus.com/v1/status
curl "https://api.upnatus.com/v1/clients/$CLIENT_ID/rank-history?weeks=8" \ -H "Authorization: Bearer $UPNATUS_API_KEY"
curl https://api.upnatus.com/v1/clients/$CLIENT_ID/ai-visibility \ -H "Authorization: Bearer $UPNATUS_API_KEY"
curl "https://api.upnatus.com/v1/clients/$CLIENT_ID/spend-estimate?tool=get_domain_overview" \ -H "Authorization: Bearer $UPNATUS_API_KEY"
More routes: GET /v1/clients/{client_id}/tracking, /today, /site-audit, /local-grid, /ai-answers, /ai-referrals, /search-performance, /site-traffic, and GET /v1/credits. Every route, with its parameters and answer, is in the OpenAPI file.
Two-step calls
Three paid calls start work and answer at once; a free GET gives the result. Poll the GET; do not send the POST again.
| Tool (step 1) | Step 1 answers | Read the result with (step 2) | When |
|---|---|---|---|
seed_keyword_ideas · POST /v1/clients/{client_id}/keyword-ideas/seed | {run_id, credits, market}. run_id: null with reused when the same phrases in the same market were asked in the last 30 days: nothing is charged and the stored result is the answer. | get_keyword_research · GET /v1/clients/{client_id}/keyword-research?seeds=… (the same phrases, comma separated, and the same country, language, location_code). selected is null until the result is stored; then selected.tabs holds one list per phrase. | A few seconds. Poll every 5 seconds, at most for 2 minutes. |
ask_keyword_top10 · POST /v1/clients/{client_id}/keyword-top10 | {run_id, credits, market}, or reused as above. | get_keyword_top10 · GET /v1/clients/{client_id}/keyword-top10?keyword=… (same market). found: false until it is stored; then rows holds the ten results and you_position the business. | A few seconds. Poll every 5 seconds, at most for 2 minutes. |
recheck_keywords · POST /v1/clients/{client_id}/keyword-recheck | {run_id, credits, keywords, ready_in_minutes: {from: 45, to: 60}}. Each keyword must be a followed search spelled as in list_tracking, or the call answers 400 not_followed. | get_rank_history · GET /v1/clients/{client_id}/rank-history?keyword=…&granularity=day&days=7. The new place shows as today’s point. No call shows progress. | About 45 to 60 minutes. Read again after 45 minutes, then every 15 minutes. Do not send it again: a second call is a second job and is charged again. |
curl -X POST https://api.upnatus.com/v1/clients/$CLIENT_ID/keyword-ideas/seed \
-H "Authorization: Bearer $UPNATUS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"seeds":["emergency plumber"],"max_credits":12}'
# {"run_id":"…","credits":12,"market":{"country":"US","location_code":null,"language":"en"}}curl "https://api.upnatus.com/v1/clients/$CLIENT_ID/keyword-research?seeds=emergency%20plumber&country=US&language=en" \
-H "Authorization: Bearer $UPNATUS_API_KEY"
# {"searches":[…],"selected":{"id":"…","tabs":[{"seed":"emergency plumber","count":200,"rows":[…]}]},"price":{…}}curl -X POST https://api.upnatus.com/v1/clients/$CLIENT_ID/keyword-recheck \
-H "Authorization: Bearer $UPNATUS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"keywords":["emergency plumber","water heater repair"],"max_credits":6}'
# {"run_id":"…","credits":6,"keywords":2,"ready_in_minutes":{"from":45,"to":60}}curl "https://api.upnatus.com/v1/clients/$CLIENT_ID/rank-history?keyword=emergency%20plumber&granularity=day&days=7" \ -H "Authorization: Bearer $UPNATUS_API_KEY"
Following a run. Every run_id above, and the one send_chat_message returns, can be followed live: GET /v1/runs/{run_id}/events is a server-sent event stream (Accept: text/event-stream, same Bearer key). Events are run.progress, run.partial, run.deferred, run.done and run.failed; it ends after run.done or run.failed. After a drop, send the last event id as Last-Event-ID to resume. It answers 404 for a run of another organization. Polling the free GET is enough when you do not need the steps.
The top 10 works the same way: POST /v1/clients/{client_id}/keyword-top10 with {"keyword":"…","max_credits":1}, then GET /v1/clients/{client_id}/keyword-top10?keyword=… until found is true.
Idempotency
- Every call that writes needs an
Idempotency-Keyheader, 1 to 255 characters. Without it the API answers 422idempotency_key_required; a longer one answers 422idempotency_key_invalid. - The same key with the same body returns the stored answer, with the header
Idempotent-Replayed: true, and does the work once. A repeated paid call is not charged again. - The same key with a different body answers 422
idempotency_key_reused. - Keys are kept for 7 days, per caller (API key, OAuth sign-in or person) and per operation: two callers that send the same value never see each other’s answer.
- Make one key per piece of work and keep it until you have an answer. A new key on a retry is a new call.
- A few answers can be shown only once (a new API key, for example). Their replay answers 409
shown_once: send a new key. - Reads need no key. A research read that spends credits (domain overview, Maps search, branch search, backlinks, AI mentions, brand mentions) takes an optional one: send the same key again after a timeout and the stored answer comes back without a second charge. Without a key each call is a new read. The CLI sends one made from the request.
Rate limits
| Kind of call | Limit |
|---|---|
| Read | 300 a minute |
| Write | 60 a minute |
| Ask (the advisor and paid research) | 30 a minute |
Calls with no sign-in (/v1/preview, /v1/status) | 30 a minute per address |
| Sign-in routes | 20 a minute per address |
| Whole organization, all kinds | 900 a minute |
The limits count per key, OAuth sign-in or person, in fixed one-minute windows, and MCP shares them. Over a limit the API answers 429 rate_limited with the headers Retry-After, RateLimit-Limit, RateLimit-Remaining (always 0) and RateLimit-Reset. The headers come only on that answer. Wait the seconds Retry-After says, then send the same call again.
| 429 code | What it is | What to do |
|---|---|---|
rate_limited | Too many calls this minute. | Wait Retry-After seconds and retry. The only 429 to retry. |
budget_cap | The business used its research data for the month. Nothing was charged. | Do not retry. Tell the person; it opens again when the month turns, or with a bigger plan. |
quota | The advisor’s answers for the month are used (Starter 100, Pro 200). The message gives the date they come back (UTC) and next_action the billing page. | Do not retry. Tell the person; it opens again next month, or with a bigger plan. |
trial_ask_quota | The questions of the trial are used, or the trial ended. | Do not retry. A person starts the plan (get_setup_status gives the address). |
Credits
Tracking comes with the plan and spends no credits: on the current plans rankings and AI questions are checked every 3 days (older plans differ; GET /v1/clients/{client_id}/tracking returns the interval in limits), the site is scanned every week, and the local grid gets up to 450 checks a week (900 with the grid add-on). Research outside that schedule spends credits from the plan’s monthly credits or a top-up. Plans and top-ups are on the pricing page.
Every tool that spends credits, and the advisor, needs an active paid plan on the organization (Starter, Pro, or a plan with ads; a trial counts). Without one the call answers 402 G-ENTITLEMENT before any price check, on every tool and every route, with missing: ["seo.weekly"] (or ask.generate for the advisor and the memory) and a payment next_action. Sending max_credits does not help. Give the person the next_action.url, or call get_setup_status for it.
| Call | Credits |
|---|---|
Check now (recheck_keywords, POST /v1/clients/{client_id}/keyword-recheck) | 3 a search |
Keyword ideas (seed_keyword_ideas) | 1, or 2 with a city |
| Top 10, domain overview, backlinks, Maps search, branch search | 1 each |
| Search suggestions, page check | 1 each |
| Related keywords, link history | 3 each |
| Backlink anchors | 6 |
| Rank history of a site (12 months) | 14 |
| Numbers for saved keywords (up to 500) | 1 |
An advisor answer (send_chat_message) | 1 |
A key or an agent must send max_credits, the most it accepts. Without it, or with less than the price, nothing is spent and the API answers 402 G-COST. GET /v1/clients/{client_id}/spend-estimate?tool=… gives the price first, and GET /v1/credits gives the balance. A paid read also answers balance, the credits left after the charge. Over REST and the CLI, with_city, seed_count and keyword_count cannot be sent yet: a query sends them as text and the call answers 422 invalid_input. Leave them out and work the price out from the table (Check now: 3 × the searches; ideas in a city: 2). Over MCP both work. Research that finds nothing is not charged. The same question asked again within 30 days is answered from storage and not charged; send ask_again: true for a fresh read.
{
"guard": "G-COST",
"message": "recheck_keywords costs 6 credits. Nothing was spent. Balance: 1200. Send max_credits: 6 or more to go ahead.",
"missing": ["max_credits"],
"next_action": { "kind": "approval", "url": "https://upnatus.com/app/…/billing", "why": "Ask the person if this may spend 6 credits. If yes, send the call again with max_credits: 6 or more." }
}{
"guard": "G-COST",
"message": "This needs 6 credits and 2 are available.",
"missing": ["credits"],
"next_action": { "kind": "payment", "url": "https://upnatus.com/app/…/billing", "why": "Add credits to continue." }
}| missing | What it means | What to do |
|---|---|---|
max_credits | The call has no max_credits, or less than the price. Nothing was spent. | Show the person the price, then send the call again with max_credits at or above it. |
credits | The organization has fewer credits than the price. | Give next_action.url to the person. Do not retry until they add credits. |
key_credit_cap | This API key would pass its monthly credit cap (set by a person when the key was made; 50 by default, 0 means the key cannot spend). The cap starts again on the 1st of the month (UTC). | Give next_action.url (Settings → Agents) to the person: only a person can make a key with a higher cap. Do not retry until then. OAuth sign-ins have no such cap. |
Errors
Under /v1 and /mcp every error has the same fields: code, message, missing and next_action, next to the HTTP status. A guard adds guard; any other error adds error with a request_id. The panel’s /auth routes and the OAuth routes under /oauth keep their own shapes.
{
"guard": "G-COST",
"code": "G-COST",
"message": "get_domain_overview costs 7 credits. Nothing was spent. …",
"missing": ["max_credits"],
"next_action": null
}{
"error": { "code": "invalid_input", "message": "…", "request_id": "…" },
"code": "invalid_input",
"message": "…",
"missing": [],
"next_action": null
}{ "message": "…", "code": "…" }{ "error": "invalid_grant", "error_description": "…" }- 1It has "code". A /v1 or /mcp body. Branch on
code, then onmissing. Follownext_actionwhen it is set. - 2It also has "guard". A rule said no.
guardequalscode; a guard may addwho_can. - 3Its "error" is an object. Any other error.
error.coderepeatscode; quoteerror.request_idif you contact us. - 4Its "error" is a string. An OAuth error: read
error_description. - 5It has only "message" and "code". A sign-in route error, for the panel.
| Status | Body | Codes you will see | What to do |
|---|---|---|---|
| 400 | error | invalid_json, not_followed, invalid_market, invalid_engines, over_limit, too_many_new, unknown_keyword | Fix the request. not_followed: send searches spelled as in list_tracking. |
| 401 | error | unauthenticated, invalid_token | Send a valid key or token; renew an OAuth token with its refresh token. |
| 402 | guard or error | G-COST; G-ENTITLEMENT | See Credits: missing says whether to ask the person for a max_credits at or above the price, a person adds credits, or a person starts a plan (G-ENTITLEMENT, the one answer for no paid plan). |
| 403 | guard or error | G-SCOPE, G-ROLE, G-HUMAN, G-STEPUP, G-ENTITLEMENT (a plan without that feature), G-BILLING_TEAM; org_required, person_only, origin_not_allowed, identity_not_allowed | Guards: see the table below. person_only: only a signed-in person can do it. org_required: the credential has no organization. |
| 404 | error | not_found | The id is wrong, or outside what this key reaches (the same answer for both). |
| 409 | guard or error | G-CONN, G-CONNECTION, G-PROFILE, G-STATE, G-STALE and other guards; key_limit, monthly_limit, pending_recheck, shown_once, busy, not_ready, limit_reached, already_tracked | Read message. monthly_limit: wait for the month to turn. pending_recheck, busy, not_ready: wait a minute and try again. shown_once: use a new Idempotency-Key. |
| 410 | error | invite_expired, consent_expired, code_expired, transfer_expired | The link or code ended. Start the step again. |
| 413 | error | payload_too_large | Send a body under 1 MB. |
| 421 | error | wrong_region | The key belongs to the other region. Use a key made in this region. |
| 422 | error or guard | invalid_input, idempotency_key_required, idempotency_key_invalid, idempotency_key_reused, unknown_country, unknown_city, rejected_by_source, too_many_lines; G-CONSENT, G-ACCOUNT | Fix the request. message names the field. A tool takes only the arguments it lists: an argument it does not have is refused, and the message lists the valid ones. A null for an optional argument means "not given". A text with a control character (such as NUL) is refused. |
| 429 | error | rate_limited; budget_cap, quota, trial_ask_quota, invite_limit | Retry only rate_limited, after Retry-After. The others are monthly limits: see Rate limits. |
| 500 | error | internal | Try once more with the same Idempotency-Key; quote the request_id if you contact us. |
| 502 | error | source_unavailable, platform_refused | A data source or ad platform did not answer. Nothing was charged. Try again in a minute. |
| 503 | error | research_unavailable, credits_unavailable, ai_closed, platform_unavailable | That part is closed for now. Nothing was charged. Try again later. |
| Guard | Status | What it means and what to do |
|---|---|---|
G-SCOPE | 403 | The key or sign-in lacks the scope in missing. A person makes a key with that scope, or signs the agent in again with it. |
G-ROLE | 403 | The role is too low; who_can lists the roles that may. A person with that role does it. |
G-HUMAN | 403 | Only a signed-in person can do this. Give next_action.url to the person. |
G-STEPUP | 403 | The person must confirm it is them, in the panel. |
G-BILLING_TEAM | 403 | Only the people who handle billing can do this. |
G-ENTITLEMENT | 402 or 403 | No paid plan (402, next_action opens Billing), or a plan that does not include the feature (403). missing names what (for example seo.weekly). A person starts or changes the plan. While ad features are closed, an ad tool answers 403 with missing: ["ads.open"] and a wait next_action. |
G-COST | 402 | missing: ["max_credits"]: ask the person, then resend with a cap at or above the price (next_action says so). ["credits"]: a person adds credits. ["key_credit_cap"]: the API key spent its credits for the month; a person makes a key with a higher monthly cap. |
G-CONN, G-CONNECTION | 409 | No connected account for this. A person connects one (next_action kind oauth when set). |
G-PROFILE | 409 | Profile facts are missing; send the names in missing with set_profile. |
G-STATE, G-STALE | 409 | The thing changed or is not in a state that allows this. Read it again, then decide. |
Other guards (G-POLICY, G-AUTO, G-PREFLIGHT, G-ASSET, G-UNIT, G-UNIQUE, G-LIMIT, G-QUEUE, G-ACK, G-CONSENT, G-ACCOUNT …) | 409 unless shown | Mostly ads and Autopilot checks. message says why. Change the request or ask the person; do not send it again unchanged. |
next_action is {kind, url, why, resume?, poll_after_s?}. kind is one of identity (a person signs in or adds a business), payment (a plan or credits), oauth (connect an account) and approval (approve or decline changes) and wait (nothing to do now: the url says why, for example that ad features are not open yet). Give url and why to the person. When resume is set (always get_setup_status), call that operation again after poll_after_s seconds to see whether the step is done. A guard may also carry who_can, the roles that may do it.