Path parameters

  • user_id integer Required

    Minimum value is 0, maximum value is 2147483647.

application/json

Body Required

  • username string

    Maximum length is 64.

  • password string

    Maximum length is 256.

  • role_id integer

    Minimum value is 0.0, maximum value is 2147483647.0.

Responses

  • 200 application/json

    Successful Response

    Hide response attributes Show response attributes object
    • user_id integer Required
    • username string Required
    • avatar string | null Required
    • role_id integer Required
    • created_at integer Required
  • 503 application/json

    Database connection error

    Hide response attribute Show response attribute object
    • detail string

      Default value is Can't connect to MySQL server on '[SERVER]'.

  • 400 application/json

    Database update error

    Hide response attribute Show response attribute object
    • detail string

      Default value is Duplicate entry '...' for key '...'.

  • 401 application/json

    Invalid access token

    Hide response attribute Show response attribute object
    • detail string

      Default value is Couldn't validate credentials.

  • 403 application/json

    Access token not entered

    Hide response attribute Show response attribute object
    • detail string

      Default value is Not authenticated.

  • 422 application/json

    Validation Error

    Hide response attribute Show response attribute object
    • detail array[object]
      Hide detail attributes Show detail attributes object
      • loc array[string | integer] Required
      • msg string Required
      • type string Required
PATCH /api/users/{user_id}
curl \
 -X PATCH https://lztup.toil.cc/api/users/{user_id} \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"username":"string","password":"string","role_id":42}'
Request example
{
  "username": "string",
  "password": "string",
  "role_id": 42
}
Request examples
{
  "username": "string",
  "password": "string",
  "role_id": 42
}
Response examples (200)
{
  "user_id": 42,
  "username": "string",
  "avatar": "string",
  "role_id": 42,
  "created_at": 42
}
Response examples (503)
{
  "detail": "Can't connect to MySQL server on '[SERVER]'"
}
Response examples (400)
{
  "detail": "Duplicate entry '...' for key '...'"
}
Response examples (401)
{
  "detail": "Couldn't validate credentials"
}
Response examples (403)
{
  "detail": "Not authenticated"
}
Response examples (422)
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}