Retrieve User Group
Retrieve a specific user group by its unique ID.
HTTP Request
GET/api/users/groups/:id
Authorization
Authorization
- Required: Yes
- Permission: Staff or Admin
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | Integer | Yes | Unique ID of the user group to retrieve |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3api = requests.Session()
4api.headers.update({'Authorization': 'Token XXXXXXXXXXXXXXXXXXXXXX'})
5response = api.get('http://www.example.com/api/users/groups/1')
6print(response.json())1curl "http://www.example.com/api/users/groups/1" -H "Authorization: Token XXXXXXXXXXXXXXXXXXXXXX"Status Codes
| Code | Description |
|---|---|
| 200 | User group retrieved successfully |
| 400 | Bad request — invalid parameters |
| 401 | Unauthorized — authentication required |
| 403 | Forbidden — insufficient permissions |
| 404 | Not found — user group does not exist |
| 500 | Internal server error |
Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the user group |
| name | String | Name of the user group |
| notes | String | Description or purpose of the user group |
| users_count | Integer | Number of users in the group |
| created_at | String | Timestamp when the group was created |
| updated_at | String | Timestamp when the group was last updated |
Example Response
{
"id": 1,
"name": "Administrators",
"notes": "Group for site administrators with full permissions",
"users_count": 5,
"created_at": "2023-01-01T12:00:00Z",
"updated_at": "2023-06-01T12:00:00Z"
}