# Create Team User

Create Team User

Method: POST

# Endpoint:

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

# Parameter:

Form Index Required Type Description
email Yes Email User email.

# 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@serveravatar.com"
  }'

# Response:

# Team User Create:

  • 200 (Ok)
{
  "teamUser": {
    "id": 1854,
    "team_id": 1101,
    "user_id": 1812,
    "role": 2,
    "created_at": "2020-02-22 16:56:54",
    "updated_at": "2020-02-22 16:56:54",
  },
  "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!"
}