Actions181
- Account Actions
- Get Account
- Create Account
- Update Email
- Update Name
- Update Password
- Update Phone
- Update Status
- Get Preferences
- Update Preferences
- List Sessions
- Delete Sessions
- Get Session
- Update Session
- Delete Session
- Create Anonymous Session
- Create Email/Password Session
- Create Magic URL Session
- Create OAuth2 Session
- Create Phone Session
- Create Session from Token
- Create JWT
- Create Magic URL
- Create Phone Token
- Create Email Verification
- Update Email Verification
- Create Phone Verification
- Update Phone Verification
- Create Password Recovery
- Update Password Recovery
- Create Recovery
- Update Recovery
- Update MFA
- Create MFA Authenticator
- Update MFA Authenticator
- Delete MFA Authenticator
- Create MFA Challenge
- Update MFA Challenge
- Attribute Actions
- Avatars Actions
- Collection Actions
- Database Actions
- Document Actions
- Functions Actions
- Index Actions
- Locale Actions
- Messaging Actions
- Sites Actions
- Storage Actions
- Teams Actions
- Users Actions
Teams → Create Membership
AI-generatedOverview
This node operation creates a membership in a specified team within the Appwrite platform. It allows inviting a user to join a team either by their email or user ID, assigning specific roles to the user, and optionally providing a URL to redirect the user after they accept the invitation. This operation is useful for managing team memberships programmatically, such as adding new contributors or members to a project team.
Use Case Examples
- Inviting a new user to a team by email with the role of 'member'.
- Adding an existing user to a team by their user ID and assigning multiple roles like 'member' and 'contributor'.
- Sending an invitation with a custom redirect URL after acceptance.
Properties
| Name | Meaning |
|---|---|
| Team ID | The unique identifier of the team where the membership will be created. |
| The email address of the user to invite to the team. If left empty, the User ID will be used instead. | |
| User ID | The unique identifier of the user to add to the team. If left empty, the Email will be used instead. |
| Roles | A comma-separated list of roles assigned to the user within the team membership. |
| URL | A URL to redirect the user to after they accept the team invitation. |
Output
JSON
membershipId- The unique identifier of the created team membership.teamId- The ID of the team to which the membership belongs.userId- The ID of the user who was added to the team.email- The email of the invited user, if used for invitation.roles- The roles assigned to the user in the team membership.invitationUrl- The URL provided for redirecting the user after accepting the invitation.
Dependencies
- Appwrite API key credential for authentication
Troubleshooting
- Ensure that either Email or User ID is provided; both cannot be empty.
- Verify that the Team ID is correct and that the authenticated user has permission to add members to the team.
- Check that the roles provided are valid and recognized by the Appwrite team management system.
- If the invitation URL is provided, ensure it is a valid and reachable URL to avoid redirect issues.
Links
- Appwrite Teams API - Create Membership - Official documentation for creating team memberships using the Appwrite API.