Skip to main content

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.

The People module is the role layer of Gobarau Academy’s identity system. Every individual in the system starts as a Person record in the Accounts app; the People app then builds specialised, role-specific profiles on top of that identity. A single person can simultaneously hold a student profile, a parent profile, or eventually an alumni profile — each captured in its own resource with fields relevant to that role. The six endpoints below cover every profile type, as well as the cross-cutting concerns of class enrollment history and parent-student guardian relationships.
All profile models (StudentProfile, TeacherProfile, ParentProfile, AlumniProfile) extend SoftDeleteModel. Records are never hard-deleted — they are archived (soft-deleted) and can be restored. Filtering on is_deleted=False is applied automatically by the default queryset manager.

Authentication & Permissions

All People endpoints require:
  • A valid Bearer token in the Authorization header.
  • The authenticated user must hold a Staff or Admin role (IsStaffOrAdmin permission class).
Authorization: Bearer <your_access_token>

Students

Manage student role profiles. Each StudentProfile is linked one-to-one with a Person identity record and tracks the student’s admission number, enrollment status, and current class placement.

List / Create Students

Authorization
string
required
Bearer token. Requires IsStaffOrAdmin permission.
GET  /api/people/students/
POST /api/people/students/

Retrieve / Update / Delete Student

GET    /api/people/students/{id}/
PUT    /api/people/students/{id}/
PATCH  /api/people/students/{id}/
DELETE /api/people/students/{id}/

Request Fields

person
integer
required
Primary key of the linked Person (accounts app). One-to-one — each person may have at most one student profile.
admission_number
string
required
Unique admission identifier for the student (max 20 characters). Used as the primary human-readable key across the school system.
enrollment_status
string
default:"active"
Current enrollment status of the student. One of:
ValueLabel
activeActive
graduatedGraduated
withdrawnWithdrawn
transferredTransferred
repeatedRepeated
date_admitted
string (date)
ISO 8601 date on which the student was admitted, e.g. "2024-09-01". Optional.
class_assigned
integer
Foreign key to academics.Class. The class the student is currently placed in. Nullable.
wing
integer
Foreign key to administration.Wing. The school wing (e.g. Regular, Islamiyyah, Tahfeez). Nullable.
campus
integer
Foreign key to administration.Campus. The campus the student attends. Nullable.

Example — Create a Student Profile

curl -X POST https://api.gobarau.edu.ng/api/people/students/ \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "person": 42,
    "admission_number": "GBA/2024/001",
    "enrollment_status": "active",
    "date_admitted": "2024-09-01",
    "class_assigned": 3,
    "wing": 1,
    "campus": 1
  }'

Example Response

{
  "id": 101,
  "person": 42,
  "admission_number": "GBA/2024/001",
  "enrollment_status": "active",
  "date_admitted": "2024-09-01",
  "class_assigned": 3,
  "wing": 1,
  "campus": 1,
  "is_deleted": false,
  "created_at": "2024-09-01T08:00:00Z",
  "updated_at": "2024-09-01T08:00:00Z"
}

Teachers

Manage teacher role profiles. A TeacherProfile is linked one-to-one with a Person and stores employment details, qualifications, and website visibility settings.
GET  /api/people/teachers/
POST /api/people/teachers/
GET    /api/people/teachers/{id}/
PUT    /api/people/teachers/{id}/
PATCH  /api/people/teachers/{id}/
DELETE /api/people/teachers/{id}/

Request Fields

person
integer
required
Primary key of the linked Person. One-to-one — each person may have at most one teacher profile.
staff_number
string
required
Unique staff identifier (max 20 characters).
date_employed
string (date)
ISO 8601 date of employment commencement. Optional.
qualification
string
Highest academic qualification held by the teacher (max 200 characters). Optional.
specialization
string
Subject area or teaching specialization (max 200 characters). Optional.
is_active
boolean
default:"true"
Whether the teacher is currently active in the school. Inactive teachers are excluded from scheduling and timetable assignments.
show_on_website
boolean
default:"true"
Whether the teacher’s profile should appear on the school’s public website staff listing.

Example — Create a Teacher Profile

curl -X POST https://api.gobarau.edu.ng/api/people/teachers/ \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "person": 15,
    "staff_number": "GBA/STF/0042",
    "date_employed": "2021-01-10",
    "qualification": "B.Sc. Mathematics",
    "specialization": "Mathematics",
    "is_active": true,
    "show_on_website": true
  }'

