Skip to main content
Documentation

API Guide

Publishing blog articles from Rankdesk

API Only

Synchronize Rankdesk pages into the Autotouch AI Blog while keeping public rendering independent of the Rankdesk API.

Updated September 4, 2026

What this is for

Rankdesk's Content API supplies the article HTML, metadata, table of contents, JSON-LD, and image URLs. The website syncs that content into its own site_content table before rendering it at /blog/<slug>.

Configure Rankdesk

  1. Set the endpoint URL to https://www.autotouch.ai/api/rankdesk/sync.
  2. Leave the signing secret blank. Publish webhooks are accepted on public POST with article slugs; the route refetches canonical content with the server-only RANKDESK_API_KEY.
  3. Publish or re-push an article. A successful sync response includes synced, one persisted revision per item, and isolated errors.

Auth model

  • Rankdesk publish — public POST with article slug(s); syncs only those articles.
  • Connection probe — unauthenticated GET or empty POST returns { ok: true } and does not sync.
  • Full sync — Vercel cron GET (or empty POST) with Authorization: Bearer $CRON_SECRET.

Keep RANKDESK_API_KEY, SUPABASE_API_KEY, SUPABASE_URL, and CRON_SECRET configured only on Vercel server environments. Do not use a VITE_ variable for these values.

Accepted payload

Named refresh:

{
  "items": [
    { "slug": "how-to-rank-for-long-tail-keywords", "kind": "blog" }
  ]
}

Rankdesk publish_article envelopes are also accepted. The route extracts slugs from common shapes and refetches each item from the Content API. Webhook HTML is never trusted.

How publishing works here

  1. Named syncs call GET /posts/<slug>. Authorized full syncs paginate GET /posts?kind=blog&limit=100&offset=....
  2. Rankdesk-owned rows are upserted by (kind, slug). Repeated syncs are safe and never delete existing content.
  3. Public rendering reads only the persisted row. A Rankdesk outage does not take down the hub or existing blog sources.

Response example

{
  "synced": 1,
  "items": [{ "slug": "how-to-rank-for-long-tail-keywords", "updated_at": "2026-09-01T14:00:00.000Z" }],
  "errors": []
}

Local testing

Publish style: curl -X POST https://www.autotouch.ai/api/rankdesk/sync -H 'content-type: application/json' -d '{"items":[{"slug":"your-slug","kind":"blog"}]}'

Full sync: curl -X GET https://www.autotouch.ai/api/rankdesk/sync -H "Authorization: Bearer $CRON_SECRET"

Related pages

Docs