Altered Digital Migration

API Reference

REST routes exposed by the WordPress plugin and the Cloudflare Worker.

WordPress plugin REST API

All routes are registered on the altered-digital/v1 namespace (with back-compat on wp-to-sanity/v1). Auth: WP nonce via X-WP-Nonce header (admin capability required).

Export

MethodPathDescription
POST/exportExport a single post (post_id param)
POST/export/bulkBulk export multiple posts
POST/export/fullFull-site export
GET/export/batch-sizeGet the configured batch size

Status

MethodPathDescription
GET/statusAggregate migration status
GET/status/post/{id}Per-post migration history (reconciles with Worker D1)

Connect

MethodPathDescription
POST/connectLegacy v1 connect (self-host)
POST/connect/v2Multi-tenant connect
GET/connect/testTest Worker reachability

AI + Billing

MethodPathDescription
GET/analyze-dataAggregated site analysis payload
POST/analyzeTrigger AI analysis
GET/analyze/{id}/statusPoll analysis status
POST/quoteGenerate a quote
POST/checkoutStart Stripe checkout (50% upfront)
POST/approveApprove migration + capture final 50%
POST/schema-generateGenerate Sanity schema from analysis

Auth

MethodPathDescription
POST/auth/loginSupabase login
POST/auth/signupSupabase signup
POST/auth/logoutClear session

MCP hand-off

MethodPathDescription
POST/mcp/tokenStore a Sanity MCP token
GET/mcp/configGet Claude Desktop config snippet
POST/mcp/revokeRevoke the MCP token

Progress

MethodPathDescription
GET/progressAggregate progress (from Worker D1)
GET/progress/{post_id}Per-post progress

Cloudflare Worker API

Webhook

MethodPathAuthDescription
POST/webhook/wpHMAC signatureWP content webhook

v2 (multi-tenant)

MethodPathAuthDescription
POST/v2/connectBearer ADMIN_TOKENCreate tenant
GET/v2/migrationsBearer ADMIN_TOKEN + X-AD-TenantAggregate stats
GET/v2/migrations/{postId}Bearer ADMIN_TOKEN + X-AD-TenantPer-post history
POST/v2/cleanupBearer ADMIN_TOKEN + X-AD-TenantAI content cleanup
POST/v2/mcp/tokenBearer ADMIN_TOKEN + X-AD-TenantStore MCP token
GET/v2/mcp/configBearer ADMIN_TOKEN + X-AD-TenantGet MCP config
POST/v2/mcp/revokeBearer ADMIN_TOKEN + X-AD-TenantRevoke MCP token

Revalidation

MethodPathAuthDescription
POST/revalidateX-Sanity-Webhook-SecretSanity webhook → Next.js
POST/revalidate/manualBearerManual revalidate {path}

AI service API (Vercel)

MethodPathAuthDescription
GET/api/healthNoneLiveness probe
POST/api/signupNone (rate-limited)Create AD account
POST/api/analyzeSupabase JWTFull-site analysis
POST/api/quoteSupabase JWTGenerate quote
POST/api/stripe/checkoutSupabase JWT50% upfront checkout
POST/api/stripe/captureSupabase JWT or internalFinal 50% checkout
POST/api/stripe/webhookStripe signatureStripe webhook
POST/api/transformInternal tokenAI transform fallback
POST/api/cleanupSupabase JWT or internalAI content cleanup
POST/api/schema-generateSupabase JWT or internalSanity schema generation
POST/api/approveSupabase JWTCustomer sign-off + QA
GET/api/auto-completeCRON_SECRETDaily cron (auto-complete)

On this page