Example Response

{
  "id": 22,
  "person": 15,
  "staff_number": "GBA/STF/0042",
  "date_employed": "2021-01-10",
  "qualification": "B.Sc. Mathematics",
  "specialization": "Mathematics",
  "is_active": true,
  "show_on_website": true,
  "is_deleted": false,
  "created_at": "2021-01-10T09:00:00Z",
  "updated_at": "2021-01-10T09:00:00Z"
}

Parents

Manage parent and guardian role profiles. A ParentProfile captures a guardian’s occupational details and flags whether they are a primary guardian. Parent-to-student links are managed separately via the Ward Relationships endpoint.
GET  /api/people/parents/
POST /api/people/parents/
GET    /api/people/parents/{id}/
PUT    /api/people/parents/{id}/
PATCH  /api/people/parents/{id}/
DELETE /api/people/parents/{id}/

Request Fields

person
integer
required
Primary key of the linked Person. One-to-one — each person may have at most one parent profile.
occupation
string
The parent’s occupation or job title (max 200 characters). Optional.
employer
string
The parent’s current employer or place of work (max 200 characters). Optional.
is_primary_guardian
boolean
default:"false"
Whether this parent is designated as the primary guardian for their ward(s). Note: the primary guardian flag is also set at the WardRelationship level for per-student granularity.

Example — Create a Parent Profile

curl -X POST https://api.gobarau.edu.ng/api/people/parents/ \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "person": 88,
    "occupation": "Civil Engineer",
    "employer": "Julius Berger Nigeria PLC",
    "is_primary_guardian": true
  }'

Example Response

{
  "id": 55,
  "person": 88,
  "occupation": "Civil Engineer",
  "employer": "Julius Berger Nigeria PLC",
  "is_primary_guardian": true,
  "is_deleted": false,
  "created_at": "2024-08-15T10:30:00Z",
  "updated_at": "2024-08-15T10:30:00Z"
}

Alumni

Manage alumni role profiles. An AlumniProfile extends a person’s identity with post-graduation details including career information, location, mentorship availability, and public recognition flags such as the Wall of Fame.
GET  /api/people/alumni/
POST /api/people/alumni/
GET    /api/people/alumni/{id}/
PUT    /api/people/alumni/{id}/
PATCH  /api/people/alumni/{id}/
DELETE /api/people/alumni/{id}/

Request Fields

person
integer
required
Primary key of the linked Person. One-to-one — each person may have at most one alumni profile.
student_profile
integer
Optional foreign key to the alumnus’s StudentProfile (if they were a registered student in the system). One-to-one, nullable.
graduation_year
integer
required
Four-digit year of graduation, e.g. 2019.
final_class
integer
Foreign key to academics.Class representing the class from which the alumnus graduated. Nullable.
career_field
string
Broad career field or industry, e.g. "Medicine", "Engineering" (max 200 characters). Optional.
current_employer
string
Name of the alumnus’s current employer (max 200 characters). Optional.
university_attended
string
University or higher institution attended after Gobarau Academy (max 200 characters). Optional.
city
string
City of current residence (max 100 characters). Optional.
country
string
default:"Nigeria"
Country of current residence (max 100 characters).
linkedin_url
string (URL)
Full LinkedIn profile URL. Optional.
is_available_for_mentorship
boolean
default:"false"
Whether the alumnus has opted in to mentor current students.
mentorship_areas
string
Free-text description of areas the alumnus can offer mentorship in. Only meaningful when is_available_for_mentorship is true.
is_verified
boolean
default:"false"
Whether the alumni record has been verified by school administration. Typically set by staff, not self-reported.
is_on_wall_of_fame
boolean
default:"false"
Whether the alumnus is featured on the school’s Wall of Fame. Set by administration.

Example — Create an Alumni Profile

curl -X POST https://api.gobarau.edu.ng/api/people/alumni/ \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "person": 200,
    "student_profile": 101,
    "graduation_year": 2019,
    "final_class": 12,
    "career_field": "Medicine",
    "current_employer": "Aminu Kano Teaching Hospital",
    "university_attended": "Bayero University Kano",
    "city": "Kano",
    "country": "Nigeria",
    "linkedin_url": "https://linkedin.com/in/example-alumnus",
    "is_available_for_mentorship": true,
    "mentorship_areas": "Medical school applications, study habits",
    "is_verified": false,
    "is_on_wall_of_fame": false
  }'

