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 Content module powers the public-facing side of Gobarau Academy’s platform — everything a prospective family, current student, or returning alumnus might browse on the school website. It provides structured endpoints for publishing school news articles, listing upcoming events, organising photo galleries, distributing magazine issues and their articles, commemorating graduating classes through the yearbook, and showcasing testimonials from parents and alumni. All GET and retrieve actions on every content endpoint are fully public (no authentication required) via ContentPublicReadOnlyModelViewSet, while POST, PUT, PATCH, and DELETE operations require an authenticated staff or admin user. Image and file uploads are handled via Django’s file storage backend.
All image and file fields (featured_image, cover_image, image, photo, pdf_url, etc.) are stored via Django’s configured file storage. Send these as multipart/form-data requests when uploading files.

News Categories

News categories provide organisational taxonomy for news posts. The slug field is automatically generated from the category name on first save — you do not need to supply it.

List & Create News Categories

Endpoint: GET/POST /api/content/news-categories/ Permissions: GET — public · POST/PUT/PATCH/DELETEIsAuthenticated, IsStaffOrAdmin

Request Fields (POST)

name
string
required
Unique category name (max 100 characters). Must be unique across all categories.
slug
string
URL-friendly slug (max 120 characters). Auto-generated from name if omitted.
description
string
Optional longer description of the category. Defaults to empty string.

Example — Create a news category

curl -X POST https://api.gobarau.edu.ng/api/content/news-categories/ \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Academic Excellence",
    "description": "News celebrating student and staff academic achievements."
  }'

Response Fields

id
integer
Auto-incrementing integer primary key for the category.
public_id
uuid
Unique public UUID identifier for the category (from BaseModel).
name
string
Category name.
slug
string
Auto-generated URL slug derived from the name.
description
string
Category description.
created_at
string (datetime)
Record creation timestamp (from BaseModel).
updated_at
string (datetime)
Last modification timestamp (from BaseModel).

News Posts

News posts are the primary editorial content published on the school website. Posts can be drafted before publishing and optionally featured to highlight them on the homepage.
Only posts with is_published: true should be surfaced on the public-facing website. Always check this flag when querying posts for display. The slug field is auto-generated from the title on first save; supply it explicitly if you need a custom URL-friendly identifier.

List & Create News Posts

Endpoint: GET/POST /api/content/news-posts/ Permissions: GET — public · POST/PUT/PATCH/DELETEIsAuthenticated, IsStaffOrAdmin

Request Fields (POST)

title
string
required
Article headline (max 200 characters).
slug
string
URL slug (max 220 characters). Auto-generated from title if left blank. Must be unique.
body
string
required
Full article body text (HTML or plain text).
category
integer
Primary key of the NewsCategory. Set to null for uncategorised posts.
Optional hero image for the article. Upload as multipart/form-data.
published_at
string (datetime)
ISO 8601 datetime for the post’s publication date. Can be a future date to schedule a post.
When true, the post is highlighted in featured/homepage sections. Defaults to false.
is_published
boolean
Whether the post is live and publicly visible. Defaults to false. Set to true to publish.

Example — Create and immediately publish a news post

curl -X POST https://api.gobarau.edu.ng/api/content/news-posts/ \
  -H "Authorization: Bearer <token>" \
  -F "title=Gobarau Students Sweep State Mathematics Olympiad" \
  -F "body=<p>Students from Gobarau Academy claimed first, second, and third place at the 2025 Katsina State Mathematics Olympiad held on Friday 17th January...</p>" \
  -F "category=3" \
  -F "published_at=2025-01-18T09:00:00Z" \
  -F "is_featured=true" \
  -F "is_published=true" \
  -F "featured_image=@/path/to/olympiad-winners.jpg"

Response Fields

id
integer
Auto-incrementing integer primary key for the post.
public_id
uuid
Unique public UUID identifier for the post (from AuditMixinBaseModel).
title
string
Article headline.
slug
string
Auto-generated or custom URL slug.
body
string
Full article body.
category
integer | null
Foreign key to the NewsCategory, or null.
URL of the uploaded image, or null.
published_at
string (datetime) | null
Publication datetime.
Whether the post is featured.
is_published
boolean
Whether the post is publicly visible.
created_by
integer | null
Primary key of the User who created the post (from AuditMixin).
updated_by
integer | null
Primary key of the User who last updated the post (from AuditMixin).
created_at
string (datetime)
Record creation timestamp (from AuditMixinBaseModel).
updated_at
string (datetime)
Last modification timestamp (from AuditMixinBaseModel).

Events

The Events endpoint surfaces upcoming and past school events on the public calendar. Each event can have a cover image and be flagged as public or internal-only.

