Users
Manages the users of the server.
Fields#
- pk: int
- username: str
- first_name: str
- last_name: str
- email: str
- is_active: bool (active or deleted)
- is_staff: bool
- is_superuser: bool
- date_joined: timestamp
- last_login: timestamp
Actions#
List#
Lists the users present on the server.
Method#
POST
URL#
/v1/users/list
Permissions#
Body (optional)#
Response#
- A JSON array of objects containing each user's fields
Create#
Creates a new user.
Method#
POST
URL#
/v1/users/create
Body#
- username: str
- password: str
- first_name: str
- last_name: str
- email: str
- is_active (optional): bool (active or deleted, default is true/active)
- is_staff (optional): bool (default is false)
Permissions#
Response#
- A JSON object containing the newly-created user's fields
Retrieve#
Gets the information about a specific user.
Method#
GET
URL#
/v1/users/{PK}
Parameters#
PK
: int (primary key of user)
Permissions#
Response#
- A JSON object containing the user's fields
Update#
Updates a specific user.
Method#
PUT
URL#
/v1/users/{PK}
Parameters#
PK
: int (primary key of user)
Body#
- username: str
- password: str
- first_name: str
- last_name: str
- email: str
- is_active (optional): bool (active or deleted, default is true/active)
- is_staff (optional): bool (default is false)
Permissions#
Response#
- A JSON object containing the updated user's fields
Partial Update#
Updates a specific user.
Method#
PATCH
URL#
/v1/users/{PK}
Parameters#
PK
: int (primary key of user)
Body#
- username (optional): str
- password (optional): str
- first_name (optional): str
- last_name (optional): str
- email (optional): str
- is_active (optional): bool (active or deleted, default is true/active)
- is_staff (optional): bool (default is false)
Permissions#
Response#
- A JSON object containing the updated user's fields
Destroy#
Marks a user as inactive.
Method#
DELETE
URL#
/v1/users/{PK}
Parameters#
PK
: int (primary key of user)
Permissions#
Get By Name#
Gets a user by username.
METHOD#
GET
URL#
/v1/users/{NAME}
Parameters#
NAME
: str (username of the user to retrieve)
Permissions#
Response#
- JSON object containing the fields of the user.