Webhooks

Receive real-time notifications when events happen in your Codmir projects.

GitHub Webhooks

Codmir can receive GitHub webhooks to automatically enqueue agent tasks when issues are created, PRs are opened, or commits are pushed.

Setup

  1. Go to your GitHub repository → Settings → Webhooks → Add webhook
  2. Set the Payload URL to https://your-server.codmir.com/webhooks/github
  3. Set Content type to application/json
  4. Set a secret and add it as GITHUB_WEBHOOK_SECRET in your server environment
  5. Select the events you want to trigger (Issues, Pull requests, Push)

Security

All GitHub webhooks verify the x-hub-signature-256 header via HMAC when GITHUB_WEBHOOK_SECRET is configured. Requests with invalid signatures are rejected.

Generic Webhooks

The generic webhook endpoint (POST /webhooks/generic) accepts arbitrary JSON payloads and can trigger agent tasks. This endpoint requires authentication in production.

POST /webhooks/generic
Content-Type: application/json
Authorization: Bearer <token>

{
  "event": "custom.trigger",
  "projectId": "project-123",
  "data": { ... }
}

Related