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/jsonAuthentication
Two accepted paths — send one:
- Bearer token (recommended for LLM agents):
authorization: Bearer <GYRENCE_ADMIN_MCP_TOKEN> - 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
| Field | Required | Notes |
|---|---|---|
slug | yes | lowercase kebab-case, unique — the upsert key |
title | yes | max 300 chars |
content_md | yes | markdown body |
dek | no | short lead/subtitle |
cover_image_url | no | absolute URL |
published_at | no | ISO-8601 with offset. Omit or null to keep it a draft |
author_id | no | UUID 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
| Code | Status | Meaning |
|---|---|---|
unauthorized | 401 | Missing or wrong bearer token / signature |
bad_request | 400 | Invalid JSON or a field that failed validation |
db_error | 500 | Write failed — retry |
config | 500 | Neither 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.
