Errors & rate limits

When a request fails, the Ranksy API returns a consistent error envelope alongside an appropriate HTTP status code. The code is a stable, machine-readable string you can branch on; the message is human-readable and may change.

Error envelope

Every error response wraps a single error object. The type groups related codes (for example invalid_request_error or authentication_error); code is the specific, stable identifier; message explains what happened; param (when present) names the first offending field; and doc_url links to this reference, anchored at the failing code.

  • Name
    type
    Type
    string
    Description

    The error category: invalid_request_error, authentication_error, payment_required_error, permission_error, integration_error, rate_limit_error, or shopify_error.

  • Name
    code
    Type
    string
    Description

    The stable, machine-readable error code (see below).

  • Name
    message
    Type
    string
    Description

    A human-readable description. Do not parse this.

  • Name
    param
    Type
    string
    Description

    Present when one parameter caused the error: the first failing field on validation errors, or the path or query parameter a code names (for example app on the integration errors).

  • Name
    doc_url
    Type
    string
    Description

    Link to the documentation for this code: https://api.ranksyapp.com/errors#{code}.

Error response

{
  "error": {
    "type": "invalid_request_error",
    "code": "validation_failed",
    "message": "end_date must be greater than or equal to start_date.",
    "param": "end_date",
    "doc_url": "https://api.ranksyapp.com/errors#validation_failed"
  }
}

Error codes

Each code below has an anchor matching its code string, so doc_url (https://api.ranksyapp.com/errors#{code}) links straight here.

422invalid_request_error

validation_failed

One or more query parameters or body fields are invalid — a malformed date, end_date earlier than start_date, an out-of-range per_page, an unknown granularity, a task assignee outside your team, and so on. The param field names the first failing field.

400invalid_request_error

unknown_metric

The metric name in the path is not one Ranksy serves. Each metric has its own route, listed on Metrics.

400invalid_request_error

unsupported_basis

The basis query parameter is not valid for a churn metric. subscription_churn_rate, gross_revenue_churn_rate, net_revenue_churn_rate and the aliases churn_rate and revenue_churn_rate accept only real_churn in v1; any other value is rejected. param is basis.

400invalid_request_error

invalid_basis

The basis query parameter is not one the ltv metric supports. Pass month (the default) or year. param is basis and the message lists the supported values.

400invalid_request_error

unsupported_filter

A filter query parameter (plan, billing_interval, install_status, status) was supplied to a metric that cannot honor it. Ranksy never silently ignores a filter — the request is rejected and param names the offending filter.

401authentication_error

missing_api_key

No API key was supplied, or the key is malformed, unknown, revoked, or expired, or its team no longer exists, or the member who created it is no longer on the team. Send a valid key as Authorization: Bearer rk_live_….

401authentication_error

missing_team_scope

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_key instead, so you should rarely see this code.

422invalid_request_error

team_missing

The authenticated account has no team, so the request cannot be clamped to one. Unlike missing_team_scope (which is about an API key without a team), this is the account itself missing a team — join or create a team before calling the API.

402payment_required_error

subscription_required

The REST API requires an active Ranksy subscription and this team has none — a lapsed subscription, or a trial that expired without converting. Only the ingestion writes (/identify, /track, /capi) still work; every other request, read or write, needs an active plan. Subscribe to re-enable the key.

403permission_error

insufficient_permissions

The key is valid, but the request needs a team permission that the key does not carry, or that the member who created the key no longer holds. Ranksy checks both on every request. The message names the permission, for example This endpoint requires the 'revenue.churn' team permission, on the API key and on the member who created it. When the endpoint accepts either of two permissions, the message names both, joined by or. See Permissions for the permission each 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"
  }
}

To fix it, ask the team owner to grant the member the permission in Team Settings → Members → Permissions, or, if the member already holds it, create a key that carries it.

The same code covers two other cases:

  • A key created before permissions that lacks the scope the endpoint requires. The message names the scope, for example This API key is missing the 'metrics:read' scope. Create a new key with the permissions you need.
  • An OAuth token from an MCP client, such as Claude, sent to /api/v1. The message is OAuth client tokens cannot access /api/v1. Use a Ranksy API key.
403permission_error

insufficient_scope

The Ranksy user the request runs as is not allowed to make this change. Customer tag writes (POST, PUT, and DELETE on /apps/:app/customers/:installation/tags) return it when that user has no CRM access on the app's team. An rk_ API key runs as the member who created it, and those routes check crm.access first and return insufficient_permissions without it, so you should rarely see this code.

404invalid_request_error

resource_not_found

A resource named in the path or a query parameter does not exist or is not tracked for this app — for example a keyword, a category, a customer, a listing improvement, or a catalog app or category handle. The request is well-formed but there is no data for that value; param names the offending parameter.

404invalid_request_error

tag_not_attached

DELETE /apps/:app/customers/:installation/tags/:name named a tag that is not attached to this customer, so there is nothing to remove. param is name.

404invalid_request_error

shop_not_identified

The /capi endpoint received a myshopify_domain with no installation for this app. /capi only enriches an existing installation — call /identify for the domain first. param is myshopify_domain.

409integration_error

partner_integration_not_connected

The app's Shopify Partner integration has not been connected, so no partner metrics can be served. Connect it in Ranksy settings. param is app.

409integration_error

partner_integration_unauthorized

The app's Shopify Partner integration was rejected or its authorization was revoked. Reconnect it in Ranksy. param is app.

