Skip to main content

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

ParameterTypeRequiredDescription
idIntegerYesUnique ID of the user group to update

Request Body

FieldTypeRequiredDescription
nameStringNoName of the user group
notesStringNoNotes about the user group

Example Requests

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())

Status Codes

CodeDescription
200User group updated successfully
400Bad request — invalid input
401Unauthorized — authentication required
403Forbidden — insufficient permissions
404Not found — user group does not exist
500Internal server error

Response Fields

FieldTypeDescription
idIntegerUnique ID of the user group
nameStringName of the user group
notesString or nullOptional notes about the user group
_users_countIntegerNumber of users in the group
created_atString (ISO 8601)Timestamp when the group was created
updated_atString (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"
}