Blog publish webhook

POST /api/public/hooks/blog-publish writes a post directly into the Gyrence blog. Use it when an external routine (for example a scheduled Claude job) needs a deterministic publish path that does not depend on the agent picking the right MCP connector.

Endpoint

POST https://www.gyrence.com/api/public/hooks/blog-publish
content-type: application/json

Authentication

Two accepted paths — send one:

  1. Bearer token (recommended for LLM agents): authorization: Bearer <GYRENCE_ADMIN_MCP_TOKEN>
  2. HMAC signature (recommended for CI/CD pipelines): x-gyrence-signature: sha256=<hex HMAC-SHA256 of the raw body, keyed with BLOG_WEBHOOK_SECRET>

Unauthenticated calls return 401 with { ok: false, code: "unauthorized" }.

Body

FieldRequiredNotes
slugyeslowercase kebab-case, unique — the upsert key
titleyesmax 300 chars
content_mdyesmarkdown body
deknoshort lead/subtitle
cover_image_urlnoabsolute URL
published_atnoISO-8601 with offset. Omit or null to keep it a draft
author_idnoUUID of a profiles row

Example

curl -sS -X POST https://www.gyrence.com/api/public/hooks/blog-publish \
  -H "content-type: application/json" \
  -H "authorization: Bearer $GYRENCE_ADMIN_MCP_TOKEN" \
  -d '{
    "slug": "weekly-source-intelligence-2026-08-16",
    "title": "Weekly source intelligence",
    "dek": "What moved across our registry this week.",
    "content_md": "## Highlights\n\n- ...",
    "published_at": "2026-08-16T13:00:00Z"
  }'

Response

{
  "ok": true,
  "data": {
    "id": "…",
    "slug": "weekly-source-intelligence-2026-08-16",
    "url": "https://www.gyrence.com/blog#weekly-source-intelligence-2026-08-16",
    "published": true,
    "action": "created"
  }
}

Re-posting the same slug updates the existing post and returns "action": "updated", so retries are safe.

Errors

CodeStatusMeaning
unauthorized401Missing or wrong bearer token / signature
bad_request400Invalid JSON or a field that failed validation
db_error500Write failed — retry
config500Neither credential is configured on the server

Which path should the weekly routine use?

Prefer this webhook over the generic Supabase MCP connector. That connector authenticates as a personal Supabase account, which can never be a member of the org that owns this Lovable-managed project — so get_project there fails permanently. The webhook has no such dependency.