
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"
}

Have you confirmed that the team ID is correct?

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

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.

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

yes i created the team

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

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

This is the response of account.get()

{
"$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": ""
}


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?

For the create membership, I see
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()

Deleting since there's a cookie. You might want to log out to kill your session cookies
Recommended threads
- my database attribute stuck in processin...
when i created attributes in collection 3 of those attributes become "processing", and they are not updating, the worst thing is that i cant even delete them s...
- Is Quick Start for function creation wor...
I am trying to create a Node.js function using the Quick Start feature. It fails and tells me that it could not locate the package.json file. Isn't Quick Start ...
- Forever Processing Issue
I encountered an issue when creating attributes in the collections . if you create an attribute of type string for example and choose a size of 200 or 250 or a...