List & Create Events

Endpoint: GET/POST /api/content/events/ Permissions: GET — public · POST/PUT/PATCH/DELETEIsAuthenticated, IsStaffOrAdmin

Request Fields (POST)

title
string
required
Event title (max 200 characters).
description
string
Full description of the event. Defaults to empty string.
event_date
string (date)
required
Date of the event in YYYY-MM-DD format.
venue
string
Event venue or location (max 200 characters). Defaults to empty string.
cover_image
file
Optional cover image. Upload as multipart/form-data.
is_public
boolean
When true (default), the event appears on the public calendar. Set false for internal events.

Example — Create an event

curl -X POST https://api.gobarau.edu.ng/api/content/events/ \
  -H "Authorization: Bearer <token>" \
  -F "title=Annual Inter-House Sports Competition" \
  -F "description=The yearly inter-house athletics and field competition open to all students." \
  -F "event_date=2025-02-28" \
  -F "venue=School Sports Field" \
  -F "is_public=true" \
  -F "cover_image=@/path/to/sports-day.jpg"

Response Fields

id
integer
Auto-incrementing integer primary key for the event.
public_id
uuid
Unique public UUID identifier for the event (from BaseModel).
title
string
Event title.
description
string
Event description.
event_date
string (date)
Date of the event.
venue
string
Event venue.
cover_image
string | null
URL of the cover image, or null.
is_public
boolean
Whether the event is publicly visible.
created_at
string (datetime)
Record creation timestamp (from BaseModel).
updated_at
string (datetime)
Last modification timestamp (from BaseModel).

Gallery albums are named containers grouping related photos together. An album can be linked to an Event to automatically associate the photos with that occasion.
Link GalleryAlbum records to Event instances whenever photos are from a specific school event. This lets the frontend surface photo galleries directly within each event’s detail page, giving parents and students a richer, organised browsing experience.
Endpoint: GET/POST /api/content/gallery-albums/ Permissions: GET — public · POST/PUT/PATCH/DELETEIsAuthenticated, IsStaffOrAdmin

Request Fields (POST)

title
string
required
Album title (max 200 characters).
description
string
Optional description of the album’s contents. Defaults to empty string.
cover_image
file
Thumbnail/cover image for the album. Upload as multipart/form-data.
event
integer
Optional foreign key to an Event. Links the album to a specific school event. Pass null for standalone albums.
curl -X POST https://api.gobarau.edu.ng/api/content/gallery-albums/ \
  -H "Authorization: Bearer <token>" \
  -F "title=Inter-House Sports 2025 — Photos" \
  -F "description=Official photo coverage of the 2025 annual inter-house sports competition." \
  -F "event=17" \
  -F "cover_image=@/path/to/album-cover.jpg"

Response Fields

id
integer
Auto-incrementing integer primary key for the album.
public_id
uuid
Unique public UUID identifier for the album (from BaseModel).
title
string
Album title.
description
string
Album description.
cover_image
string | null
URL of the cover image, or null.
event
integer | null
Primary key of the linked Event, or null.
created_at
string (datetime)
Record creation timestamp (from BaseModel).
updated_at
string (datetime)
Last modification timestamp (from BaseModel).

Individual photos belong to a GalleryAlbum. Each image has an optional caption, an ordering index for display sequence, and a reference to the staff member who uploaded it. Endpoint: GET/POST /api/content/gallery-images/ Permissions: GET — public · POST/PUT/PATCH/DELETEIsAuthenticated, IsStaffOrAdmin

Request Fields (POST)

album
integer
required
Primary key of the parent GalleryAlbum.
image
file
required
The photo to upload. Send as multipart/form-data; stored under content/gallery/images/.
caption
string
Optional descriptive caption for the image (max 200 characters). Defaults to empty string.
order_index
integer
Display order within the album. Lower values appear first. Defaults to 0.
uploaded_by
integer
Primary key of the User uploading the image. Can be left null if the uploader is not tracked.
curl -X POST https://api.gobarau.edu.ng/api/content/gallery-images/ \
  -H "Authorization: Bearer <token>" \
  -F "album=22" \
  -F "caption=JSS3 students competing in the 100m sprint." \
  -F "order_index=1" \
  -F "uploaded_by=15" \
  -F "image=@/path/to/sprint-race.jpg"

Response Fields

id
integer
Auto-incrementing integer primary key for the gallery image.
public_id
uuid
Unique public UUID identifier for the image (from BaseModel).
album
integer
Primary key of the parent album.
image
string
URL of the uploaded photo.
caption
string
Image caption.
order_index
integer
Display order within the album.
uploaded_by
integer | null
Primary key of the uploader User, or null.
created_at
string (datetime)
Record creation timestamp (from BaseModel).
updated_at
string (datetime)
Last modification timestamp (from BaseModel).

