Skip to content
Init is coming / May 19 - 23
Back

Get current users team

  • 0
  • Web
TedGreg2022
16 May, 2025, 11:04

Hey for one of my use cases I need to get my current logged in user's team. But by default the scope to read the team is not added.

TypeScript
    const teams = appwriteClient.teams;
    const myTeams = await teams.list();

The above code returns :

TypeScript
api-1       |     message: 'User (role: guests) missing scope (teams.read)',
api-1       |     code: 401,
api-1       |     type: 'general_unauthorized_scope',
api-1       |     version: '1.6.2'
api-1       |   }

How do I add the teams.read scope. I'm using the node-sdk with google oauth2.

I can add scopes, but these are internal google oauth scopes, not appwrite ones.

TL;DR
Developers are trying to get the current user's team using Appwrite, but they are facing an unauthorized scope issue. The error message indicates that the user is missing the 'teams.read' scope. To resolve this, they need to add the 'teams.read' scope in the Appwrite settings, not the internal Google OAuth scopes.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more