
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
- Billing issue
Hey, i recently Purchased the Pro Plan on Appwrite but I've changed my mind id there any way i xould cancel the Pro use the Free Tier and get my refund?
- mcp-for-docs not working properly
I'm experiencing issues integrating the MCP server tool with Cursor IDE. The MCP server connection establishes successfully initially but fails after one minute...
- When connecting to VCS (Version Control ...
Hello, when I try to define in my function the root path of a function I get this when I click "Update".
