appwrite/appwrite · error · Appwrite\Extend\Exception

team_invite_mismatch

team_invite_mismatch

Error message

Invite does not belong to current user ({email})

What it means

Error "Invite does not belong to current user ({email})" thrown in appwrite/appwrite.

Source

Thrown at src/Appwrite/Platform/Modules/Teams/Http/Memberships/Status/Update.php:107

            throw new Exception(Exception::MEMBERSHIP_NOT_FOUND);
        }

        $team = $authorization->skip(fn () => $dbForProject->getDocument('teams', $teamId));

        if ($team->isEmpty()) {
            throw new Exception(Exception::TEAM_NOT_FOUND);
        }

        if ($membership->getAttribute('teamInternalId') !== $team->getSequence()) {
            throw new Exception(Exception::TEAM_MEMBERSHIP_MISMATCH);
        }

        if (!$proofForToken->verify($secret, $membership->getAttribute('secret'))) {
            throw new Exception(Exception::TEAM_INVALID_SECRET);
        }

        if ($userId !== $membership->getAttribute('userId')) {
            throw new Exception(Exception::TEAM_INVITE_MISMATCH, 'Invite does not belong to current user (' . $targetUser->getAttribute('email') . ')');
        }

        $hasSession = !$targetUser->isEmpty();
        if (!$hasSession) {
            $targetUser->setAttributes($dbForProject->getDocument('users', $userId)->getArrayCopy()); // Get user
        }

        if ($membership->getAttribute('userInternalId') !== $targetUser->getSequence()) {
            throw new Exception(Exception::TEAM_INVITE_MISMATCH, 'Invite does not belong to current user (' . $targetUser->getAttribute('email') . ')');
        }

        if ($membership->getAttribute('confirm') === true) {
            throw new Exception(Exception::MEMBERSHIP_ALREADY_CONFIRMED);
        }

        $membership // Attach user to team
            ->setAttribute('joined', DateTime::now())
            ->setAttribute('confirm', true)

View on GitHub (pinned to ce3a85157f)

Solutions

  1. Accept the invitation with the account whose email matches the invite.
  2. Sign in as the invited user and retry.

When it happens

Trigger: Thrown at src/Appwrite/Platform/Modules/Teams/Http/Memberships/Status/Update.php:107 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of appwrite/appwrite@ce3a85157f (2026-08-18). Data as JSON: /api/errors/8b9250cefcdc2ee8. Report an issue: GitHub.