MagicAI SEO API & Webhooks
Run any of our AI agents from n8n, Zapier, Make or your own code, and receive the finished report automatically.
1. Webhooks (all plans)
Add your webhook URL in Account → Automation. After every run (on the website or via the API) we send a POST with this JSON:
{
"event": "agent.run.completed",
"job_id": "5f2c…",
"agent": {"slug": "competitor-intelligence", "name": "Competitor Intelligence"},
"source": "web",
"status": "done",
"input": "…",
"result_markdown": "# Report …",
"report_url": "https://magicaiseo.com/history.php?id=…",
"created_at": "2026-11-10 09:30:00",
"finished_at": "2026-11-10 09:31:40"
} Verify it: header X-MagicAI-Signature: sha256=… is the HMAC-SHA256 of X-MagicAI-Timestamp + "." + raw body with your signing secret. Failed runs send agent.run.failed.
2. REST API (PRO)
Create a key in Account → Automation and send it as Authorization: Bearer ma_live_…. Runs count toward your daily PRO limit. Limit: 30 requests per minute.
List agents
curl -H "Authorization: Bearer ma_live_YOUR_KEY" https://magicaiseo.com/api/v1/agents Start a run
curl -X POST https://magicaiseo.com/api/v1/runs \
-H "Authorization: Bearer ma_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"agent":"content-refresh-agent","input":"https://yourblog.com/post keyword: best budget phones","options":{"lang":"en","depth":"standard","format":"report"},"callback_url":"https://your-n8n.example.com/webhook/abc"}' Response 202: {"id":"…","status":"queued","poll_url":"https://magicaiseo.com/api/v1/runs/…"}. The run continues in the background; most finish in 1–3 minutes.
Get the result
curl -H "Authorization: Bearer ma_live_YOUR_KEY" https://magicaiseo.com/api/v1/runs/RUN_ID status is queued, running, done or error; when done, result_markdown holds the report. If you passed callback_url, the result is also POSTed there (same JSON as webhooks).
Options: lang (en, hi, de, fr, es, bn, ur), depth (quick, standard, deep), format (report, bullets, table), tone, audience, extra.
3. n8n in 3 nodes
- Webhook node (POST) → copy its Production URL.
- HTTP Request node: POST
https://magicaiseo.com/api/v1/runs, headerAuthorization: Bearer ma_live_…, JSON body withagent,inputandcallback_url= the Webhook URL from step 1. - When the report is ready, your Webhook node receives it: send it to Google Sheets, Slack, email or WordPress.
Zapier and Make work the same way with "Webhooks by Zapier" / "HTTP" modules.
Errors
401 invalid key · 403 PRO required · 404 unknown agent or run · 422 bad input or callback · 429 rate or daily limit.