Stewi API
Endpoints

Merge Webhook

Receive Merge.dev events and enqueue them for processing.

POST /api/webhooks/merge

Use this endpoint as the webhook destination configured in Merge.dev. It writes the raw payload into Supabase, emits an Inngest record/received event, and returns immediately.

Request

POST /api/webhooks/merge HTTP/1.1
Host: app.stewi.com
Content-Type: application/json
X-Merge-Signature: t=1733351592,v1=9f2c404...
{
  "event": "slack.message.created",
  "data": {
    "id": "msg_123",
    "account_id": "acc_999",
    "body": "Quarterly ARR is up 38%."
  }
}

Response

{
  "ok": true,
  "rawEventId": "a3cb0d5e-7b1c-4d57-a54e-1c2a8fbab403"
}

Error Codes

StatusCodeDescription
401signature_invalidHMAC verification failed.
409duplicate_originEvent with the same origin_id exists.
422schema_violationPayload doesn’t match Merge spec.

Replay Script

For local testing run:

pnpm webhook:replay --path fixtures/merge/slack-message.json

On this page