The Accounts API is built around a deliberate two-model architecture:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/muhammadbugaje/gobarau_backend/llms.txt
Use this file to discover all available pages before exploring further.
User handles authentication credentials, role assignment, and system access, while Person stores every piece of demographic and contact information about the human behind that account. A Person optionally links to a User via a one-to-one relationship — allowing the school to maintain identity records for individuals (such as parents or prospective students) who do not yet have login access. Together these two models form the identity backbone for all other modules in Gobarau Academy.
User vs Person design:
User is Django’s authentication record — it stores the login credentials, role, and wing assignment that govern what a principal, teacher, or student can access. Person is the demographic profile — it stores names, dates of birth, contact details, nationality, and any custom metadata. Keeping these concerns separate means you can manage a person’s demographic record independently of their login account, and you can bulk-import identity data before accounts are issued.Authentication Requirements
All endpoints in the Accounts API require a valid authenticated session or bearer token. The specific permission class varies by resource:| Endpoint | Permission |
|---|---|
/api/accounts/users/ | IsAuthenticated + IsAdminLevel |
/api/accounts/people/ | IsAuthenticated + IsStaffOrAdmin |
Users
The Users endpoint managesUser records — the authentication and authorisation layer for every person in the system. A user’s role determines their permissions across the entire API, and their wing places them in one of the school’s organisational divisions.
| Method | URL |
|---|---|
GET | /api/accounts/users/ |
POST | /api/accounts/users/ |
GET | /api/accounts/users/{id}/ |
PUT | /api/accounts/users/{id}/ |
PATCH | /api/accounts/users/{id}/ |
DELETE | /api/accounts/users/{id}/ |
Request Fields
Unique login username. Inherited from Django’s
AbstractUser.User’s email address. Inherited from
AbstractUser.First name on the authentication record. Inherited from
AbstractUser.Last name on the authentication record. Inherited from
AbstractUser.Login password. Should be sent only on creation or password-change requests. Django stores this as a hashed value.
Role assigned to the user. Controls permission level throughout the API. Must be one of:
Defaults to
| Value | Label |
|---|---|
super_admin | Super Admin |
principal | Principal |
vice_principal | Vice Principal |
bursar | Bursar |
teacher | Teacher |
student | Student |
parent | Parent |
alumni | Alumni |
nurse | School Nurse |
counsellor | Counsellor |
student.Wing the user belongs to. Must be one of:
Defaults to
| Value | Label |
|---|---|
regular | Regular |
islamiyyah | Islamiyyah |
tahfeez | Tahfeez |
regular.Indicates whether the user’s identity has been verified by an administrator. Defaults to
false.Free-form JSON object for storing user-specific UI or notification preferences. Defaults to
{}.Whether the user account is active. Inherited from
AbstractUser. Defaults to true.Response Fields
Database primary key.
Unique login username.
Email address.
First name.
Last name.
The user’s assigned role value (e.g.
"teacher", "student").Wing assignment value (e.g.
"regular", "tahfeez").Identity verification status.
JSON preferences object.
Whether this account is active.
Django admin site access flag. Inherited from
AbstractUser.Django superuser flag. Inherited from
AbstractUser.Timestamp of account creation. Inherited from
AbstractUser.Timestamp of the most recent login. Inherited from
AbstractUser.List of Django permission group IDs. Inherited from
AbstractUser.List of explicit Django permission IDs. Inherited from
AbstractUser.Examples
Response Example
People
The People endpoint managesPerson records — the full demographic and contact profile for every human in the system. A person may or may not have a linked User account. The full_name field is a read-only computed property assembled from first_name, middle_name, and last_name.
Person inherits from both SoftDeleteModel and AuditMixin. Soft-deleted records (where is_archived = true) are excluded from the default queryset but remain in the database. The response also includes created_by and updated_by audit fields.
| Method | URL |
|---|---|
GET | /api/accounts/people/ |
POST | /api/accounts/people/ |
GET | /api/accounts/people/{id}/ |
PUT | /api/accounts/people/{id}/ |
PATCH | /api/accounts/people/{id}/ |
DELETE | /api/accounts/people/{id}/ |
Request Fields
Primary key of the linked
User account. One-to-one — each user can have at most one Person record. Leave null for individuals who do not yet have a login account.Legal first name (max 100 characters).
Legal last name (max 100 characters).
Middle name (max 100 characters). Defaults to an empty string.
Name the person prefers to be called (max 100 characters). Defaults to an empty string.
Date of birth in
YYYY-MM-DD format. Nullable.Gender code. Must be one of:
Defaults to an empty string (not specified).
| Value | Label |
|---|---|
M | Male |
F | Female |
Nigerian state of origin. Must be one of the 36 state slugs (e.g.
"kano", "lagos", "fct") or left blank. Defaults to an empty string.Local Government Area (max 100 characters). Defaults to an empty string.
Religion of the person (max 50 characters). Defaults to an empty string.
Nationality (max 50 characters). Defaults to
"Nigerian".Primary contact phone number (max 20 characters). Indexed for fast lookup.
Secondary contact phone number (max 20 characters).
Personal email address (distinct from the login
User.email).Residential or contact address.
Profile photo. Uploaded to
people/photos/.National Identity Number (NIN) or equivalent (max 50 characters).
External reference or legacy system ID (max 100 characters).
Preferred language for communication (max 50 characters). Defaults to
"English".Arbitrary JSON object for additional structured data (e.g. custom intake form answers). Defaults to
{}.Response Fields
Database primary key.
Stable public identifier.
FK to the linked
User, or null if no account is linked.Read-only computed property. Assembled as
first_name + middle_name + last_name with blank middle names omitted.Legal first name.
Legal last name.
Middle name, or empty string.
Preferred name, or empty string.
Date of birth.
Gender code (
M, F, or empty string).Nigerian state slug, or empty string.
Local government area, or empty string.
Religion, or empty string.
Nationality.
Primary phone number.
Secondary phone number.
Personal email address.
Residential address.
Relative URL of the uploaded profile photo, or
null.National Identity Number, or empty string.
External reference ID, or empty string.
Preferred language.
Custom JSON metadata.
Whether this record has been soft-deleted.
Timestamp of archival, or
null if not archived.User PK who archived this record, or
null.Timestamp of record creation.
Timestamp of last update.
User PK of the creator.
User PK of the last editor.
Examples
Response Example
Endpoint Summary
| Resource | Base URL | Permission | Inherits |
|---|---|---|---|
| Users | /api/accounts/users/ | IsAdminLevel | Django AbstractUser |
| People | /api/accounts/people/ | IsStaffOrAdmin | SoftDeleteModel + AuditMixin |