Example Response

{
  "id": 7,
  "person": 200,
  "student_profile": 101,
  "graduation_year": 2019,
  "final_class": 12,
  "career_field": "Medicine",
  "current_employer": "Aminu Kano Teaching Hospital",
  "university_attended": "Bayero University Kano",
  "city": "Kano",
  "country": "Nigeria",
  "linkedin_url": "https://linkedin.com/in/example-alumnus",
  "is_available_for_mentorship": true,
  "mentorship_areas": "Medical school applications, study habits",
  "is_verified": false,
  "is_on_wall_of_fame": false,
  "is_deleted": false,
  "created_at": "2024-07-10T14:00:00Z",
  "updated_at": "2024-07-10T14:00:00Z"
}

Enrollments

Track a student’s class enrollment across academic sessions and terms. Each ClassEnrollment record anchors a student to a specific class for a given session and term. The combination of student, class_assigned, session, and term must be unique — a student cannot be enrolled in the same class twice within the same session-term.
GET  /api/people/enrollments/
POST /api/people/enrollments/
GET    /api/people/enrollments/{id}/
PUT    /api/people/enrollments/{id}/
PATCH  /api/people/enrollments/{id}/
DELETE /api/people/enrollments/{id}/
The unique_together constraint on (student, class_assigned, session, term) means attempting to create a duplicate enrollment will return a 400 Bad Request with a validation error. Always verify the student is not already enrolled before posting.

Request Fields

student
integer
required
Foreign key to StudentProfile. The student being enrolled.
class_assigned
integer
required
Foreign key to academics.Class. The class the student is enrolling into.
session
integer
required
Foreign key to administration.AcademicSession. The academic session for this enrollment.
term
integer
required
Foreign key to administration.Term. The term within the session.
is_active
boolean
default:"true"
Whether this enrollment is currently active. Set to false to deactivate without deleting the historical record.
date_enrolled is set automatically to the current date (auto_now_add=True) and is not accepted in the request body.

Example — Create an Enrollment

curl -X POST https://api.gobarau.edu.ng/api/people/enrollments/ \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "student": 101,
    "class_assigned": 3,
    "session": 5,
    "term": 2,
    "is_active": true
  }'

Example Response

{
  "id": 350,
  "student": 101,
  "class_assigned": 3,
  "session": 5,
  "term": 2,
  "date_enrolled": "2024-09-01",
  "is_active": true,
  "created_at": "2024-09-01T07:45:00Z",
  "updated_at": "2024-09-01T07:45:00Z"
}

Ward Relationships

Define and manage the guardian-to-student relationships between parent profiles and student profiles. A WardRelationship links a ParentProfile to a StudentProfile with metadata about the relationship type and pickup authorisation. The combination of parent and student must be unique.
GET  /api/people/ward-relationships/
POST /api/people/ward-relationships/
GET    /api/people/ward-relationships/{id}/
PUT    /api/people/ward-relationships/{id}/
PATCH  /api/people/ward-relationships/{id}/
DELETE /api/people/ward-relationships/{id}/
The unique_together constraint on (parent, student) prevents duplicate guardian links. Attempting to create a second relationship between the same parent and student returns a 400 Bad Request.

Request Fields

parent
integer
required
Foreign key to ParentProfile. The guardian in the relationship.
student
integer
required
Foreign key to StudentProfile. The ward (student) in the relationship.
relationship_type
string
A free-text label describing the relationship, e.g. "Father", "Mother", "Uncle" (max 50 characters). Optional.
is_primary_guardian
boolean
default:"false"
Whether this parent is the primary guardian for this particular student. Multiple parents can be linked to the same student, but typically only one should be marked as primary.
can_pickup
boolean
default:"true"
Whether this guardian is authorised to collect the student from school. This flag is used by the gate and attendance management systems.

Example — Create a Ward Relationship

curl -X POST https://api.gobarau.edu.ng/api/people/ward-relationships/ \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "parent": 55,
    "student": 101,
    "relationship_type": "Father",
    "is_primary_guardian": true,
    "can_pickup": true
  }'

Example Response

{
  "id": 78,
  "parent": 55,
  "student": 101,
  "relationship_type": "Father",
  "is_primary_guardian": true,
  "can_pickup": true,
  "created_at": "2024-09-01T08:10:00Z",
  "updated_at": "2024-09-01T08:10:00Z"
}

Build docs developers (and LLMs) love