Create User Group
Create a new user group.
HTTP Request
POST/api/users/groups
Authorization
Authorization
- Required: Yes
- Permission: Staff or Admin
- Authentication: Token-based (Authorization: Token <your_api_key>)
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| name | String | Yes | Unique name of the group. |
| notes | String | No | Additional description or purpose of the group. |
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}'Status Codes
| Code | Description |
|---|---|
| 201 | User group created successfully |
| 400 | Bad request — invalid input |
| 401 | Unauthorized — authentication required |
| 403 | Forbidden — insufficient permissions |
| 500 | Internal server error |
Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the group. |
| name | String | Name of the group. |
| notes | String | Description or purpose of the 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. |
Notes
- The
namefield must be unique. - The
notesfield is optional.