API Reference

Complete interactive REST API reference for the BeeHive platform.

All Authentication Health Students

Authentication

POST /api/auth/login Login

Authenticate a user and obtain a JWT token.

Headers

{
    "Content-Type": "application\/json"
}

Request Body

{
    "email": {
        "type": "string",
        "required": true
    },
    "password": {
        "type": "string",
        "required": true
    }
}

Example Request

{
    "email": "admin@beehivesms.com",
    "password": "your-password"
}

Example Response

{
    "success": true,
    "data": {
        "token": "eyJ...",
        "user": {
            "id": 1,
            "name": "Admin"
        }
    }
}
POST /api/auth/register Register

Register a new user account.

Headers

{
    "Content-Type": "application\/json"
}

Request Body

{
    "name": {
        "type": "string",
        "required": true
    },
    "email": {
        "type": "string",
        "required": true
    },
    "password": {
        "type": "string",
        "required": true
    }
}

Example Request

{
    "name": "John Doe",
    "email": "john@example.com",
    "password": "secure-pass"
}

Example Response

{
    "success": true,
    "data": {
        "user_id": 42
    }
}
POST /api/auth/logout Logout

Invalidate the current JWT token.

Authentication

Requires JWT token in Authorization header.

Headers

{
    "Authorization": "Bearer <token>"
}

Example Response

{
    "success": true,
    "message": "Logged out"
}

Health

GET /api/health Health Check

Check the health status of the platform.

Example Response

{
    "success": true,
    "status": "healthy",
    "version": "3.0.0"
}

Students

GET /api/students List Students

Get a paginated list of students.

Authentication

Requires JWT token in Authorization header.

Permissions: students.view

Headers

{
    "Authorization": "Bearer <token>"
}

Parameters

{
    "page": {
        "type": "integer",
        "default": 1
    },
    "per_page": {
        "type": "integer",
        "default": 20
    },
    "search": {
        "type": "string"
    }
}

Example Response

{
    "success": true,
    "data": [
        {
            "id": 1,
            "name": "Jane Doe"
        }
    ],
    "pagination": {
        "total": 150,
        "page": 1
    }
}
GET /api/students/{id} Get Student

Get detailed information about a specific student.

Authentication

Requires JWT token in Authorization header.

Permissions: students.view

Headers

{
    "Authorization": "Bearer <token>"
}

Parameters

{
    "id": {
        "type": "integer",
        "required": true
    }
}

Example Response

{
    "success": true,
    "data": {
        "id": 1,
        "name": "Jane Doe",
        "class": "Grade 10A"
    }
}
POST /api/students Create Student

Create a new student record.

Authentication

Requires JWT token in Authorization header.

Permissions: students.create

Headers

{
    "Authorization": "Bearer <token>",
    "Content-Type": "application\/json"
}

Request Body

{
    "name": {
        "type": "string",
        "required": true
    },
    "admission_number": {
        "type": "string",
        "required": true
    },
    "class_id": {
        "type": "integer",
        "required": true
    }
}

Example Request

{
    "name": "Jane Doe",
    "admission_number": "STU001",
    "class_id": 5
}

Example Response

{
    "success": true,
    "data": {
        "id": 42
    }
}