# monday.com Webhooks

## When to Use This Skill

* Setting up monday.com webhook handlers
* Implementing the `challenge` handshake required at registration
* Debugging JWT (`Authorization` header) verification failures
* Understanding monday.com event types and the `event` payload wrapper
* Handling board, column, subitem, and update events

## Two things every monday.com endpoint must do

monday.com webhooks are unusual — there are two separate checks, not one:

1. Challenge handshake (required). When a webhook is created, monday.com POSTs
  `{ "challenge": "<token>" }`. Your endpoint must echo it back as
  `{ "challenge": "<token>" }` or registration fails. This is the only check
  guaranteed for every webhook, including no-code and personal-token webhooks.
2. JWT verification (when present). For webhooks created by an integration
  app, monday.com signs each request with a JWT in the `Authorization` header
  (HS256), signed with your app's Signing Secret. Verify it with a JWT
  library. Webhooks created with a personal API token or the no-code board
  integration may not send this header.

> monday.com does not follow the Standard Webhooks spec, and the JWT is not
> an HMAC over the request body — it is a self-contained token that authenticates
> the sender. Because verification never reads the body, parsing JSON before
> verifying is safe here (unlike Stripe/GitHub HMAC schemes).

## Verification (core)

```javascript
import { jwtVerify } from 'jose';

// monday.com signs each request with a JWT in the Authorization header (HS256),
// signed with your app's Signing Secret (board webhooks) or Client Secret
// (app lifecycle webhooks). jwtVerify throws on a bad signature or expiry.
async function verifyMondayJwt(authHeader, secret) {
  if (!authHeader) throw new Error('Missing Authorization header');
  const token = authHeader.startsWith('Bearer ')
    ? authHeader.slice(7)
    : authHeader;                              // monday sends the raw token
  const { payload } = await jwtVerify(
    token,
    new TextEncoder().encode(secret),
    { algorithms: ['HS256'] }
  );
  return payload; // { accountId, userId, aud, exp, iat, ... }
}

// On registration monday POSTs { "challenge": "<token>" } — echo it back first:
//   if (body.challenge) return res.status(200).json({ challenge: body.challenge });

```

> For complete handlers with route wiring, event dispatch, and tests, see:
> 
> * [examples/express/](https://github.com/hookdeck/webhook-skills/tree/main/skills/monday-webhooks/examples/express/)
> * [examples/nextjs/](https://github.com/hookdeck/webhook-skills/tree/main/skills/monday-webhooks/examples/nextjs/)
> * [examples/fastapi/](https://github.com/hookdeck/webhook-skills/tree/main/skills/monday-webhooks/examples/fastapi/)

## Common Event Types

Subscribe to one event per webhook via the `create_webhook` GraphQL mutation.

| Event | Triggered When |
| --- | --- |
| `create_item` | A new item (pulse) is created on the board |
| `change_column_value` | Any column value changes |
| `change_status_column_value` | A status column value changes |
| `change_name` | An item's name changes |
| `create_update` | An update (comment) is posted on an item |
| `create_subitem` | A subitem is created (payload adds `parentItemId`) |
| `item_archived` | An item is archived |
| `item_deleted` | An item is deleted |

> For the full event list, see [monday.com Webhooks docs](https://developer.monday.com/api-reference/reference/webhooks).

## Payload Structure

Real events wrap their data in an `event` object:

```json
{
  "event": {
    "type": "change_column_value",
    "userId": 9603417,
    "boardId": 1771812698,
    "pulseId": 1772099344,
    "pulseName": "My item",
    "columnId": "status",
    "value": { "label": { "text": "Done" } },
    "triggerTime": "2021-10-11T09:24:03.960Z",
    "subscriptionId": 73759690,
    "triggerUuid": "b12b..."
  }
}

```

## Environment Variables

```bash
# App "Signing Secret" for board/integration webhooks
# (use the app "Client Secret" for app lifecycle webhooks)
MONDAY_SIGNING_SECRET=your_signing_secret_here

```

## Local Development

```bash
# Start tunnel (no account needed)
npx hookdeck-cli listen 3000 monday --path /webhooks/monday

```

## Reference Materials

* [references/overview.md](https://github.com/hookdeck/webhook-skills/blob/main/skills/monday-webhooks/references/overview.md) - monday.com webhook concepts and events
* [references/setup.md](https://github.com/hookdeck/webhook-skills/blob/main/skills/monday-webhooks/references/setup.md) - Create webhooks via the mutation or Integrations center
* [references/verification.md](https://github.com/hookdeck/webhook-skills/blob/main/skills/monday-webhooks/references/verification.md) - Challenge handshake and JWT verification details