Account
Check your profile and balance, manage API keys, read usage logs, view pricing and plans, and start a purchase or subscription.
The account endpoints cover the business side of the API: who a key acts as, how many credits the workspace has, which API keys exist, what has been spent, what credits and plans cost, and how to pay. None of them costs credits. They are the same endpoints the RankParse dashboard uses.
Every route here except Get pricing authenticates with the normal X-API-Key header. See Authentication.
Operations
| Operation | Route | Who can call it |
|---|---|---|
| Get profile | GET /v1/me | Any key |
| Get credit balance | GET /v1/credits | Owner, admin, member |
| List usage | GET /v1/usage | Owner, admin, member |
| Get pricing | GET /v1/pricing | Anyone, no key |
| List API keys | GET /v1/keys | Owner, admin, member (members see only their own keys) |
| Create an API key | POST /v1/keys | Owner, admin, member |
| Revoke an API key | DELETE /v1/keys/:id | Owner, admin, member (members revoke only their own keys) |
| Buy credits | POST /v1/checkout | Owner, admin |
| Start a subscription | POST /v1/subscription/checkout | Owner |
| Open the billing portal | POST /v1/subscription/portal | Owner |
Keys, people and workspaces
An API key belongs to a workspace and acts as the person who created it, with that person's role in the workspace. Credits, usage and keys are all workspace-wide. A role that is not allowed an action gets 403 capability_missing:
{
"error": "Forbidden",
"code": "capability_missing",
"message": "Your role in this workspace does not allow this action"
}A client role (a report login) can call Get profile, which then shows credits: null, and nothing else on this page.
Two credit buckets
A workspace can hold two kinds of credits:
- Purchased credits come from credit packs (and the legacy lifetime deal). They never expire.
- Plan credits are the monthly quota of a Pro or Agency subscription. Each grant replaces the previous one rather than adding to it, they expire at the end of the period, and they are spent first.
credits in every response is the total you can spend now. Get credit balance also returns the split. Credit packs stay available on every plan.
Dashboard only
Some account actions have no API: changing auto recharge or the monthly spend cap, saving a card, connecting integrations, inviting teammates and the affiliate payout screens. Do those from the dashboard.
These account routes do not answer an API key: the team routes under /v1/internal/team and the other /v1/internal/* routes are signed calls from the RankParse web app only.
Errors shared by every route
| HTTP | Code | When |
|---|---|---|
| 401 | invalid_api_key | Missing, invalid or revoked API key. |
| 403 | capability_missing | Your role in the workspace does not allow the action. |
See Errors for the error body format. These routes are not counted against the 60 requests per minute data endpoint limit, but keep polling modest.
Get profile
GET /v1/me: the person a key acts as and the balance.
Get credit balance
GET /v1/credits: total, plan and purchased credits.
List usage
GET /v1/usage: the workspace request log.
Get pricing
GET /v1/pricing: credit tiers and plans.
List API keys
GET /v1/keys: active keys, masked.
Create an API key
POST /v1/keys: the raw key is shown once.
Revoke an API key
DELETE /v1/keys/:id: immediate and final.
Buy credits
POST /v1/checkout: a Stripe Checkout link for a credit pack.
Start a subscription
POST /v1/subscription/checkout: Pro or Agency.
Open the billing portal
POST /v1/subscription/portal: cancel, change card, invoices.