Skip to content
Ranqo
Docs
DashboardGet started
GuidesMethodologyIntegrationsAPI
Video tutorials

Get started

  • Introduction
  • Quickstart
  • Authentication

Using the API

  • Rate limits
  • Errors
  • Pagination
  • Dates and time zones
  • Versioning

Account

  • Get the account

Brands

  • List brands
  • Get a brand

Visibility

  • Get visibility

Competitors

  • List competitors

Runs

  • List runs
  • Get a run

Prompts

  • List prompts
  • Get a prompt
  • List a prompt's answers

Site Access

  • Get site access

Page audits

  • List page audits
  • Get a page audit

Recommendations

  • List recommendations
  • Get a recommendation

Outreach

  • List outreach targets

5 sections

Get started

API authentication

View as MarkdownOpen this page as .md
ChatGPTOpen in ChatGPTAsk about this pageClaudeOpen in ClaudeAsk about this page

How Ranqo API keys work, where to send them, which brands a key can read, and what happens when a key expires or is revoked.

Every request carries an API key. Keys belong to the account, are created by its owner, and can read only the brands they were given.

Send the key in the Authorization header#

HTTP
Authorization: Bearer ranqo_sk_...

The API reads the key from this header and nowhere else: it ignores cookies, so a signed-in browser session cannot call it. Every key starts with ranqo_sk_, which lets secret scanners recognise one that leaks.

Never put a key in a URL. A request whose address contains a key is refused with api_key_in_url, because URLs end up in server logs and browser history. If that happens with a real key, revoke it and create another.

Creating keys#

The account owner creates keys in the API keys section of Settings; teammates cannot. Each key has:

  • A name, shown in Settings and returned by GET /v1/account, so you can tell keys apart.
  • Brand access: every brand, including ones added later, or only the brands you choose. A brand the key cannot read answers not_found, exactly as a brand that does not exist.
  • An expiry: 30, 90, and 365 days, or never.

The number of active keys depends on the plan (see Rate limits), and an account can create at most 10 keys an hour.

The key is shown once, when it is created. Settings lists it afterwards only in a shortened form: Ranqo stores a fingerprint of the key, not the key.

Revoking a key#

Revoke a key in Settings the moment you stop using it or suspect it leaked. It stops working on the next request. Revoking is always available, even after a plan ends, so an account can switch off a key it no longer pays for.

When a key is refused#

CodeMeaning
missing_api_keyNo Authorization header, or an empty one.
invalid_api_keyThe header does not hold a well-formed Ranqo key, or the key does not exist.
api_key_revokedThe key was revoked.
api_key_expiredThe key has passed its expiry.
api_key_orphanedThe account that owns the key has since joined another team. Ask the team's owner to create a key in their Settings.
plan_upgrade_requiredThe account's plan does not include API access.
subscription_inactiveThe account's trial or subscription has ended.

The first five answer 401 with a WWW-Authenticate header, the last two 403. The plan is read on every request, so a change of plan applies at once.

Repeated failures are limited: after 30 failed attempts in a minute, a key is refused with rate_limited until the minute is over. Attempts with keys that do not exist are also counted by the address they come from, so guessing keys from one address stops quickly without locking out the keys in use there.

Keeping keys safe#

  • Give each tool its own key, restricted to the brands it needs, so revoking one does not break the others.
  • Use an expiry, and replace keys before they lapse.
  • Keep keys on the server. A key in a web page or a mobile app is readable by anyone who opens it.
Previous page: QuickstartNext page: Rate limits
On this page
Ranqo
Docs
Dashboardranqo.aiPrivacyTerms
Be the Source AI Cites.
Ranqo
Docs
GuidesMethodologyIntegrationsAPI

Get started

  • Introduction
  • Quickstart
  • Authentication

Using the API

  • Rate limits
  • Errors
  • Pagination
  • Dates and time zones
  • Versioning

Account

  • Get the account

Brands

  • List brands
  • Get a brand

Visibility

  • Get visibility

Competitors

  • List competitors

Runs

  • List runs
  • Get a run

Prompts

  • List prompts
  • Get a prompt
  • List a prompt's answers

Site Access

  • Get site access

Page audits

  • List page audits
  • Get a page audit

Recommendations

  • List recommendations
  • Get a recommendation

Outreach

  • List outreach targets
Get started