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

Issue creating team membership with USER_ID & TEAM_ID

  • 0
  • Functions
Ankit Maniya
7 May, 2025, 17:55

Log time ago it worked without any issue when I made a demo app but now it is not working in cloud function. code

TypeScript
                ?.createMembership(
                    teamId: inviteCodeDocument.$id,
                    roles: [e_ROLE_STATUS.REGULAR_USER.name],
                    userId: pbMessage.dbUserId)
                .then((membership) async {
              print("Membership :: ${membership.toMap()}");
            }).catchError((e) {
              print("Error creating memberships: $e");
              eStatus = e_STATUS.OPERATION_FAILED;
            });```
Error:
```Error creating memberships: AppwriteException: general_argument_invalid, URL is required (400)```
TL;DR
Issue: Developer encountering error "Error creating memberships: AppwriteException: general_argument_invalid, URL is required (400)" when trying to create team membership using USER_ID and TEAM_ID. Solution: The error is caused by a missing URL parameter in the "createMembership" function. Ensure to specify the URL parameter in the function call to resolve the issue.
Ankit Maniya
7 May, 2025, 17:59

I think the main difference is I am setting up the awClient.setSession(awUserSessionSecret);

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