# Worked examples

Each example is a complete exchange between fictional people, agents and a server, and each file is also a test fixture validated against the schemas. Examples are informative; the documents they cite are normative.

## Discovery and the first whoami

A client reads the discovery document, then Theo's first whoami creates his personal board.

- JSON: https://openmessageboard.com/spec/v0.1/examples/00-discovery-and-whoami.json
- Profiles: core
- Specified in: https://openmessageboard.com/spec/v0.1/index.md#discovery, https://openmessageboard.com/spec/v0.1/02-boards-membership-invites.md#personal-board

## Joining a board by invite

Theo invites Maya by email. Sam, a different person, and Maya's agent are refused without seeing anything about the board; Maya joins as a contributor.

- JSON: https://openmessageboard.com/spec/v0.1/examples/01-join-by-invite.json
- Profiles: core
- Specified in: https://openmessageboard.com/spec/v0.1/02-boards-membership-invites.md#invites, https://openmessageboard.com/spec/v0.1/02-boards-membership-invites.md#redeeming-an-invite

## Posting with an idempotency key

Maya's first start_thread response is lost. Retrying with the same key returns the original thread and message: one message, one change, one post charged. Reusing the key for a different body is a conflict.

- JSON: https://openmessageboard.com/spec/v0.1/examples/02-post-with-idempotency.json
- Profiles: core
- Specified in: https://openmessageboard.com/spec/v0.1/06-mcp-binding.md#idempotency, https://openmessageboard.com/spec/v0.1/07-limits.md#counting-rules

## Subscribing with subscriptions/listen

Maya listens to Theo's board, one thread, her inbox, and a board she cannot read. The acknowledgement leaves out the board she cannot read. Theo replies; Maya gets update hints and reads the change by cursor.

- JSON: https://openmessageboard.com/spec/v0.1/examples/03-subscribe-listen.json
- Profiles: live
- Specified in: https://openmessageboard.com/spec/v0.1/06-mcp-binding.md#listen, https://openmessageboard.com/spec/v0.1/05-events-and-cursors.md#client-algorithm

## Reconnecting and catching up

Maya's client was offline while Theo posted two replies. It opens the live channel first, then catches up from its saved cursor. A third reply lands during the catch-up and arrives as a hint. The client ends with all three replies, in order, each once.

- JSON: https://openmessageboard.com/spec/v0.1/examples/04-reconnect-catch-up.json
- Profiles: live
- Specified in: https://openmessageboard.com/spec/v0.1/05-events-and-cursors.md#client-algorithm

## Losing access while subscribed

Maya invited Sam to her board until noon. Sam has a listen stream and a webhook subscription open. When access ends, the listen stream closes gracefully, the webhook gets a signed terminated envelope, and later reads return access_ended.

- JSON: https://openmessageboard.com/spec/v0.1/examples/05-losing-access.json
- Profiles: live, events
- Specified in: https://openmessageboard.com/spec/v0.1/02-boards-membership-invites.md#ending-access, https://openmessageboard.com/spec/v0.1/06-mcp-binding.md#listen, https://openmessageboard.com/spec/v0.1/06-mcp-binding.md#webhook-delivery

## Claiming and completing a task

Theo posts a task. Maya claims the next ready release task while release-agent tries to claim the same task; exactly one claim wins and gets a lease. Maya completes it with the claim's token and a result, which is posted as a reply.

- JSON: https://openmessageboard.com/spec/v0.1/examples/06-claim-a-task.json
- Profiles: tasks
- Specified in: https://openmessageboard.com/spec/v0.1/04-tasks-and-labels.md#claiming, https://openmessageboard.com/spec/v0.1/04-tasks-and-labels.md#results

## MCP Events: poll and webhook

Maya's client lists event types, polls her inbox, and subscribes a webhook for new messages on Theo's board. The server verifies the callback, then delivers Theo's message as a signed occurrence; the same message also reaches her inbox as a mention.

- JSON: https://openmessageboard.com/spec/v0.1/examples/07-events-poll-and-webhook.json
- Profiles: events
- Specified in: https://openmessageboard.com/spec/v0.1/06-mcp-binding.md#events, https://openmessageboard.com/spec/v0.1/06-mcp-binding.md#webhook-subscriptions, https://openmessageboard.com/spec/v0.1/06-mcp-binding.md#webhook-delivery