Magazine Issues

Magazine issues represent individual editions of the school’s publication. Each issue has a unique number and volume identifier, a publication date, an optional cover image, and an optional PDF file.

List & Create Magazine Issues

Endpoint: GET/POST /api/content/magazine-issues/ Permissions: GET — public · POST/PUT/PATCH/DELETEIsAuthenticated, IsStaffOrAdmin

Request Fields (POST)

title
string
required
Issue title (max 200 characters).
issue_number
string
required
Issue number identifier (max 20 characters), e.g. "12" or "Q3".
volume
string
required
Volume identifier (max 20 characters), e.g. "5" or "V".
publication_date
string (date)
required
Publication date in YYYY-MM-DD format.
cover_image
file
Magazine cover image. Upload as multipart/form-data.
pdf_url
file
Full PDF of the magazine issue. Upload as multipart/form-data; stored under content/magazines/pdfs/.

Example — Create a magazine issue

curl -X POST https://api.gobarau.edu.ng/api/content/magazine-issues/ \
  -H "Authorization: Bearer <token>" \
  -F "title=The Gobarau Herald — First Term 2024/2025" \
  -F "issue_number=18" \
  -F "volume=6" \
  -F "publication_date=2025-01-10" \
  -F "cover_image=@/path/to/herald-cover.jpg" \
  -F "pdf_url=@/path/to/herald-issue-18.pdf"

Response Fields

id
integer
Auto-incrementing integer primary key for the magazine issue.
public_id
uuid
Unique public UUID identifier for the issue (from BaseModel).
title
string
Issue title.
issue_number
string
Issue number.
volume
string
Volume identifier.
publication_date
string (date)
Publication date.
cover_image
string | null
URL of the cover image, or null.
pdf_url
string | null
URL of the PDF file, or null.
created_at
string (datetime)
Record creation timestamp (from BaseModel).
updated_at
string (datetime)
Last modification timestamp (from BaseModel).

Magazine Articles

Magazine articles are the individual pieces of writing within a MagazineIssue. They carry an author name (which need not be a system user — it can be a student name), article body, and the page number within the printed issue.

List & Create Magazine Articles

Endpoint: GET/POST /api/content/magazine-articles/ Permissions: GET — public · POST/PUT/PATCH/DELETEIsAuthenticated, IsStaffOrAdmin

Request Fields (POST)

issue
integer
required
Primary key of the parent MagazineIssue.
title
string
required
Article title (max 200 characters).
author_name
string
Name of the article’s author (max 200 characters). Can be a student name, staff name, or pen name. Defaults to empty string.
body
string
required
Full article body text.
page_number
integer
Page number in the printed magazine on which this article starts. Defaults to 0.

Example — Create a magazine article

curl -X POST https://api.gobarau.edu.ng/api/content/magazine-articles/ \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "issue": 7,
    "title": "Artificial Intelligence: Friend or Foe for Nigerian Students?",
    "author_name": "Fatima Abdullahi (SSS3A)",
    "body": "The rapid advancement of artificial intelligence presents both opportunities and challenges for students across Nigeria...",
    "page_number": 14
  }'

Response Fields

id
integer
Auto-incrementing integer primary key for the article.
public_id
uuid
Unique public UUID identifier for the article (from BaseModel).
issue
integer
Primary key of the parent MagazineIssue.
title
string
Article title.
author_name
string
Author’s name.
body
string
Full article body.
page_number
integer
Starting page number in the printed issue.
created_at
string (datetime)
Record creation timestamp (from BaseModel).
updated_at
string (datetime)
Last modification timestamp (from BaseModel).

Yearbook Sets

A yearbook set groups all student entries for a single academic session under one cover. It is linked to an AcademicSession to tie it to the school calendar.

List & Create Yearbook Sets

Endpoint: GET/POST /api/content/yearbook-sets/ Permissions: GET — public · POST/PUT/PATCH/DELETEIsAuthenticated, IsStaffOrAdmin

Request Fields (POST)

session
integer
required
Primary key of the AcademicSession this yearbook commemorates.
title
string
required
Title of the yearbook set (max 200 characters), e.g. "Class of 2025".
publication_date
string (date)
required
Date the yearbook was published in YYYY-MM-DD format.
cover_image
file
Cover image for the yearbook. Upload as multipart/form-data.

Example — Create a yearbook set

curl -X POST https://api.gobarau.edu.ng/api/content/yearbook-sets/ \
  -H "Authorization: Bearer <token>" \
  -F "session=12" \
  -F "title=Class of 2025 — Gobarau Academy" \
  -F "publication_date=2025-07-15" \
  -F "cover_image=@/path/to/yearbook-2025-cover.jpg"

