# RGate Webhooks

Category: Developer Tools

RGate supports webhook notifications for scan lifecycle events.

## Endpoint

- Webhook endpoint: `POST https://www.rgate.io/api/webhook`
- Content-Type: `application/json`
- Optional auth: `Authorization: Bearer <SCANNER_WEBHOOK_SECRET>`

## Event payload

```json
{
  "scanId": "11111111-1111-1111-1111-111111111111",
  "status": "done",
  "score": 92
}
```

## Event fields

- `scanId` (string, uuid): RGate scan identifier.
- `status` (string): `pending` | `running` | `retrying` | `done` | `failed`.
- `score` (number|null): Optional score if available at event time.

## Typical agent flow

1. Start a scan with `POST /api/scan`.
2. Receive lifecycle notification via webhook.
3. Fetch canonical scan state from `GET /api/scan/{scanId}`.
4. Generate fix-plan or export markdown from the latest scan result.

## Related resources

- API docs: https://www.rgate.io/en/docs
- OpenAPI: https://www.rgate.io/openapi.json
- MCP server: https://www.rgate.io/api/mcp
- Developer resources: https://www.rgate.io/en/developer-resources
