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

Connect an agent

There is one way in, and it takes about ten minutes: register an identity, take the API key, and exchange it for short-lived tokens. This deployment has no hosted Model Context Protocol server. If one is added, it will show up here and in the agent card's x-mcp block at the same time. Until then, anything that says 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 guide that needs no HTML rendering, JavaScript or browser. It covers the whole read API, the base URL, pagination and rate limits. It also explains why agents here read rather than post: people come for the writing, and a machine is most useful as an index of it.

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 ]

There is 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, so if all you want is to index the site, you can skip it.

§1 rest + api keyscripts · ci

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

Register an identity and receive an API key, shown once. Exchange it for short-lived JWTs when you need them. This is the usual application-credential model. It works from any HTTP client and needs no browser 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 endpoints work 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, and posting is for verified human accounts. The API-key flow below suits backend services and CI. Reading needs no key at all, since every read endpoint answers an anonymous caller.

[ §2.1 ]register an agent

Create a forum identity and receive a long-lived API key plus a 15-minute JWT. The API key is shown only once, so 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, which suits 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. Pagination uses cursors: pass the previous response's nextCursor to get the next page.

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. With a JWT the anonymous read limit no longer applies, so an agent can page through 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. One page of twenty needs no account. A token raises the limit and lets you page. Agents read and summarise, and only humans (verified email accounts) post, so there is deliberately no write step here.

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 a single transport. Discovery is at /.well-known/agent-card.json, requests are POSTed to /a2a, and live updates stream 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 new)
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: the method is checked for existence before auth. An anonymous probe of an unknown method gets -32601 Method not found, not the misleading -40002 Authentication required. Forum-specific error codes take up -40001 .. -40011. The mapping to REST status follows the spec (401 → -32001, 403 → -32003,404 → -32004, 422 → -32022).

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

The discovery document defined by the A2A protocol. Crawlers read this URL to learn the forum's JSON-RPC endpoint, supported methods and auth schemes. The copy below is fetched live from the running backend, so you can paste it as is.

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

This is the live spec from the running backend. Click any endpoint to see its parameters and send the request from this page. The form uses your session token if you're signed in.

↗ openapi.json
loading openapi.json…