Update User Group
Update an existing user group.
HTTP Request
PATCH/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 update |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| name | String | No | Name of the user group |
| notes | String | No | Notes about the user group |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2api = requests.Session()
3api.headers.update({'Authorization': 'Token XXXXXXXXXXXXXXXXXXXXXX'})
4response = api.put('http://www.example.com/api/users/groups/<ID>', json={
5 'name': 'Updated Group Name',
6 'notes': 'Updated notes for the group.'
7})
8print(response.json())1curl "http://example.com/api/users/groups/<ID>" -X PUT -H "Authorization: Token XXXXXXXXXXXXXXXXXXXXXX" -H "Content-Type: application/json" -d '{
2 "name": "Updated Group Name",
3 "notes": "Updated notes for the group."
4}'Status Codes
| Code | Description |
|---|---|
| 200 | User group updated successfully |
| 400 | Bad request — invalid input |
| 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 or null | Optional notes about the user group |
| _users_count | Integer | Number of users in the group |
| created_at | String (ISO 8601) | Timestamp when the group was created |
| updated_at | String (ISO 8601) | Timestamp when the group was last updated |
Example Response
{
"id": 1,
"name": "Updated Group Name",
"notes": "Updated notes for the group.",
"_users_count": 5,
"created_at": "2023-01-01T12:00:00Z",
"updated_at": "2023-01-02T15:30:00Z"
}