SamaySetu API Docs LogoSamaySetu API Docs Logo
SamaySetu API Docsv1.0.0
  • Documentation
  • API Reference
Information
Authentication
Accounts & Access
Academic Structure
    Academic Years
    Departments
      List DepartmentsgetCreate DepartmentpostList Departments by YeargetGet DepartmentgetUpdate DepartmentputDelete DepartmentdeleteCopy Departments to Yearpost
    Divisions
    Batches
Curriculum & Infrastructure
Faculty Management
Timetable Management
Analytics & System
Security Governance
SamaySetu API Documentation
SamaySetu API Documentation

Departments

Department structure and cross-year replication


List Departments

GET
https://api.samaysetu.example
/admin/api/departments

Returns departments filtered by the caller's institution or department scope.

Required Permission: department.read (JWT Bearer + scope check).

List Departments › Responses

OK

​DepartmentEntity[]
DepartmentEntity
code
​string · minLength: 0 · maxLength: 10 · required
name
​string · minLength: 0 · maxLength: 100 · required
​AcademicYear
createdAt
​string · date-time
headOfDepartment
​string · minLength: 0 · maxLength: 100
id
​integer · int64
updatedAt
​string · date-time
years
​string
GET/admin/api/departments
curl https://api.samaysetu.example/admin/api/departments \ --header 'Authorization: Bearer <token>'
Example Responses
[ { "id": 101, "name": "Computer Engineering", "code": "COMP", "headOfDepartment": "Dr. Snehal Deshmukh", "years": "1,2,3,4", "academicYear": { "id": 4, "yearName": "2026-27", "startDate": "2026-07-01", "endDate": "2027-05-31", "isCurrent": true, "createdAt": "2026-06-15T09:00:00Z" }, "createdAt": "2026-06-15T09:30:00Z", "updatedAt": "2026-06-20T10:15:00Z" } ]
json
application/json

Create Department

POST
https://api.samaysetu.example
/admin/api/departments

Creates a new academic department within an academic year.

Required Permission: department.create (JWT Bearer + scope check).

Create Department › Request Body

DepartmentEntity
code
​string · minLength: 0 · maxLength: 10 · required
name
​string · minLength: 0 · maxLength: 100 · required
​AcademicYear
createdAt
​string · date-time
headOfDepartment
​string · minLength: 0 · maxLength: 100
id
​integer · int64
updatedAt
​string · date-time
years
​string

Create Department › Responses

OK

DepartmentEntity
code
​string · minLength: 0 · maxLength: 10 · required
name
​string · minLength: 0 · maxLength: 100 · required
​AcademicYear
createdAt
​string · date-time
headOfDepartment
​string · minLength: 0 · maxLength: 100
id
​integer · int64
updatedAt
​string · date-time
years
​string
POST/admin/api/departments
curl https://api.samaysetu.example/admin/api/departments \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "name": "Computer Engineering", "code": "COMP", "headOfDepartment": "Dr. Snehal Deshmukh", "years": "1,2,3,4", "academicYear": { "id": 4, "yearName": "2026-27", "startDate": "2026-07-01", "endDate": "2027-05-31", "isCurrent": true, "createdAt": "2026-06-15T09:00:00Z" } }'
Example Request Body
{ "name": "Computer Engineering", "code": "COMP", "headOfDepartment": "Dr. Snehal Deshmukh", "years": "1,2,3,4", "academicYear": { "id": 4, "yearName": "2026-27", "startDate": "2026-07-01", "endDate": "2027-05-31", "isCurrent": true, "createdAt": "2026-06-15T09:00:00Z" } }
json
application/json
Example Responses
{ "id": 101, "name": "Computer Engineering", "code": "COMP", "headOfDepartment": "Dr. Snehal Deshmukh", "years": "1,2,3,4", "academicYear": { "id": 4, "yearName": "2026-27", "startDate": "2026-07-01", "endDate": "2027-05-31", "isCurrent": true, "createdAt": "2026-06-15T09:00:00Z" }, "createdAt": "2026-06-15T09:30:00Z", "updatedAt": "2026-06-20T10:15:00Z" }
json
application/json

List Departments by Year

GET
https://api.samaysetu.example
/admin/api/departments/academic-year/{academicYearId}

Returns departments belonging to the specified academic year.

Required Permission: department.read (JWT Bearer + scope check).

List Departments by Year › path Parameters

academicYearId
​integer · int64 · required

Path parameter academicYearId.

List Departments by Year › Responses

OK

​DepartmentEntity[]
DepartmentEntity
code
​string · minLength: 0 · maxLength: 10 · required
name
​string · minLength: 0 · maxLength: 100 · required
​AcademicYear
createdAt
​string · date-time
headOfDepartment
​string · minLength: 0 · maxLength: 100
id
​integer · int64
updatedAt
​string · date-time
years
​string
GET/admin/api/departments/academic-year/{academicYearId}
curl https://api.samaysetu.example/admin/api/departments/academic-year/:academicYearId \ --header 'Authorization: Bearer <token>'
Example Responses
[ { "id": 101, "name": "Computer Engineering", "code": "COMP", "headOfDepartment": "Dr. Snehal Deshmukh", "years": "1,2,3,4", "academicYear": { "id": 4, "yearName": "2026-27", "startDate": "2026-07-01", "endDate": "2027-05-31", "isCurrent": true, "createdAt": "2026-06-15T09:00:00Z" }, "createdAt": "2026-06-15T09:30:00Z", "updatedAt": "2026-06-20T10:15:00Z" } ]
json
application/json

Get Department

GET
https://api.samaysetu.example
/admin/api/departments/{id}

Returns a single department record.

