API & agent tools
Four public endpoints. No key, no account, no rate limit promise — this is a validation-stage service. All responses are JSON and allow cross-origin requests.
Endpoints
| Method | Path | Purpose |
|---|---|---|
| GET | /api/health | Service status and engine version |
| GET | /api/platforms | Platform ids, limits, link policy, media rules |
| POST | /api/adapt | Adapt a draft into per-platform results |
| GET | /api/mcp/tools | Tool manifest for AI agents |
Adapt a post
curl -X POST https://postbridge-mini.pages.dev/api/adapt \
-H 'Content-Type: application/json' \
-d '{
"text": "Launch day is here. Details: https://example.com/launch",
"platforms": ["x", "instagram", "linkedin"],
"overrides": { "linkedin": "We shipped it. Here is what changed." }
}'
Each result contains platform, name, text, length, limit, status, issues, firstComment, mediaRule and adapted. Status is ok, warning or error.
Rules applied
- X counts each URL as 23 characters and moves links to a first comment.
- Instagram and TikTok strip links from the caption and return them as
firstComment. - LinkedIn, Facebook, Threads, Bluesky and Mastodon keep links inline.
- Over-limit text is shortened at a word boundary and marked
error. - Hashtags above the recommended count produce a
warning, never an automatic rewrite.
Agent tool manifest
GET /api/mcp/tools returns adapt_post, list_platforms and check_text with JSON Schema input definitions. The manifest is descriptive: it tells an agent how to call the HTTP endpoints above; it is not a hosted Model Context Protocol transport.
Limits
Text and overrides are capped at 10,000 characters. Select 1–8 platforms. Invalid input returns {"success":false,"error":{"code":"…","message":"…"}} with HTTP 400.