Response Fields

id
integer
Auto-incrementing integer primary key for the yearbook set.
public_id
uuid
Unique public UUID identifier for the yearbook set (from BaseModel).
session
integer
Primary key of the AcademicSession.
title
string
Yearbook title.
publication_date
string (date)
Publication date.
cover_image
string | null
URL of the cover image, or null.
created_at
string (datetime)
Record creation timestamp (from BaseModel).
updated_at
string (datetime)
Last modification timestamp (from BaseModel).

Yearbook Entries

Each YearbookEntry represents a single student’s profile page within a yearbook set. It stores their portrait photo, nickname, favourite quote, and future aspiration.

List & Create Yearbook Entries

Endpoint: GET/POST /api/content/yearbook-entries/ Permissions: GET — public · POST/PUT/PATCH/DELETEIsAuthenticated, IsStaffOrAdmin

Request Fields (POST)

yearbook_set
integer
required
Primary key of the parent YearbookSet.
student
integer
required
Primary key of the StudentProfile this entry belongs to.
photo
file
Student portrait for the yearbook page. Upload as multipart/form-data; stored under content/yearbooks/students/.
nickname
string
Student’s nickname or alias (max 100 characters). Defaults to empty string.
quote
string
Student’s favourite quote or personal message. Defaults to empty string.
future_aspiration
string
Student’s stated future career or life goal. Defaults to empty string.

Example — Create a yearbook entry

curl -X POST https://api.gobarau.edu.ng/api/content/yearbook-entries/ \
  -H "Authorization: Bearer <token>" \
  -F "yearbook_set=4" \
  -F "student=213" \
  -F "nickname=The Architect" \
  -F "quote=The secret of getting ahead is getting started. — Mark Twain" \
  -F "future_aspiration=To become a structural engineer and design bridges across Nigeria." \
  -F "photo=@/path/to/student-portrait.jpg"

Response Fields

id
integer
Auto-incrementing integer primary key for the yearbook entry.
public_id
uuid
Unique public UUID identifier for the entry (from BaseModel).
yearbook_set
integer
Primary key of the parent YearbookSet.
student
integer
Primary key of the StudentProfile.
photo
string | null
URL of the student portrait, or null.
nickname
string
Student’s nickname.
quote
string
Student’s quote.
future_aspiration
string
Student’s future aspiration.
created_at
string (datetime)
Record creation timestamp (from BaseModel).
updated_at
string (datetime)
Last modification timestamp (from BaseModel).

Testimonials

Testimonials are endorsements and personal accounts from alumni, parents, or community members. They can be marked as featured to surface prominently on the school’s homepage or landing page.

List & Create Testimonials

Endpoint: GET/POST /api/content/testimonials/ Permissions: GET — public · POST/PUT/PATCH/DELETEIsAuthenticated, IsStaffOrAdmin

Request Fields (POST)

person_name
string
required
Full name of the person giving the testimonial (max 200 characters).
role
string
Person’s role or relationship to the school, e.g. "Parent", "Alumni – Class of 2018" (max 100 characters). Defaults to empty string.
message
string
required
The testimonial text.
photo
file
Optional portrait of the testimonial author. Upload as multipart/form-data; stored under content/testimonials/.
When true, the testimonial is shown in featured/homepage carousels. Defaults to false.
published_at
string (datetime)
ISO 8601 datetime the testimonial is considered published. Can be a future date.
curl -X POST https://api.gobarau.edu.ng/api/content/testimonials/ \
  -H "Authorization: Bearer <token>" \
  -F "person_name=Alhaji Musa Ibrahim" \
  -F "role=Parent of Two Gobarau Graduates" \
  -F "message=Gobarau Academy transformed my children's lives. The dedication of the teachers and the strong moral values instilled here are second to none in Katsina State." \
  -F "is_featured=true" \
  -F "published_at=2025-01-01T00:00:00Z" \
  -F "photo=@/path/to/alhaji-musa.jpg"

Response Fields

id
integer
Auto-incrementing integer primary key for the testimonial.
public_id
uuid
Unique public UUID identifier for the testimonial (from BaseModel).
person_name
string
Name of the person giving the testimonial.
role
string
Their role or relationship to the school.
message
string
The testimonial message.
photo
string | null
URL of the author’s portrait, or null.
Whether the testimonial is featured.
published_at
string (datetime) | null
Publication datetime, or null if unscheduled.
created_at
string (datetime)
Record creation timestamp (from BaseModel).
updated_at
string (datetime)
Last modification timestamp (from BaseModel).

Build docs developers (and LLMs) love