Organization API
Base URL: /api/v1/organization/
Manage organizational structure including campuses, buildings, rooms, colleges, and departments.
Endpoints Overview
Campuses
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /campuses | No | List campuses |
| GET | /campuses/dropdown | No | Minimal list for dropdowns |
| GET | /campuses/{id} | No | Get campus details |
| POST | /campuses | Yes | Create campus |
| PUT | /campuses/{id} | Yes | Replace campus |
| PATCH | /campuses/{id} | Yes | Update campus |
| DELETE | /campuses/{id} | Yes | Delete campus |
Buildings & Rooms
| Method | Endpoint | Description |
|---|---|---|
| GET | /buildings | List buildings |
| POST | /buildings | Create building |
| GET | /buildings/{id} | Get building details |
| PUT | /buildings/{id} | Update building |
| DELETE | /buildings/{id} | Delete building |
| GET | /buildings/{id}/rooms | Get rooms in building |
| GET | /rooms | List rooms |
| POST | /rooms | Create room |
| GET | /rooms/{id} | Get room details |
| PATCH | /rooms/{id} | Update room |
Colleges & Departments
| Method | Endpoint | Description |
|---|---|---|
| GET | /colleges | List colleges/schools |
| POST | /colleges | Create college |
| GET | /colleges/{id} | Get college details |
| DELETE | /colleges/{id} | Delete college |
| GET | /colleges/{id}/departments | Get departments in college |
| GET | /colleges/{collegeID}/course-codes | Get course codes by college |
| GET | /departments | List departments |
| POST | /departments | Create department |
| GET | /departments/{id} | Get department details |
| PATCH | /departments/{id} | Update department |
| GET | /departments/root | Get root-level departments |
| GET | /departments/hierarchy | Get full department hierarchy |
| GET | /departments/{id}/children | Get child departments |
| GET | /departments/root | List root departments |
| GET | /departments/{departmentID}/children | List a department's children |
| GET | /departments/{departmentID}/course-codes | Course codes owned by a department |
| GET | /departments/{departmentID}/course-codes | Get course codes by department |
Course Code Mappings
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /course-codes | Yes | List course code mappings |
| POST | /course-codes | Yes | Create course code mapping |
| GET | /course-codes/{id} | Yes | Get course code mapping |
| PUT | /course-codes/{id} | Yes | Update course code mapping |
| DELETE | /course-codes/{id} | Yes | Delete course code mapping |
| GET | /departments/{departmentID}/course-codes | Yes | Get course codes by department |
| GET | /colleges/{collegeID}/course-codes | Yes | Get course codes by college |
Campuses
List Campuses
GET /api/v1/organization/campusesReturns all campuses. Publicly accessible.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
is_active | boolean | Filter by active status (default: true) |
is_online | boolean | Filter online campuses |
search | string | Search in campus_code, campus_name, city, state |
ordering | string | Sort by: sort_order, campus_name, campus_code |
Example Request
curl -X GET "http://localhost:8000/api/v1/organization/campuses?is_active=true" \
-b cookies.txtSuccess Response (200 OK)
{
"count": 5,
"results": [
{
"campus_id": 1,
"campus_code": "MAIN",
"campus_name": "Main Campus",
"is_online": false,
"is_open_to_all": true,
"address_line1": "123 University Drive",
"address_line2": null,
"city": "Collegetown",
"state": "NY",
"postal_code": "12345",
"country_id": 1,
"country_name": "United States",
"phone": "(555) 123-4567",
"full_address": "123 University Drive, Collegetown, NY 12345",
"sort_order": 1,
"is_active": true,
"student_count": 5000,
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
},
{
"campus_id": 2,
"campus_code": "ONLINE",
"campus_name": "Online Campus",
"is_online": true,
"is_open_to_all": true,
"sort_order": 10,
"is_active": true,
"student_count": 1500
}
]
}TypeScript Types
interface Campus {
campus_id: number
campus_code: string
campus_name: string
is_online: boolean
is_open_to_all: boolean
address_line1: string | null
address_line2: string | null
city: string | null
state: string | null
postal_code: string | null
country_id: number | null
country_name: string | null
phone: string | null
full_address: string | null
sort_order: number
is_active: boolean
student_count: number
}
interface CampusMinimal {
campus_id: number
campus_code: string
campus_name: string
is_online: boolean
}Campus Dropdown
GET /api/v1/organization/campuses/dropdownMinimal campus list for form dropdowns. Publicly accessible.
Success Response (200 OK)
{
"success": true,
"data": [
{
"campus_id": 1,
"campus_code": "MAIN",
"campus_name": "Main Campus",
"is_online": false
}
]
}Buildings
List Buildings
GET /api/v1/organization/buildingsQuery Parameters
| Parameter | Type | Description |
|---|---|---|
is_active | boolean | Filter by active status |
search | string | Search in building_code, name, address |
ordering | string | Sort by: building_code, name, created_at |
Example Request
curl -X GET "http://localhost:8000/api/v1/organization/buildings?is_active=true" \
-b cookies.txtSuccess Response (200 OK)
{
"count": 25,
"results": [
{
"building_id": 1,
"building_code": "SCI",
"name": "Science Building",
"address": "100 Science Drive",
"campus_id": 1,
"campus_name": "Main Campus",
"is_active": true,
"room_count": 45
}
]
}TypeScript Types
interface Building {
building_id: number
building_code: string
name: string
address: string | null
campus_id: number | null
campus_name?: string
is_active: boolean
room_count: number
}Update Building
PUT /api/v1/organization/buildings/{id}Replace a building record.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | integer | The building ID |
Delete Building
DELETE /api/v1/organization/buildings/{id}Delete a building.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | integer | The building ID |
Get Building Rooms
GET /api/v1/organization/buildings/{id}/roomsGet all active rooms in a building.
Success Response (200 OK)
[
{
"room_id": 101,
"building_id": 1,
"building_code": "SCI",
"building_name": "Science Building",
"room_number": "101",
"capacity": 35,
"room_type_code": "LECTURE",
"room_type_display": "Lecture Hall",
"full_location": "SCI 101",
"is_active": true
}
]Rooms
List Rooms
GET /api/v1/organization/roomsQuery Parameters
| Parameter | Type | Description |
|---|---|---|
building | integer | Filter by building ID |
is_active | boolean | Filter by active status |
room_type_id | integer | Filter by room type |
min_capacity | integer | Filter by minimum capacity |
search | string | Search in room_number, building name/code |
ordering | string | Sort by: building_code, room_number, capacity |
Example Request
curl -X GET "http://localhost:8000/api/v1/organization/rooms?building=1&is_active=true" \
-b cookies.txtTypeScript Types
interface Room {
room_id: number
building_id: number
building_code: string
building_name: string
room_number: string
capacity: number | null
room_type_code: string | null
room_type_display: string | null
full_location: string
is_active: boolean
}Colleges/Schools
List Colleges
GET /api/v1/organization/collegesQuery Parameters
| Parameter | Type | Description |
|---|---|---|
is_active | boolean | Filter by active status |
search | string | Search in college_code, name |
ordering | string | Sort by: college_code, name, created_at |
Example Request
curl -X GET http://localhost:8000/api/v1/organization/colleges \
-b cookies.txtSuccess Response (200 OK)
{
"count": 8,
"results": [
{
"college_id": 1,
"college_code": "CAS",
"name": "College of Arts and Sciences",
"is_active": true,
"department_count": 15
}
]
}TypeScript Types
interface CollegeSchool {
college_id: number
college_code: string
name: string
is_active: boolean
department_count: number
}Delete College
DELETE /api/v1/organization/colleges/{id}Delete a college.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | integer | The college ID |
Get College Departments
GET /api/v1/organization/colleges/{id}/departmentsGet all active departments in a college.
Departments
List Departments
GET /api/v1/organization/departmentsQuery Parameters
| Parameter | Type | Description |
|---|---|---|
is_active | boolean | Filter by active status |
parent_department | integer | Filter by parent department ID |
search | string | Search in department_code, name, description |
ordering | string | Sort by: department_code, name, created_at |
Example Request
curl -X GET "http://localhost:8000/api/v1/organization/departments?is_active=true" \
-b cookies.txtSuccess Response (200 OK)
{
"count": 40,
"results": [
{
"department_id": 1,
"department_code": "MATH",
"name": "Mathematics",
"description": "Department of Mathematics",
"parent_department_id": null,
"parent_name": null,
"full_hierarchy": "Mathematics",
"gl_credit_hour_billing": "40-1234-5678",
"gl_section_fee_billing": "40-1234-5679",
"gl_lab_fee_billing": "40-1234-5680",
"is_active": true
}
]
}TypeScript Types
interface Department {
department_id: number
department_code: string
name: string
description: string | null
parent_department_id: number | null
parent_name: string | null
full_hierarchy: string
gl_credit_hour_billing: string | null
gl_section_fee_billing: string | null
gl_lab_fee_billing: string | null
is_active: boolean
colleges?: CollegeSchool[]
child_departments?: Department[]
}Update Department
PATCH /api/v1/organization/departments/{id}Partially update a department.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | integer | The department ID |
Get Root Departments
GET /api/v1/organization/departments/rootGet all top-level departments (departments with no parent).
Get Department Hierarchy
GET /api/v1/organization/departments/hierarchyGet the full department hierarchy tree. Returns all departments organized in a nested tree structure.
Get Child Departments
GET /api/v1/organization/departments/{id}/childrenGet all immediate child departments of a department.
Get Department Hierarchy Path
GET /api/v1/organization/departments/{departmentID}/childrenList the immediate children of a department. There is no /departments/{id}/hierarchy path endpoint; full_hierarchy is returned as a field on the department itself.
Success Response (200 OK)
{
"department_id": 15,
"hierarchy": "College of Arts and Sciences > Natural Sciences > Biology"
}Course Code Mappings
Course code mappings define the relationship between unit-level course codes and the departments or colleges that own them.
List Course Code Mappings
GET /api/v1/organization/course-codesList all course code mappings.
Example Request
curl -X GET http://localhost:8000/api/v1/organization/course-codes \
-b cookies.txtSuccess Response (200 OK)
{
"count": 50,
"results": [
{
"course_code_id": 1,
"unit_course_code": "MATH",
"department_id": 5,
"department_name": "Mathematics",
"college_id": 1,
"college_name": "College of Arts and Sciences",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
]
}TypeScript Types
interface CourseCodeMapping {
course_code_id: number
unit_course_code: string
department_id: number | null
department_name: string | null
college_id: number | null
college_name: string | null
created_at: string
updated_at: string
}Create Course Code Mapping
POST /api/v1/organization/course-codesCreate a new course code mapping.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
unit_course_code | string | Yes | The course code prefix (e.g., MATH, BIOL) |
department_id | integer | No | Associated department ID |
college_id | integer | No | Associated college ID |
Example Request
curl -X POST http://localhost:8000/api/v1/organization/course-codes \
-b cookies.txt \
-H "Content-Type: application/json" \
-d '{
"unit_course_code": "PHYS",
"department_id": 8,
"college_id": 1
}'Get Course Code Mapping
GET /api/v1/organization/course-codes/{id}Get a specific course code mapping by ID.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | integer | The course code mapping ID |
Update Course Code Mapping
PUT /api/v1/organization/course-codes/{id}Update an existing course code mapping.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | integer | The course code mapping ID |
Example Request
curl -X PUT http://localhost:8000/api/v1/organization/course-codes/1 \
-b cookies.txt \
-H "Content-Type: application/json" \
-d '{
"unit_course_code": "MATH",
"department_id": 5,
"college_id": 1
}'Delete Course Code Mapping
DELETE /api/v1/organization/course-codes/{id}Delete a course code mapping.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | integer | The course code mapping ID |
Example Request
curl -X DELETE http://localhost:8000/api/v1/organization/course-codes/1 \
-b cookies.txtGet Course Codes by Department
GET /api/v1/organization/departments/{departmentID}/course-codesGet all course code mappings for a specific department.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
departmentID | integer | The department ID |
Example Request
curl -X GET http://localhost:8000/api/v1/organization/departments/5/course-codes \
-b cookies.txtGet Course Codes by College
GET /api/v1/organization/colleges/{collegeID}/course-codesGet all course code mappings for a specific college.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
collegeID | integer | The college ID |
Example Request
curl -X GET http://localhost:8000/api/v1/organization/colleges/1/course-codes \
-b cookies.txtComplete endpoint reference
Every route this domain registers, with the permission node that gates it. Generated from the route table, so it is complete by construction — the sections above explain behaviour, this one guarantees nothing is missing.
Paths are relative to /api/v1/organization. A node in italics is an exemption rather than a grant: selfservice acts only on the caller's own record, public needs no session at all, and custom carries its own wrapper.
| Method | Endpoint | Permission node | Description |
|---|---|---|---|
| GET | /buildings | ADMIN.BUILDINGS | List buildings |
| POST | /buildings | ADMIN.BUILDINGS | Create a building |
| DELETE | /buildings/{buildingID} | ADMIN.BUILDINGS | Delete a building |
| GET | /buildings/{buildingID} | ADMIN.BUILDINGS | Get one building |
| PATCH | /buildings/{buildingID} | ADMIN.BUILDINGS | Update a building |
| PUT | /buildings/{buildingID} | ADMIN.BUILDINGS | Replace a building |
| GET | /buildings/{buildingID}/rooms | ADMIN.BUILDINGS | List the building's rooms |
| GET | /campuses | ADMIN.CAMPUSES | List campuses |
| POST | /campuses | ADMIN.CAMPUSES | Create a campus |
| GET | /campuses/dropdown | ADMIN.CAMPUSES | List options for a picker |
| GET | /campuses/for_registration | REGISTRATION.REGISTER | Campuses offered to the registering student |
| DELETE | /campuses/{campusID} | ADMIN.CAMPUSES | Delete a campus |
| GET | /campuses/{campusID} | ADMIN.CAMPUSES | Get one campus |
| PATCH | /campuses/{campusID} | ADMIN.CAMPUSES | Update a campus |
| PUT | /campuses/{campusID} | ADMIN.CAMPUSES | Replace a campus |
| GET | /colleges | ADMIN.ORGANIZATION | List colleges |
| POST | /colleges | ADMIN.ORGANIZATION | Create a college |
| DELETE | /colleges/{collegeID} | ADMIN.ORGANIZATION | Delete a college |
| GET | /colleges/{collegeID} | ADMIN.ORGANIZATION | Get one college |
| PATCH | /colleges/{collegeID} | ADMIN.ORGANIZATION | Update a college |
| PUT | /colleges/{collegeID} | ADMIN.ORGANIZATION | Replace a college |
| GET | /colleges/{collegeID}/course-codes | ADMIN.ORGANIZATION | List the college's course codes |
| GET | /colleges/{collegeID}/departments | ADMIN.ORGANIZATION | List the college's departments |
| GET | /course-codes | ADMIN.ORGANIZATION | List course codes |
| POST | /course-codes | ADMIN.ORGANIZATION | Create a course code |
| DELETE | /course-codes/{id} | ADMIN.ORGANIZATION | Delete a course code |
| GET | /course-codes/{id} | ADMIN.ORGANIZATION | Get one course code |
| PUT | /course-codes/{id} | ADMIN.ORGANIZATION | Replace a course code |
| GET | /departments | ADMIN.ORGANIZATION | List departments |
| POST | /departments | ADMIN.ORGANIZATION | Create a department |
| GET | /departments/hierarchy | ADMIN.ORGANIZATION | Get hierarchy |
| GET | /departments/root | ADMIN.ORGANIZATION | Get root |
| DELETE | /departments/{departmentID} | ADMIN.ORGANIZATION | Delete a department |
| GET | /departments/{departmentID} | ADMIN.ORGANIZATION | Get one department |
| PATCH | /departments/{departmentID} | ADMIN.ORGANIZATION | Update a department |
| PUT | /departments/{departmentID} | ADMIN.ORGANIZATION | Replace a department |
| GET | /departments/{departmentID}/children | ADMIN.ORGANIZATION | Get the department's children |
| GET | /departments/{departmentID}/course-codes | ADMIN.ORGANIZATION | List the department's course codes |
| GET | /org-units | ADMIN.ORGANIZATION | List org units |
| POST | /org-units | ADMIN.ORGANIZATION | Create a org unit |
| GET | /org-units/tree | ADMIN.ORGANIZATION | Get tree |
| DELETE | /org-units/{unitID} | ADMIN.ORGANIZATION | Delete a org unit |
| GET | /org-units/{unitID} | ADMIN.ORGANIZATION | Get one org unit |
| PATCH | /org-units/{unitID} | ADMIN.ORGANIZATION | Update a org unit |
| PUT | /org-units/{unitID} | ADMIN.ORGANIZATION | Replace a org unit |
| GET | /org-units/{unitID}/administrators | ADMIN.ORGANIZATION | List the org unit's administrators |
| GET | /org-units/{unitID}/children | ADMIN.ORGANIZATION | Get the org unit's children |
| GET | /rooms | ADMIN.ROOMS | List rooms |
| POST | /rooms | ADMIN.ROOMS | Create a room |
| DELETE | /rooms/{roomID} | ADMIN.ROOMS | Delete a room |
| GET | /rooms/{roomID} | ADMIN.ROOMS | Get one room |
| PATCH | /rooms/{roomID} | ADMIN.ROOMS | Update a room |
| PUT | /rooms/{roomID} | ADMIN.ROOMS | Replace a room |
| GET | /unit-administrators | ADMIN.UNIT_ADMINS | List unit administrators |
| POST | /unit-administrators | ADMIN.UNIT_ADMINS | Create a unit administrator |
| DELETE | /unit-administrators/{uaID} | ADMIN.UNIT_ADMINS | Delete a unit administrator |
| GET | /unit-administrators/{uaID} | ADMIN.UNIT_ADMINS | Get one unit administrator |
| PATCH | /unit-administrators/{uaID} | ADMIN.UNIT_ADMINS | Update a unit administrator |