Back

AppwriteException: Team with the requested ID could not be found.

  • 0
  • Auth
  • Web
  • Cloud
n1klaus
24 May, 2024, 12:40

Can't get to add a user to a team with the following error.

Here is my code let membership = teams .createMembership(teamId, teamRole, email, undefined, undefined, URL, fullName) .then((response) => { console.log('Team Membership', response); return response; }) .catch((error) => { console.error(error); throw error; });

I have also tried using the browser directly with https://cloud.appwrite.io/v1/teams/teamId but i still get the error { "message": "Team with the requested ID could not be found.", "code": 404, "type": "team_not_found", "version": "1.5.6" }

TL;DR
AppwriteException: Team with the requested ID could not be found. Make sure to call account.get() before create membership. Verify teamID, check API endpoint, and user permissions. Double-check if 'client.setProject()' was called.
Ryan
24 May, 2024, 12:43

Have you confirmed that the team ID is correct?

Steven
24 May, 2024, 15:24

And the current user has the owner role in the team?

Preetam_vrl
27 May, 2024, 09:15

Verify the 'teamId' variable to ensure it contains the correct ID. Have you double checked Api endpoint?Check Permissions To access and modify team memberships.

n1klaus
27 May, 2024, 12:16

yes, Iam using the ID which i copied when the team was created

n1klaus
27 May, 2024, 12:16

yes i created the team

n1klaus
27 May, 2024, 12:17

for the permissions i get a different error with Unauthorized .. i had already confirmed that

Steven
27 May, 2024, 17:16

Please call account.get() before the create membership call and share the response of account.get() from the browser dev tools network log.

Please also share the request info like url and headers from the browser dev tools network log for the create membership call.

Lastly, please share the members of the team from the appwrite console

n1klaus
28 May, 2024, 10:50

This is the response of account.get()

n1klaus
28 May, 2024, 10:51
TypeScript
{
    "$id": "#",
    "$createdAt": "2024-05-28T10:36:42.817+00:00",
    "$updatedAt": "2024-05-28T10:36:42.817+00:00",
    "userId": "#",
    "expire": "2024-05-28T11:36:42.808+00:00",
    "provider": "email",
    "providerUid": "hobbit@mailinator.com",
    "providerAccessToken": "",
    "providerAccessTokenExpiry": "",
    "providerRefreshToken": "",
    "ip": "41.212.114.64",
    "osCode": "WIN",
    "osName": "Windows",
    "osVersion": "10",
    "clientType": "browser",
    "clientCode": "PS",
    "clientName": "Microsoft Edge",
    "clientVersion": "125.0",
    "clientEngine": "Blink",
    "clientEngineVersion": "125.0.0.0",
    "deviceName": "desktop",
    "deviceBrand": "",
    "deviceModel": "",
    "countryCode": "ke",
    "countryName": "Kenya",
    "current": true,
    "mfaUpdatedAt": ""
}
n1klaus
28 May, 2024, 10:52
Steven
28 May, 2024, 19:56

This isn't the response of account.get(). This is the session....but this was called right before the create membership call? What's the userId?

Steven
28 May, 2024, 19:59

For the create membership, I see

TypeScript
https://cloud.appwrite.io/v1/teams/highway_hospital_team/memberships

But I don't see the project set so you may not have called client.setProject()

Steven
28 May, 2024, 20:00

Deleting since there's a cookie. You might want to log out to kill your session cookies

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