Account
Endpoints for managing the authenticated user's own account. Both endpoints act on the account that owns the token used in the request.
Get Account
GET /api/v1/account
Scope: read:account
Response
{
"data": {
"id": 1,
"username": "admin",
"full_name": "Admin User",
"email": "admin@example.com",
"role": "admin"
}
}
| Field | Type | Description |
|---|---|---|
id |
integer | User ID |
username |
string | Login name |
full_name |
string | Display name |
email |
string | Email address |
role |
string | admin or user |
Example
curl -H "Authorization: Bearer $TOKEN" \
https://panel.example.com/api/v1/account
Change Password
POST /api/v1/account/password
Scope: write:account
Changes the password for the authenticated user.
Request Body
{
"current_password": "oldpassword",
"new_password": "NewStrongPassphrase2024!",
"email": "admin@example.com"
}
| Field | Type | Required | Description |
|---|---|---|---|
current_password |
string | Yes | The user's current password |
new_password |
string | Yes | The new password |
email |
string | Conditional | Required if the account has an email on file; must match the account's email |
Password Requirements
- Minimum 8 characters
- Must score 3 or higher on the zxcvbn strength estimator (out of 4)
- Common passwords, dictionary words, keyboard patterns, and predictable sequences are rejected
Response
{
"data": {
"status": "ok"
}
}
Behavior
On success, all active panel sessions for this user are invalidated. The API token used to make the request remains valid, since API authentication is hash-based, not session-based.
Errors
| Code | Status | Condition |
|---|---|---|
invalid_request |
400 | A required field is missing, or the password is too weak |
unauthorized |
401 | current_password is wrong, or email does not match |
Example
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"current_password": "oldpass123",
"new_password": "NewStrongPassphrase2024!",
"email": "admin@example.com"
}' \
https://panel.example.com/api/v1/account/password
Related
- Authentication - token format and auth failures
- Responses - success response shape
- Errors - error codes