API Documentation

REST API for the Enugu State - HOPE Programme

Base URL: https://hope.en.gov.ng/api/v1

Authentication

Login

POST /api/v1/auth/login

// Request Body (JSON)
{
  "email": "user@example.com",
  "password": "password",
  "device_name": "mobile-app" // optional
}
// Response
{
  "success": true,
  "message": "Login successful",
  "data": {
    "token": "1|abc123...",
    "user": { ... }
  }
}

Logout

POST /api/v1/auth/logout

// Headers
Authorization: Bearer 1|abc123...

Get Authenticated User

GET /api/v1/auth/user

// Headers
Authorization: Bearer 1|abc123...

Public Endpoints

Method Endpoint Description
GET /api/v1/programmes List all active programmes
GET /api/v1/programmes/{slug} Get a single programme with related data
GET /api/v1/news List paginated published news
GET /api/v1/news/{slug} Get a single news article
GET /api/v1/reports List paginated published reports
GET /api/v1/reports/{slug} Get a single report
GET /api/v1/facilities List paginated active facilities
GET /api/v1/schools List paginated active schools
GET /api/v1/kpi-metrics List all active KPI metrics
GET /api/v1/gallery List paginated gallery items
GET /api/v1/stats Get aggregate statistics

Error Responses

Validation Error (422)

{
  "success": false,
  "message": "The provided credentials are incorrect.",
  "errors": {
    "email": ["The provided credentials are incorrect."]
  }
}

Not Found (404)

{
  "success": false,
  "message": "Resource not found"
}

Unauthenticated (401)

{
  "message": "Unauthenticated."
}