Employees
Manage school staff records, bank details, and next-of-kin information.
All endpoints require
Authorization: Bearer <token>andX-SCHOOL-IDheaders.
List Employees
GET /employees
Returns all employees for the current school.
Example
curl -X GET https://api.vanillatots.com/employees \
-H "Authorization: Bearer $TOKEN" \
-H "X-SCHOOL-ID: $SCHOOL_ID"
Response 200 OK
[
{
"id": "uuid",
"first_name": "Ada",
"middle_name": "N.",
"last_name": "Okafor",
"title": "Mrs",
"dob": "1985-06-12",
"gender": "Female",
"marital_status": "Married",
"department": "uuid",
"blood_group": "B+",
"lga": "uuid",
"state": "uuid",
"nationality": "uuid",
"religion": "Christianity",
"position": "uuid",
"category": "uuid",
"status": "ACTIVE",
"bank_details": "uuid",
"next_of_kin": "uuid",
"contact": "uuid",
"username": "ada.okafor",
"join_date": "2020-09-01",
"role": "uuid"
}
]
Create Employee
POST /employees
Register a new employee. Includes nested bank details, next of kin, and contact.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
first_name | string | Yes | First name |
middle_name | string | Yes | Middle name |
last_name | string | Yes | Last name |
title | string | Yes | Title (Mr, Mrs, Dr, etc.) |
dob | date | Yes | Date of birth |
join_date | date | Yes | Employment start date |
gender | string | Yes | Gender |
marital_status | string | Yes | Marital status |
department | uuid | Yes | Department ID |
blood_group | string | Yes | Blood group |
lga | uuid | Yes | LGA ID |
state | uuid | Yes | State ID |
nationality | uuid | Yes | Nationality ID |
religion | string | Yes | Religion |
position | uuid | Yes | Position ID |
category | uuid | Yes | Employee category ID |
status | string | Yes | Employment status |
bank_details | object | Yes | Bank account details |
next_of_kin | object | Yes | Next of kin details |
contact | object | Yes | Contact information |
bank_details object:
| Field | Type | Required |
|---|---|---|
bank_name | string | Yes |
account_number | string | Yes |
account_name | string | Yes |
bank_sort_code | string | Yes |
employee_no | string | Yes |
employee | integer | Yes |
account_type | string | Yes |
next_of_kin object:
| Field | Type | Required |
|---|---|---|
full_name | string | Yes |
relationship | string | Yes |
phone_number | string | Yes |
physical_address | string | Yes |
employee | integer | Yes |
Response 200 OK — Returns the created EmployeeResponse.
Get Employee
GET /employees/{id}
Retrieve a single employee by ID.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | uuid | Employee ID |
Response 200 OK — Returns an EmployeeResponse object.
Delete Employee
DELETE /employees/{id}
Remove an employee record.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | uuid | Employee ID |
Response 200 OK
Get Bank Account Details
GET /employees/{id}/bank-account
Retrieve the bank account details for an employee.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | uuid | Employee ID |
Response 200 OK
{
"id": "uuid",
"bank_name": "First Bank",
"account_number": "0123456789",
"account_name": "Ada Okafor",
"bank_sort_code": "011",
"employee": "uuid",
"account_type": "Savings"
}
Get Next of Kin
GET /employees/{id}/nextofkin
Retrieve the next-of-kin information for an employee.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | uuid | Employee ID |
Response 200 OK
{
"id": "uuid",
"full_name": "John Okafor",
"relationship": "Spouse",
"phone_number": "+2348012345678",
"physical_address": "456 Oak Avenue, Abuja",
"created_at": "2024-01-15T10:30:00Z"
}