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
| Field | Type | Required | Description |
|---|---|---|---|
| name | String | Yes | Group name (Unique) |
| notes | String | No | Group descriotion |
Example Requests
- 🐍 Python
- 🌐 Curl
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())1curl "http://www.example.com/api/users/groups/" -X POST -H "Authorization: Token XXXXXXXXXXXXXXXXXXXXXX" -H "Content-Type: application/json" -d '{
2 "name": "Global Interactions Specialist",
3 "notes": "Necessitatibus et sunt autem nisi enim."
4}'Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Group ID |
| name | String | Group Name |
| notes | String | Description or purpose of the group. |
| users_count | Integer | Current number of users in the group. |
| created_at | String (ISO 8601) | Group created date |
| updated_at | String (ISO 8601) | Group last updated date |
Notes
- The
namefield is unique. - The
notesfield is optional.