logo
AdminUpdate a user

Update a user

curl -X PATCH "https://mail.haltman.io/api/admin/users/123" \
  -H "Content-Type: application/json" \
  -H "X-CSRF-Token: YOUR_API_KEY" \
  -d '{
  "username": "John Doe",
  "email": "user@example.com",
  "password": "example_string",
  "is_active": true,
  "is_admin": true
}'
{
  "ok": true,
  "created": true,
  "updated": true,
  "deleted": true,
  "item": {
    "id": 123,
    "username": "John Doe",
    "email": "user@example.com",
    "email_verified_at": "2024-12-25T10:00:00Z",
    "is_active": 42,
    "is_admin": true,
    "created_at": "2024-12-25T10:00:00Z",
    "updated_at": "2024-12-25T10:00:00Z",
    "last_login_at": "2024-12-25T10:00:00Z"
  }
}
PATCH
/api/admin/users/{id}
PATCH
API Key (cookie: __Host-access)
__Host-accessstring
Required

Access-session cookie used for user and admin authentication.

Access-session cookie used for user and admin authentication.
API Key (header: X-CSRF-Token)
X-CSRF-Tokenstring
Required

CSRF token derived from the current session family.

CSRF token derived from the current session family.
path
idinteger
Required

Resource identifier.

Content-Typestring
Required

The media type of the request body

Options: application/json
usernamestring
Min length: 1 • Max length: 64
emailstring
Format: email
passwordstring
Min length: 8 • Max length: 128
Request Preview
Response

Response will appear here after sending the request

Authentication

path
parameterstring
Required

API Key for authentication. Access-session cookie used for user and admin authentication.

header
X-CSRF-Tokenstring
Required

API Key for authentication. CSRF token derived from the current session family.

Path Parameters

idinteger
Required

Resource identifier.

Responses

okboolean
Required
createdboolean
updatedboolean
deletedboolean
itemobject
Required