Yroun Guide

Webhooks

Webhooks are inbound message pipes into your hub's chat rooms, the same pattern as Slack or Discord incoming webhooks. Create one against a room, keep its secret on your server, and POST text to it whenever your systems have something to say: deploys, alerts, sales, agent activity. Everyone in the room sees it in real time.

Creating a webhook

One call, authenticated with your hub API key. Bind it to the chat room that should receive the messages:

curl -X POST https://oapi.yroun.com/hubs/HUBUID/webhooks \
  -H "X-API-Key: yroun_key_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"roomUid": "ROOMUID", "name": "deploy-alerts"}'
// 201: the secret is returned ONCE, on create. Store it now.
{
  "uid": "f3a9c2...",
  "name": "deploy-alerts",
  "active": true,
  "roomUid": "ROOMUID",
  "secret": "9c1e4b7a..."
}

Sending a message

From any server, cron job, CI pipeline, or agent, with no API key needed. The webhook secret is the credential:

curl -X POST https://api.yroun.com/api/v1/webhooks/WEBHOOK_UID \
  -H "X-Webhook-Secret: 9c1e4b7a..." \
  -H "Content-Type: application/json" \
  -d '{"text": "✅ deploy v2.34.1 to prod completed"}'
  • The secret authorizes exactly one webhook → one room. Leaking it exposes only the ability to post text into that room. Revoke by deleting the webhook and creating a new one.
  • A wrong secret returns 403; a deleted or deactivated webhook returns 404.
  • Every attempt is recorded in the delivery log (status, error, payload size). Hub → Settings → Webhooks shows recent deliveries and a one-click test send.
  • Recipe: CI deploy notifications

    # Last step of your deploy pipeline
    curl -sf -X POST "https://api.yroun.com/api/v1/webhooks/$YROUN_WEBHOOK_UID" \
      -H "X-Webhook-Secret: $YROUN_WEBHOOK_SECRET" \
      -H "Content-Type: application/json" \
      -d "{\"text\": \"🚀 $SERVICE $VERSION deployed by $USER\"}"

    Recipe: cron failure alerts

    import requests
    
    def alert_room(text: str) -> None:
        resp = requests.post(
            f"https://api.yroun.com/api/v1/webhooks/{WEBHOOK_UID}",
            headers={"X-Webhook-Secret": WEBHOOK_SECRET},
            json={"text": text},
            timeout=10,
        )
        resp.raise_for_status()
    
    try:
        run_nightly_job()
    except Exception as e:
        alert_room(f"❌ nightly job failed: {e}")
        raise

    Recipe: agent activity feed

    If an AI agent maintains pages in your hub via the Open API, give it a webhook to the team room so every autonomous change is announced where humans already look. See Open API → Agent Recipes for the full supervision pattern.

    curl -X POST "https://api.yroun.com/api/v1/webhooks/$WEBHOOK_UID" \
      -H "X-Webhook-Secret: $WEBHOOK_SECRET" \
      -H "Content-Type: application/json" \
      -d '{"text": "🤖 agent updated the Ops Dashboard page: refreshed 3 widget endpoints"}'

    Managing webhooks

  • List: GET /oapi/hubs/{hubUid}/webhooks (secrets are not included in list responses).
  • Delete: DELETE /oapi/hubs/{hubUid}/webhooks/{webhookUid}. The URL stops working immediately.
  • Rotate a secret: delete + create a new webhook against the same room, then swap the secret in your server config.
  • Stuck, or something here is wrong? Send us a message