Appwrite
  1. teams
Appwrite
  • account
    • Delete Account
      DELETE
    • Get Account
      GET
    • Create Account
      POST
    • Update Account Email
      PATCH
    • Create Account JWT
      POST
    • Get Account Logs
      GET
    • Update Account Name
      PATCH
    • Update Account Password
      PATCH
    • Get Account Preferences
      GET
    • Update Account Preferences
      PATCH
    • Create Password Recovery
      POST
    • Complete Password Recovery
      PUT
    • Delete All Account Sessions
      DELETE
    • Get Account Sessions
      GET
    • Create Account Session
      POST
    • Create Anonymous Session
      POST
    • Create Account Session with OAuth2
      GET
    • Delete Account Session
      DELETE
    • Get Session By ID
      GET
    • Create Email Verification
      POST
    • Complete Email Verification
      PUT
  • avatars
    • Get Browser Icon
    • Get Credit Card Icon
    • Get Favicon
    • Get Country Flag
    • Get Image from URL
    • Get User Initials
    • Get QR Code
  • database
    • List Documents
    • Create Document
    • Delete Document
    • Get Document
    • Update Document
  • functions
    • List Executions
    • Create Execution
    • Get Execution
  • locale
    • Get User Locale
    • List Continents
    • List Countries
    • List EU Countries
    • List Countries Phone Codes
    • List Currencies
    • List Languages
  • storage
    • List Files
    • Create File
    • Delete File
    • Get File
    • Update File
    • Get File for Download
    • Get File Preview
    • Get File for View
  • teams
    • List Teams
      GET
    • Create Team
      POST
    • Delete Team
      DELETE
    • Get Team
      GET
    • Update Team
      PUT
    • Get Team Memberships
      GET
    • Create Team Membership
      POST
    • Delete Team Membership
      DELETE
    • Update Membership Roles
      PATCH
    • Update Team Membership Status
      PATCH
  1. teams

Create Team Membership

POST
/teams/{teamId}/memberships
teams
Use this endpoint to invite a new member to join your team. If initiated from Client SDK, an email with a link to join the team will be sent to the new member's email address if the member doesn't exist in the project it will be created automatically. If initiated from server side SDKs, new member will automatically be added to the team.
Use the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the Update Team Membership Status endpoint to allow the user to accept the invitation to the team. While calling from side SDKs the redirect url can be empty string.
Please note that in order to avoid a Redirect Attacks the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://appwrite.io/v1/teams//memberships' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "string",
    "name": "string",
    "roles": [
        "string"
    ],
    "url": "string"
}'
Response Response Example
{
    "$id": "string",
    "confirm": true,
    "email": "string",
    "invited": 0,
    "joined": 0,
    "name": "string",
    "roles": [
        "string"
    ],
    "teamId": "string",
    "userId": "string"
}

Request

Path Params
teamId
string 
required
Team unique ID.
Body Params application/json
email
string 
required
New team member email.
name
string 
optional
New team member name. Max length: 128 chars.
roles
array[string]
required
Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about roles and permissions. Max length for each role is 32 chars.
url
string 
required
URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an open redirect attack against your project API.
Examples

Responses

🟢201Membership
application/json
Body
Membership
$id
string 
required
Membership ID.
confirm
boolean 
required
User confirmation status, true if the user has joined the team or false otherwise.
email
string 
required
User email address.
invited
integer <int32>
required
Date, the user has been invited to join the team in Unix timestamp.
joined
integer <int32>
required
Date, the user has accepted the invitation to join the team in Unix timestamp.
name
string 
required
User name.
roles
array[string]
required
User list of roles
teamId
string 
required
Team ID.
userId
string 
required
User ID.
Modified at 2023-08-16 07:28:14
Previous
Get Team Memberships
Next
Delete Team Membership
Built with