Authentication
Every Ranksy API v1 request is authenticated with an opaque API key sent as a Bearer token. Keys begin with rk_live_ or rk_test_. Each key belongs to exactly one Ranksy team and acts as the team member who created it: you can only reach the apps of that team, with that member's permissions.
Making authenticated requests
Include your key in the Authorization header of every request using the Bearer scheme:
Authorization header
Authorization: Bearer rk_live_xxxxxxxxxxxxxxxxxxxxxxxx
Example request
curl https://ranksyapp.com/api/v1/apps/01JN4HKQX0000000000000000/metrics/mrr \
-H "Authorization: Bearer rk_live_xxxxxxxxxxxxxxxxxxxxxxxx"
Every endpoint needs a key, including the health check, GET /api/v1/__ping. Call it to check that a key works: it returns { "object": "ping", "ok": true }, or 401 missing_api_key when the key is missing, unknown, revoked, or expired.
Getting a key
Any member of a team can create API keys for it. A key can carry only the permissions that its creator holds on the team.
- In Ranksy, open Settings, then API Keys.
- Click Create key.
- Optionally, give the key a Label, for example
Production server. - Choose the Environment: Live or Test. See Live and test keys.
- Choose the key's Permissions. The picker is the same one the team owner uses for members in Team Settings → Members → Permissions, with the same groups and presets. A new key starts with every permission you hold. Permissions you don't hold are shown but can't be selected. Select at least one. See Permissions.
- Optionally, set an Expiry date. Leave it blank for a key that never expires.
- Click Create key, then copy the key. Ranksy shows it only once and stores only a hash of it. If you lose a key, revoke it and create a new one.
Members see the keys they created. The team owner sees every key on the team, with a Created by column. To revoke a key, click the delete icon on its row in API Keys. The member who created a key can revoke it, and so can the team owner. Every request made with a revoked or expired key fails with 401 missing_api_key.
A key belongs to one team and acts as the member who created it. Every request made with it is limited to that team's apps and to what that member may see. If the member leaves the team or is removed from it, their keys stop working and return 401 missing_api_key. The REST API also needs an active Ranksy subscription on the team: without one, every request except /identify, /track, and /capi returns 402 subscription_required. Requests are limited per app per minute, and reads count toward a monthly plan quota. See Rate limits.
/api/v1 accepts Ranksy API keys (rk_live_, rk_test_). It does not accept the OAuth tokens that MCP clients, such as Claude, receive when they connect to Ranksy: a request with one returns 403 insufficient_permissions. Use those tokens with the Ranksy MCP server, and an API key with the REST API.
Live and test keys
The prefix shows which Environment you chose when you created the key:
- Name
rk_live_- Type
- live key
- Description
A key for your production integration.
- Name
rk_test_- Type
- test key
- Description
A key for development. A test key works the same as a live key: it reads and writes the same team data, and its requests count toward the same plan quota. Use the prefix to tell your development keys apart from your production keys.
Permissions
A key carries a set of team permissions, the same permissions a team owner grants to members in Team Settings → Members → Permissions, such as revenue.overview, crm.access, or aso.keywords. Each endpoint requires one or more of them, listed below.
Ranksy checks a permission on every request, against the key and against the member who created it. A request passes only if the key carries the permission and that member still holds it on the team. So a key's access is the intersection of its own permissions and its creator's current permissions:
- When the team owner removes a permission from a member, the member's keys lose it on their next request. You don't need to create the keys again.
- When the team owner gives the permission back, the keys that carry it work again.
- A key never gains a permission it wasn't created with. To add one, create a new key.
When a check fails, the request returns 403 insufficient_permissions. The message names the permission the endpoint requires:
403 — insufficient_permissions
{
"error": {
"type": "permission_error",
"code": "insufficient_permissions",
"message": "This endpoint requires the 'revenue.churn' team permission, on the API key and on the member who created it.",
"doc_url": "https://api.ranksyapp.com/errors#insufficient_permissions"
}
}
The team owner holds every permission, so the owner's keys are limited only by the permissions selected for the key.
Revenue amounts
Endpoints whose rows carry dollar amounts, such as subscriptions, churned customers, or LTV per customer, need a second permission besides the one for their page: revenue.overview or revenue.earnings. A member who can't see revenue figures in Ranksy can't read them through the API either. In the table below, these endpoints are marked + revenue.
Permissions by endpoint
Paths are relative to https://ranksyapp.com/api/v1.
| Endpoint | Required permission |
|---|---|
GET /__ping, GET /me | none |
GET /apps, GET /apps/{app}, GET /apps/{app}/listing, GET /apps/{app}/reviews | none |
Catalog: GET /catalog/*, GET /categories/* | none |
Metrics: mrr, arr, revenue | revenue.overview |
Metrics: ltv | revenue.ltv + revenue |
Metrics: nrr | revenue.nrr |
Metrics: active_trials, trial_conversion_rate | revenue.trials |
Metrics: active_merchants, active_subscriptions | revenue.subscriptions |
Metrics: installs, uninstalls, reactivations, deactivations | revenue.installations |
Metrics: churned_total, subscription_churn_rate, gross_revenue_churn_rate, net_revenue_churn_rate, and the aliases churn_rate, revenue_churn_rate | revenue.churn |
Metrics: usage_revenue | revenue.earnings |
GET /apps/{app}/revenue/overview | revenue.overview |
| Transactions | revenue.earnings |
| Subscriptions, Lifecycle events | revenue.subscriptions + revenue |
| Churn analysis, Churned customers | revenue.churn + revenue |
GET /apps/{app}/active-trials | revenue.trials + revenue |
| LTV cohorts, Customer LTV | revenue.ltv + revenue |
GET /apps/{app}/retention/cohorts | revenue.retention |
Store installs, GET /apps/{app}/uninstall-reasons | revenue.installations |
| Customers, Notes, Tasks, customer tags (reads and writes) | crm.access |
GET /apps/{app}/automations/rules, …/rules/{rule}, …/rules/{rule}/runs, POST …/rules/{rule}/enroll | crm.automations |
| Usage events | crm.access |
| Usage metrics | usage.events (the billed_usage figure needs revenue too) |
Traffic: traffic/sources, traffic/keywords, traffic/overview, traffic/source-trends | traffic.sources |
Traffic: traffic/journey, traffic/funnel, installs, keywords/installs-by-source | traffic.attribution |
Traffic: traffic/attribution | traffic.attribution + revenue |
keywords/cannibalization, keywords/ad-performance | traffic.ads |
Shopify App Store ads: overview, trend, keywords, search-terms, changes | traffic.ads (the revenue and roas fields need revenue too) |
Rankings: rankings, rankings/history, rankings/by-keyword/{keyword} | aso.keywords |
GET /apps/{app}/keywords, keywords/{keyword}/trends, listing/outranked-keywords | aso.keywords |
GET /apps/{app}/keywords/focus, tracking and untracking keywords (POST /apps/{app}/keywords, DELETE /apps/{app}/keywords/{keyword}) | aso.tracked |
Scorecard, Competitors, listing/competitors | aso.competitors |
POST /apps/{app}/listing/improve, GET /apps/{app}/listing/improvements/{id} | ai.access |
Identify, Track events, Conversion signals, POST /apps/{app}/shopify-ads/sync | integrations.manage |
Identify, Track events, Conversion signals, and the ads sync send data in from your app's backend, so they need Manage Integrations (integrations.manage). Give your server's key that permission, and leave it off keys that only read data.
The Ranksy CLI uses the same keys. Each command needs the permission of the endpoint it calls.
Scopes
Keys created before permissions carry scopes instead, such as metrics:read or crm:write. These keys keep working with the access they had: Ranksy gave each one the permissions that cover its scopes, and checks both on every request. An older key with Full access (*) received every permission.
There are 17 scopes. GET /__ping and GET /me need none:
| Scope | What it covers |
|---|---|
apps:read | GET /apps, GET /apps/{app}, listing, listing/competitors, listing/outranked-keywords, GET listing/improvements/{id} |
metrics:read | Metrics and the revenue rows behind them: subscriptions, transactions, revenue/overview, churn, retention/cohorts, ltv/*, uninstall-reasons, active-trials, churned-customers, store-installs, lifecycle-events. Also the revenue and roas fields of the Shopify App Store ads endpoints |
traffic:read | traffic/*, installs, GET keywords, keywords/cannibalization, keywords/ad-performance, keywords/installs-by-source, keywords/{keyword}/trends |
rankings:read | rankings, rankings/history, rankings/by-keyword/{keyword}, keywords/focus |
reviews:read | GET /apps/{app}/reviews |
catalog:read | GET /catalog/*, GET /categories/* |
scorecard:read | scorecard |
competitors:read | competitors |
usage:read | usage-events, usage-metrics |
crm:read | Reading customers, notes, tasks, customer tags, and automation rules and runs |
crm:write | identify, track, writing notes, tasks, and customer tags, and POST automations/rules/{rule}/enroll |
capi:write | capi |
appevents:write | /track calls that carry an event_handle (Shopify App Events and usage events). Without it, /track records only the activity ping, skips the event, and returns shopify_event.status skipped |
keywords:write | POST /apps/{app}/keywords, DELETE /apps/{app}/keywords/{keyword} |
listing:write | POST /apps/{app}/listing/improve |
ads:write | POST /apps/{app}/shopify-ads/sync |
ads:read | shopify-ads/overview, trend, keywords, search-terms, changes |
Keys created with the permission picker carry the wildcard scope *, so only their permissions limit them. If an older key returns 403 insufficient_permissions with a message that names a scope, for example This API key is missing the 'metrics:read' scope., create a new key with the permissions you need.
What can go wrong
Authentication and authorization failures are reported through the standard error envelope:
- Name
401 — missing_api_key- Type
- authentication_error
- Description
The
Authorizationheader is absent, or the key is unknown, revoked, or expired, or the member who created it is no longer on the team.
- Name
401 — missing_team_scope- Type
- authentication_error
- Description
The request reached the API without a key or a team to scope it to, so no apps can be resolved. A key whose team no longer exists fails with
missing_api_keyinstead.
- Name
402 — subscription_required- Type
- payment_required_error
- Description
The team has no active Ranksy subscription. Every request fails except the ingestion writes
/identify,/track, and/capi, which keep working.
- Name
403 — insufficient_permissions- Type
- permission_error
- Description
The key, or the member who created it, lacks a permission that the endpoint requires. The message names the permission. An older key that lacks a scope gets the same code, with a message that names the scope. An MCP OAuth token sent to
/api/v1gets it too.