# Create Team User

Create a team user for the team.

# HTTP Request:

POST https://api.serveravatar.com/teams/{id}/users

# Parameter:

parameters Required Type Description
email Yes Email User email.

# Curl Request example:

curl --request POST \
  --url "https://api.serveravatar.com/teams/1101/users" \
  --header 'content-type: application/json' \
  --header 'accept: application/json' \
  --header 'Authorization: <YOUR API TOKEN>' \
  --data '{
    "email": "test@gmail.com"
  }'

# Response:

# Team User Create:

  • 200 (Ok)
{
  "teamUser": {
    "id": 4882,
    "team_id": 1101,
    "user_id": 967,
    "role": 2,
    "created_at": "2021-09-21 11:36:52",
    "updated_at": "2021-09-21 11:36:52"
  },
  "message": "Team user successfully created."
}

# Team User Already Join:

  • 500 (Internal Server Error)
{
  "message": "User is already in a team!"
}

# User Not Found:

  • 404 (Not Found)
{
  "message": "User not found."
}

# Team Not Found:

  • 404 (Not found)
{
  "message": "Team not found."
}

# Server Error

  • 500 (Internal Server Error)
{
  "message": "Something went really wrong!"
}