Skip to main content

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

ParameterTypeRequiredDescription
idIntegerYesUnique ID of the user group to retrieve

Example Requests

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

Status Codes

CodeDescription
200User group retrieved successfully
400Bad request — invalid parameters
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
notesStringDescription or purpose of the user group
users_countIntegerNumber of users in the group
created_atStringTimestamp when the group was created
updated_atStringTimestamp 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"
}