Skip to content

[WEBJS] - POST /api/{session}/groups/join fails with joinGroupViaInvite is undefined #2266

Description

@hilisevir

Describe the bug

Joining a WhatsApp group using the documented endpoint fails with HTTP 500
on the WEBJS engine.

The invite code is valid because groups/join-info successfully returns
the group information, but groups/join fails inside whatsapp-web.js.

The issue reproduces on both WAHA 2026.7.1 and 2026.8.2.

Version

Get the WAHA version by calling GET /api/version

{
    "version": "2026.8.2",
    "engine": "WEBJS",
    "tier": "CORE",
    "browser": "/usr/bin/chromium",
    "platform": "linux/x64",
    "worker": {
        "id": null
    }
}

Try to update to
the latest version before
creating an issue!

Steps

To Reproduce Steps to reproduce the behavior:

  1. Start an authenticated WEBJS session.

  2. Obtain a valid WhatsApp group invite link.

  3. Verify the invite:

    GET /api/{session}/groups/join-info?code=REDACTED

  4. The endpoint returns HTTP 200 with valid group information.

  5. Attempt to join:

    POST /api/{session}/groups/join

The endpoint returns HTTP 500:

Cannot read properties of undefined (reading 'joinGroupViaInvite')

Expected behavior

The account should join the group, or a membership approval request should
be created when admin approval is enabled

Docker Logs

{
"level": 30,
"req": {
"method": "GET",
"url": "/api/{session}/groups/join-info?code=<REDACTED_INVITE_CODE>",
"query": {
"code": "<REDACTED_INVITE_CODE>"
}
},
"res": {
"statusCode": 200
},
"responseTime": 426,
"msg": "request completed"
}

{
"level": 30,
"req": {
"method": "GET",
"url": "/api/sessions/{session}/me"
},
"res": {
"statusCode": 200
},
"responseTime": 1,
"msg": "request completed"
}

{
"level": 30,
"req": {
"method": "GET",
"url": "/api/{session}/lids/pn/<REDACTED_PHONE>%40c.us"
},
"res": {
"statusCode": 200
},
"responseTime": 4,
"msg": "request completed"
}

{
"level": 30,
"req": {
"method": "POST",
"url": "/api/{session}/groups/join"
},
"res": {
"statusCode": 500
},
"err": {
"type": "Error",
"message": "Cannot read properties of undefined (reading 'joinGroupViaInvite')",
"stack": "TypeError: Cannot read properties of undefined (reading 'joinGroupViaInvite')\n at WebjsClientCore.acceptInvite (/app/node_modules/whatsapp-web.js/src/Client.js:2134:21)\n at GroupsController.joinGroup (/app/dist/api/groups.controller.js:43:20)"
},
"responseTime": 13,
"msg": "request errored"
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions