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