Adding Members to Organization with Teams Enabled

I am using the organization plugin with teams enabled and am trying to add members to the organization/team via the addMember API call:

await auth.api.addMember({
    body: {
      organizationId: <org_id>,
      userId: <user_id>,
      role: "admin",
      teamId: <team_id>, // this is not working
    },
  });


I am trying this but when I inspect my database table, I do not see the teamId being recorded into the database column. What am I missing?
Was this page helpful?