Users API
The Users API provides endpoints for managing users in Joomla.
Base URL
/api/index.php/v1/users
Endpoints Overview
| Method | Endpoint | Description |
|---|---|---|
| GET | /users | Retrieve all users |
| GET | /users/{id} | Retrieve specific user |
| POST | /users | Create new user |
| PATCH | /users/{id} | Update user |
| DELETE | /users/{id} | Delete user |
Retrieve all users
GET /api/index.php/v1/users
Response
{
"data": [
{
"type": "users",
"id": "42",
"attributes": {
"name": "John Doe",
"username": "johndoe",
"email": "john@example.com",
"registerDate": "2024-01-01 12:00:00",
"lastvisitDate": "2024-10-26 10:30:00",
"block": 0
}
}
]
}
Retrieve specific user
GET /api/index.php/v1/users/{id}
Parameters
| Parameter | Type | Description |
|---|---|---|
| id | integer | User ID |
Example
curl -X GET "https://yoursite.com/api/index.php/v1/users/42" \
-H "X-Joomla-Token: YOUR_API_TOKEN"
Create user
POST /api/index.php/v1/users
Request Body
{
"name": "Jane Doe",
"username": "janedoe",
"email": "jane@example.com",
"password": "SecurePassword123!",
"groups": [2]
}
Required fields
| Field | Type | Description |
|---|---|---|
| name | string | Full name |
| username | string | Username (unique) |
| string | Email address (unique) | |
| password | string | Password |
Optional fields
| Field | Type | Default | Description |
|---|---|---|---|
| groups | array | [2] | Group IDs |
| block | int | 0 | Blocked (0=no, 1=yes) |
| params | object | Extra parameters |
Example
curl -X POST "https://yoursite.com/api/index.php/v1/users" \
-H "X-Joomla-Token: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Jane Doe",
"username": "janedoe",
"email": "jane@example.com",
"password": "SecurePassword123!",
"groups": [2]
}'
Update user
PATCH /api/index.php/v1/users/{id}
Request Body
{
"name": "Jane Smith",
"email": "jane.smith@example.com"
}
Example
curl -X PATCH "https://yoursite.com/api/index.php/v1/users/42" \
-H "X-Joomla-Token: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Jane Smith",
"email": "jane.smith@example.com"
}'
Delete user
DELETE /api/index.php/v1/users/{id}
Example
curl -X DELETE "https://yoursite.com/api/index.php/v1/users/42" \
-H "X-Joomla-Token: YOUR_API_TOKEN"
Note
Deleting a user is permanent and cannot be undone.
Block/Unblock user
To block a user, use the PATCH method:
curl -X PATCH "https://yoursite.com/api/index.php/v1/users/42" \
-H "X-Joomla-Token: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"block": 1}'
User Groups
Default Joomla Groups
| ID | Name | Description |
|---|---|---|
| 1 | Public | Public access |
| 2 | Registered | Registered users |
| 3 | Author | Authors |
| 4 | Editor | Editors |
| 5 | Publisher | Publishers |
| 6 | Manager | Managers |
| 7 | Administrator | Administrators |
| 8 | Super Users | Super Users |
Filtering
Search by name
GET /api/index.php/v1/users?filter[search]=john
By group
GET /api/index.php/v1/users?filter[group]=2
Blocked users
GET /api/index.php/v1/users?filter[block]=1
Related Endpoints
- User Fields - Custom fields for users
- User Field Groups - Grouping of custom fields