Skip to main content

Employees

Manage school staff records, bank details, and next-of-kin information.

All endpoints require Authorization: Bearer <token> and X-SCHOOL-ID headers.


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

FieldTypeRequiredDescription
first_namestringYesFirst name
middle_namestringYesMiddle name
last_namestringYesLast name
titlestringYesTitle (Mr, Mrs, Dr, etc.)
dobdateYesDate of birth
join_datedateYesEmployment start date
genderstringYesGender
marital_statusstringYesMarital status
departmentuuidYesDepartment ID
blood_groupstringYesBlood group
lgauuidYesLGA ID
stateuuidYesState ID
nationalityuuidYesNationality ID
religionstringYesReligion
positionuuidYesPosition ID
categoryuuidYesEmployee category ID
statusstringYesEmployment status
bank_detailsobjectYesBank account details
next_of_kinobjectYesNext of kin details
contactobjectYesContact information

bank_details object:

FieldTypeRequired
bank_namestringYes
account_numberstringYes
account_namestringYes
bank_sort_codestringYes
employee_nostringYes
employeeintegerYes
account_typestringYes

next_of_kin object:

FieldTypeRequired
full_namestringYes
relationshipstringYes
phone_numberstringYes
physical_addressstringYes
employeeintegerYes

Response 200 OK — Returns the created EmployeeResponse.


Get Employee

GET /employees/{id}

Retrieve a single employee by ID.

Path Parameters

ParameterTypeDescription
iduuidEmployee ID

Response 200 OK — Returns an EmployeeResponse object.


Delete Employee

DELETE /employees/{id}

Remove an employee record.

Path Parameters

ParameterTypeDescription
iduuidEmployee ID

Response 200 OK


Get Bank Account Details

GET /employees/{id}/bank-account

Retrieve the bank account details for an employee.

Path Parameters

ParameterTypeDescription
iduuidEmployee 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

ParameterTypeDescription
iduuidEmployee 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"
}