Skip to main content

Create A User Group

Create a new user group.

HTTP Request

POST/api/users/groups/
NOTE: NOT USING THE TRAILING SLASH AT THE END OF THE URL RESULTS TO A 500 SERVER ERROR

Authorization

Authorization

  • Required: Yes
  • Permission: Staff with GroupPermission or Admin
  • Permission Code: 1201
  • Authentication: Token-based (Authorization: Token <your_api_key>)

Request Body

FieldTypeRequiredDescription
nameStringYesGroup name (Unique)
notesStringNoGroup descriotion

Example Requests

1import requests
2
3api = requests.Session()
4api.headers.update({'Authorization': 'Token f4e75eab6e0f663a972d145478d6fc4b81762070'})
5response = api.post(
6  'http://www.example.com/api/users/groups/',
7  json={
8      'name': 'Engineering Team',
9      'notes': 'Responsible for product development and maintenance.'
10  }
11)
12print(response.json())

Response Fields

FieldTypeDescription
idIntegerGroup ID
nameStringGroup Name
notesStringDescription or purpose of the group.
users_countIntegerCurrent number of users in the group.
created_atString (ISO 8601)Group created date
updated_atString (ISO 8601)Group last updated date

Notes

  • The name field is unique.
  • The notes field is optional.