Skip to content

Webhook validation fails: Object contains extra field context #4

@sakiatu

Description

@sakiatu

Description

WorkOS webhook events now include a context field that is not in the validator for processEvent, causing all webhook events to fail with:

ArgumentValidationError: Object contains extra field context that is not in the validator.
Path: .event

Example Payload

{
  "context": {
    "client_id": "client_01KEK95ZV191NZWYM0P48S9NJ3"
  },
  "createdAt": "2026-01-11T07:48:24.432Z",
  "data": {
    "createdAt": "2026-01-11T07:48:24.388Z",
    "email": "user@example.com",
    "emailVerified": true,
    "firstName": "John",
    "id": "user_01KEP0E5Q07QEJNPC53Y5X2H2M",
    "lastName": "Doe",
    ...
  },
  "event": "user.created",
  "id": "event_01KEP0E5QGFY339B4P2RADF264"
}

Current Validator

  event: v.object({
    id: v.string(),
    createdAt: v.string(),
    event: v.string(),
    data: v.record(v.string(), v.any()),
  }),

Environment

  • @convex-dev/workos-authkit: 0.1.4
  • convex: 1.31.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions