Ploi Core

Update user

Update user

Update a specific user

PATCH api/users/{user}

Parameters

Parameter Type Status Description
name string optional Maximum length: 255 characters
email email optional Maximum length: 255 characters, must be unique.
package_id null or int optional Must be the id of an existing package.
blocked null or string optional Unsuspend a user by passing null or "". Suspend a user by passing a string message, which is shown to the user.

Example request:

curl -X PATCH "https://panel.example.hosting.com/api/users/1" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
   --data '{"name": "Jane Doe", "email": "jane@doe.com", "package_id": 2, "blocked": "You are now blocked."}'

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "data": {
        "id": 1,
        "avatar": "https://www.gravatar.com/avatar/your-profile-hash?s=150",
        "name": "Jane Doe",
        "email": "jane@doe.com",
        "package_id": 2,
        "blocked": "You are now blocked.",
        "created_at": "2022-07-23T13:35:51.000000Z"
    },
}