> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meshagent.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhook Handoffs

> Handle `room.call` webhook handoffs in your own service with WebhookServer.

Use this page when MeshAgent needs to call your service or toolkit over the webhook transport.

## When to use `WebhookServer`

Use `WebhookServer` when your endpoint needs:

* built-in signature verification
* a default `GET /` health check
* a default `POST /webhook` handler
* support for `room.call` handoffs, including websocket upgrades

## What `room.call` sends

For `room.call`, MeshAgent sends:

* `room_name`
* `room_url`
* `token`
* optional `arguments`

That is the handoff MeshAgent uses when it calls your own service endpoint.

## Configure webhook verification

Set the webhook secret if you want the server to verify signed requests:

```bash theme={null}
export MESHAGENT_WEBHOOK_SECRET=your-secret
```

For local development, you can disable verification with `validate_webhook_secret=False`.

## Run `WebhookServer`

The built-in server listens on port `8080` by default and exposes:

* `GET /` for health checks
* `POST /webhook` for webhook delivery
* `GET /webhook` for websocket upgrades used by `room.call`

Use the SDK to create the server and handle `room.call`:

```python Python theme={null}
from meshagent.api.webhooks import (
    WebhookServer,
    CallEvent,
)
import asyncio


class CustomWebhookServer(WebhookServer):
    async def on_call(self, event: CallEvent):
        print(f"room call for {event.room_name}")
        print(f"arguments: {event.arguments}")


async def main():
    server = CustomWebhookServer()
    await server.run()


asyncio.run(main())

```

## Related docs

* [Service YAML](https://docs.meshagent.com/services/deployment/deploy_services.md)
* [MeshAgent CLI Commands](https://docs.meshagent.com/reference/meshagent_cli_help.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.