How do you add an existing member to a team

Hey, i was wondering how you would add an existing member in an org to a team. the docs don't seem to cover this.
7 Replies
Ping
Ping5mo ago
You can call inviteMember with a teamId
Soccerjunki
SoccerjunkiOP5mo ago
i get
{
"code": "USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION",
"message": "User is already a member of this organization"
}
{
"code": "USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION",
"message": "User is already a member of this organization"
}
anilcngz
anilcngz2mo ago
Should we use addTeamMember to add a user to new team who is already in the organization. Because as @Soccerjunki pointed out, if I use inviteMember it gives: { "code": "USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION", "message": "User is already a member of this organization", "status": 400, "statusText": "BAD_REQUEST" } even inviteMember has the new teamId const { error } = await authClient.organization.inviteMember({ email: values.email, // required role: selectedRoles, // required organizationId: session.session.activeOrganizationId, resend: true, teamId: session.session.activeTeamId, });
Ping
Ping2mo ago
Yeah use addTeamMember, this wasn't here previously so my response was out-dated and incorrect.
anilcngz
anilcngz2mo ago
@Ping if I use addTeamMember, then I can't set roles. v1.3 supports multi team for a user but it looks like it doesn't support different roles in teams, am I right?
Ping
Ping2mo ago
Yeah.
FalconiZzare
FalconiZzare2mo ago
Hi, any plan on supporting it soon?

Did you find this page helpful?