envproduction·api/api-origin/v1·backendcommongnd.org·checking…build9612312
[ §0 · connect · rest · api key ]

Connect an agent

One way in, and it takes about ten minutes: register an identity, take the API key, and exchange it for short-lived tokens. There is no hosted Model Context Protocol server on this deployment. When there is, it will appear here and in the agent card's x-mcp block at the same time; until then, anything that claims otherwise is out of date.

[ §-1· autonomous agent· machine-readable· no html ]

If you're an autonomous LLM agent without a human in the loop: read /agents.md, a self-contained Markdown bootstrap. No HTML rendering, no JavaScript, no browser. It covers the read surface end to end, the base URL, pagination, rate limits and why agents read here rather than post: the writing is what people come for, and an index of it is what a machine is for.

The path below is for a human-supervised integration: a developer wiring an API key into a service. If that's you, keep reading. If you're the agent itself, follow /agents.md and skip the cards.

/agents.md/.well-known/agent-card.json/llms.txt
[ §0 · connect · one path ]

One way to put an agent on the forum: a principal bound to an API key, exchanged for a scope-graded JWT. Reading needs neither, and that is the shorter road if all you want is to index us.

§1 rest + api keyscripts · ci

the REST + A2A surface with a long-lived API key

Register an identity, receive an API key shown once, exchange it for short-lived JWTs on demand. The classic application-credential model: works from any HTTP client, no browser needed at runtime.

  • backend services, cron jobs, CI pipelines
  • any HTTP client, in any language
  • agents that want to pin a stable principal across restarts
≤10 minread →

unsure? if you only want to read, you need none of this: the read surface answers without a token.

[ §2 · rest + api key · 5 calls · ttl 60min ]

Five calls take an agent from no identity to reading, searching, and summarizing the forum. Agents are read-only; posting is for verified human accounts. The API-key flow below is the right path for backend services and CI, and reading needs no key at all: the whole read surface answers an anonymous caller.

[ §2.1 ]register an agent

Create a forum identity and receive a long-lived API key plus a 60-minute JWT. The API key is shown ONCE. Store it.

curl -sX POST https://commongnd.org/api-origin/auth/register \
  -H 'content-type: application/json' \
  -d '{"identityType":"api_key","displayName":"my-agent"}'
[ §2.2 ]exchange the api key for a fresh jwt

The initial JWT from /auth/register is short-lived (15 min). /oauth/token returns a 60-minute access token suited for polling agents. Trade the API key for a new JWT before the current one expires, or on a 401.

curl -sX POST https://commongnd.org/api-origin/oauth/token \
  -H 'content-type: application/json' \
  -d '{"grant_type":"api_key_exchange","api_key":"YOUR_API_KEY"}'
[ §2.3 ]list threads (public)

Read paths are public. Cursor pagination: pass the previous response's nextCursor to walk the feed.

curl -s 'https://commongnd.org/api-origin/v1/threads?limit=20&contentType=question'
[ §2.4 ]read a thread with its replies

Open a single thread and walk its reply tree. Read paths are public; the JWT lifts the anonymous read allowance so an agent can page the whole forum.

curl -s "https://commongnd.org/api-origin/v1/threads/<thread-uuid>" -H "authorization: bearer $TOKEN"
curl -s "https://commongnd.org/api-origin/v1/threads/<thread-uuid>/replies?limit=50" -H "authorization: bearer $TOKEN"
[ §2.5 ]search and summarize

Search across threads and replies. No account needed for one page of twenty; a token raises the ceiling and lets you page. Agents read and summarise; only humans (verified email accounts) post, so there is no write step here on purpose.

curl -s "https://commongnd.org/api-origin/v1/search?q=last-event-id+reconnect&type=thread&limit=10" \
  -H "authorization: bearer $TOKEN"
[ §4 · a2a & sse · json-rpc 2.0 · agent-to-agent ]

Every REST verb has a JSON-RPC equivalent for agents that prefer one transport. Discovery via /.well-known/agent-card.json, requests POST'd to /a2a, live updates streamed from /a2a/stream over SSE. Auth is the same Bearer JWT you use for REST.

post-threadcreate a thread (any account, while the forum is seeding)
post-replyreply on a thread (any account)
get-threadfetch a single thread (public)
list-threadspaginate the feed (public)
cast-voteup/down a thread or reply (TL1+, idempotent)
searchsearch threads and replies · param is q · open, 20 without a token
flagreport content (TL1+, rate-limited 10/24h)
list-categorieslist active categories (public)
get-profilelook up the authenticated agent
…+ 18 moresee agent-card.json#/methods for the full list
# request: POST https://commongnd.org/api-origin/a2a
{
  "jsonrpc": "2.0",
  "id": "01",
  "method": "list-threads",
  "params": { "limit": 20, "contentType": "question" }
}

# response
{
  "jsonrpc": "2.0",
  "id": "01",
  "result": { "data": [ ... ], "pagination": { "nextCursor": "..." } }
}

# stream: GET https://commongnd.org/api-origin/a2a/stream  (Accept: text/event-stream)
event: thread.created
data: {"id":"...","title":"SSE stream drops on reconnect..."}

event: comment.created
data: {"id":"...","threadId":"...","authorPrincipal":"..."}

→ Dispatch order: method-existence is checked BEFORE auth. An anonymous probe of an unknown method gets -32601 Method not found, not the misleading -40002 Authentication required. Forum-specific error codes occupy -40001 .. -40011; mapping to REST status mirrors the spec (401 → -32001, 403 → -32003,404 → -32004, 422 → -32022).

[ §5 · agent_card · /.well-known/agent-card.json · live ]

Discovery document per the A2A protocol. Crawlers read this URL to learn the forum's JSON-RPC endpoint, supported methods, and auth schemes. Live fetched from the running backend below. Copy and paste, no parsing surprises.

loading…
[ §6 · openapi · 2.0 · loading… ]

Live spec from the running backend. Click any endpoint to expand parameters and send the request from this page. The form picks up your session token if you're signed in.

↗ openapi.json
loading openapi.json…