FedNex logo

Reference

API Documentation

Complete endpoint reference for all FedNex API Services. Every endpoint uses JSON request/response bodies and returns consistent envelope responses.

Base: https://api.fednex.ng/api/v1 Version 1.0

Contents

Health

Health Check

GET /api/v1/health Public

Returns current API health status, version, and server timestamp. No authentication required.

Response — 200 OK

{
  "success": true,
  "message": "API is healthy",
  "data": {
    "status": "healthy",
    "version": "1.0.0",
    "environment": "production",
    "timestamp": "2026-03-19T12:00:00.000000Z"
  }
}
GET /up Public

Simple uptime check returning a 200 response when the application is running. Used by monitoring systems.

Auth

Authentication Endpoints

Token-based authentication using Bearer tokens. Login returns a token; include it in subsequent requests.

POST /api/v1/auth/register Public

Register a new user account. Returns a Bearer token on success.

Request Body

{
  "name": "Jane Doe",
  "email": "jane@example.com",
  "password": "securePassword123",
  "password_confirmation": "securePassword123"
}

Response — 201 Created

{
  "success": true,
  "message": "Registration successful",
  "data": {
    "user": { "id": 1, "name": "Jane Doe" },
    "token": "1|abc..."
  }
}
POST /api/v1/auth/login Public

Authenticate with email and password. Returns a Bearer token for subsequent requests.

Request Body

{
  "email": "jane@example.com",
  "password": "securePassword123"
}

Response — 200 OK

{
  "success": true,
  "message": "Login successful",
  "data": {
    "user": { "id": 1, "name": "Jane Doe" },
    "token": "2|xyz..."
  }
}
POST /api/v1/auth/logout Auth Required

Revoke the current Bearer token. Requires Authorization header.

POST /api/v1/auth/forgot-password Public

Send a password reset link to the provided email address.

Request Body

{
  "email": "jane@example.com"
}
POST /api/v1/auth/reset-password Public

Reset password using the token received via email.

Request Body

{
  "email": "jane@example.com",
  "token": "reset-token-here",
  "password": "newSecurePassword",
  "password_confirmation": "newSecurePassword"
}

Contact

Contact Request Endpoints

Handle contact form submissions from fednex.ng and other FedNex applications.

POST /api/v1/contact-requests Public

Submit a new contact request. Used by the main site contact form.

Request Body

{
  "name": "Jane Doe",          // required, max 255
  "email": "jane@example.com",   // required, valid email
  "subject": "Partnership",       // required, max 255
  "message": "I'd like to..."    // required, max 5000
}

Response — 201 Created

{
  "success": true,
  "message": "Contact request submitted",
  "data": {
    "id": 42,
    "name": "Jane Doe",
    "subject": "Partnership",
    "created_at": "2026-03-19..."
  }
}

Error — 422 Validation

{
  "success": false,
  "message": "Validation failed",
  "errors": {
    "email": ["Required"],
    "message": ["Required"]
  }
}
GET /api/v1/contact-requests Auth Required

List all contact requests. Paginated, 20 per page. Requires admin authentication.

Content

Content Delivery Endpoints

Read-only endpoints serving structured platform content as JSON.

GET /api/v1/services Public

Returns the FedNex services catalog with titles, descriptions, and feature lists.

GET /api/v1/platforms Public

Returns FedNex platform applications list with URLs, descriptions, and status.

GET /api/v1/training Public

Returns available training programs, courses, and educational resources.

AI

AI Orchestration Endpoints

Gateway endpoints that route through the API before forwarding to the FastAPI knowledge service at ai.fednex.ng.

POST /api/v1/ai/chat Public

Send a message to the FedNex AI assistant. The API validates and routes the request to the AI service.

Request Body

{
  "message": "What services does FedNex offer?",
  "session_id": "optional-session-id"
}

Response — 200 OK

{
  "success": true,
  "data": {
    "response": "FedNex offers...",
    "session_id": "sess_abc123"
  }
}
GET /api/v1/ai/health Public

Check the AI service availability by proxying to ai.fednex.ng/health.

Errors

Error Handling

All errors follow the same JSON envelope. The HTTP status code indicates the error type.

Code Meaning Description
200OKRequest succeeded
201CreatedResource created successfully
400Bad RequestMalformed request syntax
401UnauthorizedMissing or invalid authentication token
403ForbiddenToken valid but lacks permission
404Not FoundEndpoint or resource not found
422UnprocessableValidation errors in request body
429Too Many RequestsRate limit exceeded
500Server ErrorInternal server error

Limits

Rate Limiting

60

requests per minute for authenticated users

30

requests per minute for public endpoints

10

requests per minute for AI chat endpoint

Rate limit headers (X-RateLimit-Remaining, X-RateLimit-Limit) are included in every response.

Security

CORS Policy

The API accepts cross-origin requests from the following allowed origins:

https://fednex.ng
https://developers.fednex.ng
https://labs.fednex.ng
https://ai.fednex.ng