409integration_error

partner_integration_pending

The app's Shopify Partner integration is still initializing. The first sync has not completed yet; retry once it finishes. param is app.

409integration_error

bigquery_integration_not_connected

The app's GA4 BigQuery export has never been connected, so traffic and install analytics cannot be served. Connect it in Ranksy settings. param is app.

409integration_error

bigquery_integration_unauthorized

BigQuery rejected Ranksy's credentials for this app (permission revoked or rotated). Reconnect the integration to resume syncing traffic and install data. param is app.

409integration_error

bigquery_integration_pending

The app's BigQuery integration is still initializing — the first sync has not imported data yet. Retry in a few hours. param is app.

409invalid_request_error

ai_generation_running

POST /apps/:app/listing/improve was called while your team already has an AI generation running. Wait for it to finish, then start the next one.

422shopify_error

shopify_token_invalid

The Shopify access token provided to the /identify endpoint is invalid, expired, or has been revoked. Generate a new token and retry.

422invalid_request_error

app_events_token_expired

The app_events_token supplied to /track is a JWT whose exp claim is already in the past, so Shopify would reject the forward with a 401 Token has expired. Ranksy checks expiry up front: the call is rejected and nothing is recorded or forwarded. Mint a fresh token with the client_credentials grant (see Track events) — App Events tokens live 60 minutes. param is app_events_token.

429rate_limit_error

too_many_requests

You exceeded the per-minute request limit. Wait for the number of seconds in the Retry-After header, then retry. See Rate limits below for the window and headers.

429rate_limit_error

quota_exceeded

Your team has spent its monthly billable-request quota for the current billing cycle. Only reads count toward it — ingestion writes (/identify, /track, /capi) and usage read-backs (/usage-events, /usage-metrics) keep working past a spent quota. Upgrade your plan for a higher ceiling, or wait for the cycle to reset. See Plan quota and metering.

429rate_limit_error

ai_quota_reached

POST /apps/:app/listing/improve was called after your team used all the AI generations its plan includes for the current billing cycle. This is separate from quota_exceeded (the API request ceiling). The count resets when the next cycle starts; upgrade your plan for more.

422invalid_request_error

tracked_keyword_quota_exceeded

Tracking these keywords would exceed the app's tracked-keyword allowance for your plan. This is a per-app product limit, distinct from quota_exceeded (the billable-request ceiling). The message reports the remaining headroom; untrack keywords or upgrade to make room, then retry with a smaller batch.

502shopify_error

shopify_api_error

The Shopify Admin API returned a server error or is unreachable when called by the /identify endpoint. Ranksy does not retry; the caller should retry with exponential backoff.


Rate limits

Requests are rate-limited per app on a single one-minute window:

  • Name
    Per minute
    Type
    120 requests
    Description

    A limit of 120 requests per minute, applied independently to each app you track — one busy app never eats into another's budget.

Endpoints with an app in the path count toward the window of that app. Endpoints with no app in the path (/me, /apps, the health check, and the catalog endpoints) share one window per team. The ingestion writes /identify, /track, and /capi are not rate-limited, because your app calls them on every merchant page view. POST /apps/:app/listing/improve has a second limit of 10 requests per minute per team. There is no daily limit: sustained volume is capped by your monthly plan quota instead.

Responses carry X-RateLimit-Limit and X-RateLimit-Remaining headers so you can track your remaining budget:

Rate-limit headers

X-RateLimit-Limit: 120
X-RateLimit-Remaining: 117

When you exceed the limit, the API responds with 429 Too Many Requests (too_many_requests), a Retry-After header with the number of seconds to wait, and an X-RateLimit-Reset header with the Unix time at which the window resets:

429 response headers

HTTP/1.1 429 Too Many Requests
Retry-After: 12
X-RateLimit-Reset: 1716998400

Plan quota and metering

The rate limit above is a burst guard applied per app, and its 429 carries a Retry-After. Separately, each billing cycle your team has a monthly quota of billable requests set by your plan — the same number as your MCP request quota, but counted separately from it. Spending it returns 429 quota_exceeded (documented above); the fix is a higher plan or the next cycle, not a short wait.

Only reads count. A billable request is any GET (or HEAD), including the health check, except the usage read-backs below. Everything else is free and never decrements your quota:

  • Name
    Ingestion writes
    Type
    never metered
    Description

    POST /identify, POST /track, and POST /capi are your own backend pushing data into Ranksy — /track fires on every merchant page view. Metering them would bill you for feeding us data, so they keep working even after your read quota is spent. A quota stop never severs your event stream.

  • Name
    Usage read-backs
    Type
    never metered
    Description

    GET /usage-events and GET /usage-metrics return only your own /track data, so reading your own events back is free too.

When your team spends its cycle quota, further reads return 429 quota_exceeded while writes and usage read-backs continue. Upgrade your plan for a higher ceiling, or wait for the cycle to reset.

What counts against your quota

EndpointMethodCounts against quota
Apps, Metrics, Subscriptions, Transactions, LTV cohortsGETYes
Customers, NotesGETYes
Rankings, Traffic & installsGETYes
Reviews, Scorecard, Competitors, Category catalogGETYes
Identify, Track events, Conversion signalsPOSTNo
Usage events, Usage metricsGETNo
Account (/me), Health check (/__ping)GETYes
Notes, tasks, customer tags, keyword tracking, automation enrollment, listing improvement, and ads sync writesPOST / PUT / PATCH / DELETENo