Skip to main content
PUT
/
player
/
{playerId}
Change Player Name
curl --request PUT \
  --url https://api.example.com/player/{playerId} \
  --header 'Content-Type: application/json' \
  --data '
{
  "newName": "<string>"
}
'
{
  "playerId": "<string>",
  "name": "<string>",
  "wins": 123,
  "losses": 123
}
Changes the name of an existing player. The new name must be valid and follow validation constraints.

Path Parameters

playerId
string
required
The unique identifier of the player whose name you want to change

Request Body

newName
string
required
The new name for the player. Must not be blank and cannot exceed 30 characters.Validation:
  • Cannot be blank
  • Maximum length: 30 characters

Response

playerId
string
The unique identifier of the player
name
string
The updated name of the player
wins
integer
The total number of games won by the player
losses
integer
The total number of games lost by the player

Request Example

curl -X PUT https://api.example.com/player/abc123 \
  -H "Content-Type: application/json" \
  -d '{
    "newName": "BlackjackPro"
  }'
{
  "newName": "BlackjackPro"
}

Response Example

{
  "playerId": "abc123",
  "name": "BlackjackPro",
  "wins": 15,
  "losses": 8
}

Build docs developers (and LLMs) love