REST API v1: API keys, authentication and endpoints
How to create an API key, send the Authorization header, the request limits, and every v1 endpoint, with parameters, the response envelope and error codes.
Open this screen in the panelThe REST API v1 lets you do most of what you do in the panel from code: list sites, start crawls, pull issues, open AI fixes, and manage Pixel rules, keywords, content, backlinks, outreach, competitors and social posts. Keys belong to an organization; a key only sees its own organization's data. The MCP server calls the same endpoints.
Prerequisites
- Only the organization's owner or an admin can create and revoke keys. Other roles don't see the API keys tab.
- API access is included in the Pro and Agency plans. If your plan doesn't include it, the tab shows a notice with a See plans link; you may still be able to create a key, but requests return 403
plan_required.
Creating an API key
- Open Settings → Profile → API keys.
- In Key name, describe where the key will be used (at least 2 characters, e.g. "CI").
- If the key needs to start crawls or create fixes, rules, keywords or content, tick write scope. Leave it unticked for a read-only key.
- Click Create key.
- Copy the key that starts with
sa_live_right away with Copy key. It is never shown again; the list only keeps its Prefix.
An organization can have at most 20 active keys. If a key leaks, revoke it immediately with the trash icon (Revoke) in the list. Requests using a revoked key get 401 straight away.
Connections that AI apps set up with OAuth don't appear in this list; they are in the Connected assistants list on the Connect your AI assistant page.
Authentication and base URL
- Base URL:
https://seoasist.com/api/v1 - Header:
Authorization: Bearer sa_live_… - The key is accepted in the
Authorizationheader only; an?api_key=query parameter is not supported (keys in URLs end up in logs).
Scopes: a read key can call every GET endpoint. The write scope unlocks POST, PATCH and DELETE requests. A write request with a read-only key returns 403.
Limits: at most 240 requests per minute per organization, and at most 30 AI fixes per hour (POST /sites/{id}/fixes). Above that you get 429 rate_limited.
curl -H "Authorization: Bearer sa_live_..." \
https://seoasist.com/api/v1/sites
Response envelope
Every successful JSON response looks like this:
{ "ok": true, "data": {}, "ms": 42 }
data holds the endpoint's result and ms is the request time in milliseconds. The one exception is llms.txt, which returns plain text (text/plain). Errors return { "ok": false, "error": "<code>", "message": "…" }.
Endpoints
All paths are relative to the base URL. {id} is a site ID, which you get from GET /sites.
Account and sites
| Method | Path | Scope | What it does |
|---|---|---|---|
| GET | /me | read | The key's organization and scopes: orgId, scopes |
| GET | /sites | read | Lists sites: id, name, domain, url, healthScore, lastCrawlAt, gscProperty, ga4PropertyId, repo, pixelKey … and the Search Console position movement (movement) |
| GET | /sites/{id} | read | Site fields + lastCrawl (id, pages, finishedAt), issueTotals, issue groups (code, severity, title, count), code repos (repos), fix channels (fixChannels) and rising / falling queries |
| GET | /sites/{id}/data-sources | read | The active data source and its state for each data type |
| POST | /sites/{id}/crawl | write | Starts a crawl; returns { crawlId, status: "queued" }. 402 limit_reached when the monthly page quota is used up |
Issues, fixes and rules
| Method | Path | Scope | What it does |
|---|---|---|---|
| GET | /sites/{id}/issues | read | Grouped issues (totals, groups). With ?code= you get that group and sample urls; ?limit= defaults to 200, max 1000 |
| POST | /sites/{id}/issues/{code}/rule-fix | write | Fixes one issue code on every affected URL with rules (needs the Site API, WordPress plugin or Pixel) |
| POST | /sites/{id}/fixes | write | Opens an AI fix (PR / MR job). Body: issueCode or instructions (one is required), optional repo and model. Returns { jobId, status: "queued" } |
| GET | /sites/{id}/fixes | read | The last 50 fix jobs: status, model, repo, prUrl, summary, error … |
| GET | /sites/{id}/pixel/rules | read | Rules |
| POST | /sites/{id}/pixel/rules | write | Adds a rule. Body: kind, matchType (default exact), matchPath (default /), payload, optional note |
| DELETE | /sites/{id}/pixel/rules/{ruleId} | write | Deletes the rule; { deleted: true } |
Keywords and content
| Method | Path | Scope | What it does |
|---|---|---|---|
| GET | /sites/{id}/keywords | read | avgPosition, buckets and keywords (position, prevPosition, change, best, url, volume, kd, intent, aiOverview, aiCited …) plus Search Console movers |
| POST | /sites/{id}/keywords | write | Body: { keywords: string[] } (max 200 per request). Returns { added }; keywords already tracked are skipped |
| GET | /sites/{id}/keywords/opportunities | read | The keyword pool with an opportunity score (0–100) and action (new / strengthen); ?limit= defaults to 50, max 300 |
| POST | /sites/{id}/keywords/ideas | write | Body: { keywords: string[], note? } (2–60 keywords). Clusters the keywords and creates blog ideas with status idea |
| GET | /sites/{id}/content | read | The last 100 content items; filter with ?status= |
| POST | /sites/{id}/content | write | Creates a blog idea. Body: title (required), targetKeywords?, angle?, generate? (true queues the writing) |
| GET | /sites/{id}/content/{itemId} | read | One content item with all its fields (including HTML) |
| PATCH | /sites/{id}/content/{itemId} | write | Edits a blog post that isn't live: title, html, faq, metaTitle, metaDescription, excerpt, slug, targetKeywords. An approved or scheduled post goes back to review. Page rewrites and live posts return 422 / 409 not_editable |
| POST | /sites/{id}/content/{itemId}/approve | write | Approves it. With scheduledFor (YYYY-MM-DD) the status becomes scheduled; scheduling must pass the auto-publish checks |
| POST | /sites/{id}/content/{itemId}/publish | write | Queues a publish job. Body: channel (wordpress, github, siteapi, manual), live?. A live publish must pass the auto-publish checks; page rewrites can't be published live |
| GET / POST | /sites/{id}/content/{itemId}/brief | read / write | The stored research brief / a new brief (keyword, urls?); uses the monthly brief quota |
| POST | /sites/{id}/score | read | Scores article HTML 0–100 (html, itemId?, keyword?, title?, metaDescription?) |
| POST | /sites/{id}/articles | write | Sends an article your own AI wrote to review (HTML sanitized, max 300 KB, not counted against the monthly content quota) |
| GET | /sites/{id}/brand | read | Brand profile: tone, audience, forbidden words, author |
Backlinks, outreach and competitors
| Method | Path | Scope | What it does |
|---|---|---|---|
| GET | /sites/{id}/backlinks | read | Backlink profile: summary, trend, top domains and anchors |
| GET | /sites/{id}/backlinks/links | read | Individual backlinks; ?status= (active, new, lost, toxic, broken), ?limit= defaults to 200, max 1000 |
| POST | /sites/{id}/backlinks/opportunities | write | Domains linking to competitors but not to the site; spends DataForSEO credits |
| GET / POST | /sites/{id}/outreach | read / write | Outreach entries / a new prospect (domain, url?, contactName?, contactEmail?, notes?, rank?) |
| PATCH | /sites/{id}/outreach/{outreachId} | write | Status (idea, contacted, replied, won, lost), contact details or notes |
| GET / POST | /sites/{id}/competitors | read / write | Competitors / a new competitor domain (max 20 per site) |
| GET | /sites/{id}/competitors/gap | read | Content gap; ?competitorId=, ?minVolume=, ?maxKd=, ?limit= |
| GET | /sites/{id}/competitors/{competitorId}/keywords | read | Keywords both the site and the competitor rank for |
Monitoring and AI
| Method | Path | Scope | What it does |
|---|---|---|---|
| GET | /sites/{id}/geo | read | AI visibility summary; ?days= defaults to 90 |
| GET | /sites/{id}/monitors | read | uptime (30 days), index counts and changes30d |
| GET | /sites/{id}/ai-access | read | The last AI bot access check: checkedAt, result, policy |
| GET | /sites/{id}/llms.txt | read | The generated llms.txt as plain text |
Organization
| Method | Path | Scope | What it does |
|---|---|---|---|
| GET | /notifications | read | { unread, items }; ?unread=1 returns unread ones only, ?limit= defaults to 50, max 200 |
| POST | /notifications/read | write | Body: { ids?: string[] }; without ids, all are marked read |
| GET | /todo | read | What waits for a human and what automation did; ?siteId=, ?days= (default 7) |
| GET | /agent/tasks | read | Due manual tasks from the plans; ?siteId= |
| POST | /agent/tasks/{taskId}/complete | write | Closes a manual task with a note (note, at least 10 characters) |
| POST | /agent/activity | write | Writes a line to the activity feed (message, siteId?) |
| GET | /reports | read | The last 50 reports and their public urls; filter with ?siteId= |
| GET | /social/accounts, /social/posts, /social/insights | read | Social accounts, posts and account analytics (from the shared social media engine) |
| POST | /social/posts, /social/posts/{postId}/schedule, /social/campaign | write | Creating posts, setting dates and campaign series; posts land in review |
Content statuses: idea, planned, generating, draft, review, approved, scheduled, published, failed, archived. Rule kind values: title, meta_description, canonical, robots, h1, img_alt, og, json_ld, hreflang, redirect, lang, attr, link, meta. matchType: exact, prefix, regex, all.
In organizations billed through CoSuite, sites outside the site allowance are read-only. Every request that writes to them returns 403 site_read_only; read requests keep working.
Examples
Start an AI fix:
curl -X POST https://seoasist.com/api/v1/sites/SITE_ID/fixes \
-H "Authorization: Bearer sa_live_..." \
-H "Content-Type: application/json" \
-d '{"issueCode":"missing_meta_description"}'
Add keywords to tracking:
curl -X POST https://seoasist.com/api/v1/sites/SITE_ID/keywords \
-H "Authorization: Bearer sa_live_..." \
-H "Content-Type: application/json" \
-d '{"keywords":["seo tool","site audit"]}'
Jobs such as crawls and fixes are queued. Follow the result on the matching GET endpoint (/sites/{id}, /sites/{id}/fixes).
Error codes
| HTTP | error | When |
|---|---|---|
| 400 | bad_request | A body field is missing or invalid (e.g. title, kind, keywords[]) |
| 401 | unauthorized | The key is missing, invalid or revoked |
| 402 | limit_reached | A plan quota is used up (e.g. monthly pages crawled, tracked keywords, research briefs) |
| 403 | plan_required | The plan has no API access (Pro or Agency needed) |
| 403 | forbidden | A write request with a read-only key |
| 403 | site_read_only | The site is outside the CoSuite site allowance; writes are disabled |
| 404 | not_found | The site or record doesn't belong to this organization, doesn't exist, or the endpoint is unknown |
| 409 | conflict | For example the site has no code repository, the code host isn't connected, no AI model is available, AI-marked claims aren't verified yet, or a page rewrite was sent to go live |
| 409 | publish_gate | The post failed the auto-publish checks; it went back to review and the owner was notified |
| 409 / 422 | not_editable | Content that can't be edited (a live post or a page rewrite) |
| 413 | too_large | The body is too large (e.g. article HTML over 300 KB) |
| 422 | no_ai | No AI is available for the action |
| 429 | rate_limited | The 240 requests per minute or 30 fixes per hour limit was exceeded |
| 500 | internal | Unexpected error. Details are not returned, for security |
FAQ
I lost my key. Can I see it again?
No. Keys are stored only as a hash. Revoke the old one and create a new key.
Can I use the same key in an MCP client?
Yes. There are two ways:
- Remote MCP (no install, recommended):
https://seoasist.com/api/mcp. Add this URL as a connector in claude.ai, Claude Desktop, ChatGPT, Cursor or VS Code; a SEOAsist sign-in opens, you pick the organization and permissions, and you don't copy a key. Step-by-step instructions and one-click install links are in the panel on Settings → Integrations → Connect your AI assistant. In Claude Code, runclaude mcp add --transport http seoasist https://seoasist.com/api/mcpand sign in with/mcpon first use. Where no sign-in window can open (servers, CI), send the API key with--header "Authorization: Bearer sa_live_...". - Local (stdio): the MCP server view in the API keys tab gives a ready-made config for Claude Desktop, Claude Code and Cursor; you put the key in the
SEOASIST_API_KEYvariable.
Once connected, the ready commands seo_round, content_from_gap, backlink_outreach, agent_tasks and weekly_report appear in the AI app's command menu. MCP tools call the same endpoints; write tools need a key with the write scope. Page rewrites (page_update) can't be published live through the API; only blog posts are published. For all tools, scopes and error codes, see the MCP reference; for setup per app, see Connect your AI.
Can I call it straight from the browser?
The API returns an Access-Control-Allow-Origin: * header. Still, never embed a key in a public page; anyone who sees the key can reach your organization's data.
Related articles
- Accept audit issues as intentional and fix them automaticallyHow to mark issues you left on purpose as Intentional, undo that, and fix issues automatically with rules or a GitHub pull request.
- Plans, the monthly page quota and included SEOAsist AI callsThe limits of the Free, Starter, Pro and Agency plans, how the monthly crawl quota, included SEOAsist AI calls and platform data requests are counted, how payment works and where to track your usage.
- Site API reference (seoasist-site-api/1)The complete SEOAsist Site API spec: authentication and HMAC signing, the four endpoints, rule kinds and a summary of the ready-made Next.js/PHP samples.
- MCP server: endpoint, authentication, tools and ready commandsThe SEOAsist remote MCP server's URL, authentication with OAuth 2.1 or an API key, scopes, every tool, the five ready commands, rules, the local stdio package and error codes.
- Content studio: posts, page improvements, E-E-A-T and publishingTurn keywords into post ideas, have posts written and spread over the calendar, read the E-E-A-T score and verification marks in the editor, expand existing pages grounded in their source, and publish to WordPress, the Site API, GitHub or Shopify.