Agent Recipes
Hub pages are machine-writable documents. An AI agent holding your hub API key can read the same pages your team reads, edit the widgets on them, and keep a dashboard alive while you only supervise. These recipes cover the read → modify → write loop, appending content, and the supervision pattern that keeps humans in the loop. Everything here also works from an MCP tool or any HTTP-capable agent runtime.
Machine-readable references for your agent's context: https://www.yroun.com/llms.txt (compact API + widget guide) and https://www.yroun.com/openapi.json (full OpenAPI spec).
export YROUN_KEY="yroun_key_xxxxxxxxxxxx" export YROUN_BASE="https://oapi.yroun.com/hubs/<hubUid>"
1. Read a page and find its widgets
The list endpoint returns page metadata only. Content comes from the single-page GET. Page content is a Tiptap document serialized as a JSON string, so parse it twice: once as the response, once as the content field.
# Find the page by title PAGE_UID=$(curl -s "$YROUN_BASE/pages" -H "X-API-Key: $YROUN_KEY" \ | jq -r '.[] | select(.title == "Ops Dashboard") | .uid') # GET the single page. Only this includes content curl -s "$YROUN_BASE/pages/$PAGE_UID" -H "X-API-Key: $YROUN_KEY" \ | jq -r .content | jq '.content[] | select(.type == "apiTableBlock") | .attrs'
Widget nodes (apiTableBlock, chartBlock, apiRequestBlock, apiQueueBlock, faqBlock, statGridBlock) carry their full configuration in attrs: endpoint, mapping, columns. Reading attrs tells the agent exactly what the dashboard currently shows.
2. Update a widget's config (read → modify → write)
There is no per-node PATCH. The page content is the unit of write. The safe loop: GET the page, modify the parsed document, PUT the whole content back.
# GET → swap one widget attr with jq → PUT back
DOC=$(curl -s "$YROUN_BASE/pages/$PAGE_UID" -H "X-API-Key: $YROUN_KEY" | jq -r .content)
NEW_DOC=$(echo "$DOC" | jq '
(.content[] | select(.type == "apiTableBlock") | .attrs.apiUrl)
|= "https://api.example.com/v2/users"')
curl -X PUT "$YROUN_BASE/pages/$PAGE_UID" \
-H "X-API-Key: $YROUN_KEY" -H "Content-Type: application/json" \
-d "$(jq -n --arg c "$NEW_DOC" '{content: $c}')"3. Append a status block
An agent posting a morning summary appends nodes to the document instead of replacing it:
NEW_DOC=$(echo "$DOC" | jq --arg date "$(date -u +%Y-%m-%d)" '
.content += [
{ "type": "heading", "attrs": { "level": 3 },
"content": [{ "type": "text", "text": ("Agent summary - " + $date) }] },
{ "type": "paragraph",
"content": [{ "type": "text", "text": "All 4 endpoints healthy. 2 new signups overnight." }] }
]')The same pattern inserts a whole widget node. See Content & Widgets for each widget's attrs shape.
4. Supervision: snapshot before, announce after
Two habits make an autonomous page-editing agent safe to leave running:
# Before a bulk edit run
curl -X POST "$YROUN_BASE/snapshots" -H "X-API-Key: $YROUN_KEY" \
-H "Content-Type: application/json" -d '{"label": "pre-agent-run"}'
# After each write
curl -X POST "https://api.yroun.com/api/v1/webhooks/$HOOK_UID" \
-H "X-Webhook-Secret: $HOOK_SECRET" -H "Content-Type: application/json" \
-d '{"text": "🤖 updated Ops Dashboard: repointed users table to /v2/users"}'Guardrails checklist for agent runbooks
Stuck, or something here is wrong? Send us a message