Required Permission: department.read (JWT Bearer + scope check).

Get Department › path Parameters

id
​integer · int64 · required

Path parameter id.

Get Department › Responses

OK

DepartmentEntity
code
​string · minLength: 0 · maxLength: 10 · required
name
​string · minLength: 0 · maxLength: 100 · required
​AcademicYear
createdAt
​string · date-time
headOfDepartment
​string · minLength: 0 · maxLength: 100
id
​integer · int64
updatedAt
​string · date-time
years
​string
GET/admin/api/departments/{id}
curl https://api.samaysetu.example/admin/api/departments/:id \ --header 'Authorization: Bearer <token>'
Example Responses
{ "id": 101, "name": "Computer Engineering", "code": "COMP", "headOfDepartment": "Dr. Snehal Deshmukh", "years": "1,2,3,4", "academicYear": { "id": 4, "yearName": "2026-27", "startDate": "2026-07-01", "endDate": "2027-05-31", "isCurrent": true, "createdAt": "2026-06-15T09:00:00Z" }, "createdAt": "2026-06-15T09:30:00Z", "updatedAt": "2026-06-20T10:15:00Z" }
json
application/json

Update Department

PUT
https://api.samaysetu.example
/admin/api/departments/{id}

Updates department metadata or structure.

Required Permission: department.update (JWT Bearer + scope check).

Update Department › path Parameters

id
​integer · int64 · required

Path parameter id.

Update Department › Request Body

DepartmentEntity
code
​string · minLength: 0 · maxLength: 10 · required
name
​string · minLength: 0 · maxLength: 100 · required
​AcademicYear
createdAt
​string · date-time
headOfDepartment
​string · minLength: 0 · maxLength: 100
id
​integer · int64
updatedAt
​string · date-time
years
​string

Update Department › Responses

OK

DepartmentEntity
code
​string · minLength: 0 · maxLength: 10 · required
name
​string · minLength: 0 · maxLength: 100 · required
​AcademicYear
createdAt
​string · date-time
headOfDepartment
​string · minLength: 0 · maxLength: 100
id
​integer · int64
updatedAt
​string · date-time
years
​string
PUT/admin/api/departments/{id}
curl https://api.samaysetu.example/admin/api/departments/:id \ --request PUT \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "name": "Computer Engineering", "code": "COMP", "headOfDepartment": "Dr. Prajakta Deshmukh", "years": "1,2,3,4", "academicYear": { "id": 4, "yearName": "2026-27", "startDate": "2026-07-01", "endDate": "2027-05-31", "isCurrent": true, "createdAt": "2026-06-15T09:00:00Z" } }'
Example Request Body
{ "name": "Computer Engineering", "code": "COMP", "headOfDepartment": "Dr. Prajakta Deshmukh", "years": "1,2,3,4", "academicYear": { "id": 4, "yearName": "2026-27", "startDate": "2026-07-01", "endDate": "2027-05-31", "isCurrent": true, "createdAt": "2026-06-15T09:00:00Z" } }
json
application/json
Example Responses
{ "id": 101, "name": "Computer Engineering", "code": "COMP", "headOfDepartment": "Dr. Prajakta Deshmukh", "years": "1,2,3,4", "academicYear": { "id": 4, "yearName": "2026-27", "startDate": "2026-07-01", "endDate": "2027-05-31", "isCurrent": true, "createdAt": "2026-06-15T09:00:00Z" }, "createdAt": "2026-06-15T09:30:00Z", "updatedAt": "2026-06-20T10:15:00Z" }
json
application/json

Delete Department

DELETE
https://api.samaysetu.example
/admin/api/departments/{id}

Deletes a department by ID.

Required Permission: department.delete (JWT Bearer + scope check).

Delete Department › path Parameters

id
​integer · int64 · required

Path parameter id.

Delete Department › Responses

OK

string
DELETE/admin/api/departments/{id}
curl https://api.samaysetu.example/admin/api/departments/:id \ --request DELETE \ --header 'Authorization: Bearer <token>'
Example Responses
Department deleted successfully
json
application/json

Copy Departments to Year

POST
https://api.samaysetu.example
/admin/api/departments/copy

Copies department records from a source academic year to a target academic year.

Required Permission: department.copy (JWT Bearer + scope check).

Copy Departments to Year › Request Body

No data returned

Copy Departments to Year › Responses

OK

​DepartmentEntity[]
DepartmentEntity
code
​string · minLength: 0 · maxLength: 10 · required
name
​string · minLength: 0 · maxLength: 100 · required
​AcademicYear
createdAt
​string · date-time
headOfDepartment
​string · minLength: 0 · maxLength: 100
id
​integer · int64
updatedAt
​string · date-time
years
​string
POST/admin/api/departments/copy
curl https://api.samaysetu.example/admin/api/departments/copy \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "sourceAcademicYearId": 3, "targetAcademicYearId": 4, "departmentIds": [ 101, 102 ] }'
Example Request Body
{ "sourceAcademicYearId": 3, "targetAcademicYearId": 4, "departmentIds": [ 101, 102 ] }
json
application/json
Example Responses
[ { "id": 101, "name": "Computer Engineering", "code": "COMP", "headOfDepartment": "Dr. Snehal Deshmukh", "years": "1,2,3,4", "academicYear": { "id": 4, "yearName": "2026-27", "startDate": "2026-07-01", "endDate": "2027-05-31", "isCurrent": true, "createdAt": "2026-06-15T09:00:00Z" }, "createdAt": "2026-06-15T09:30:00Z", "updatedAt": "2026-06-20T10:15:00Z" } ]
json
application/json

Academic YearsDivisions