Skip to main content

API Endpoints Reference

Generated from Almafrica_API.postman_collection.json. Update the Postman collection, then run npm run sync:postman-docs.

This page shows the API endpoints currently documented for the Almafrica system. It is generated from the checked-in Postman collection so developers can browse the available surfaces directly in the docs site.

Postman Collection

Base URL

EnvironmentURL
Collection defaulthttps://api-dev.almafrica.com
Staginghttps://api-staging.almafrica.com
Productionhttps://api.almafrica.com

Authentication

Most endpoints in the collection expect a bearer token:

Authorization: Bearer <access_token>

Use the Auth endpoints to obtain and refresh tokens.

Endpoint Groups

The current Postman collection contains 6 groups and 37 endpoints.

GroupEndpoints
Auth7
Agents10
Analytics6
Agent Collection Points5
Collection Points (Admin)4
Business Types5

Available Endpoints

Auth

MethodEndpointRequest
POST/api/Auth/registerRegister Agent
POST/api/Auth/loginLogin
POST/api/Auth/refresh-tokenRefresh Token
POST/api/Auth/logoutLogout
POST/api/Auth/change-passwordChange Password
POST/api/Auth/forgot-passwordForgot Password
POST/api/Auth/reset-passwordReset Password

Agents

MethodEndpointRequest
GET/api/Agents?page=1&pageSize=10&searchQuery=&isActive=true&sortBy=CreatedAt&sortDescending=trueGet All Agents
GET/api/Agents/{id}Get Agent by ID
POST/api/AgentsCreate Agent
PUT/api/Agents/{id}Update Agent
DELETE/api/Agents/{id}Delete Agent
POST/api/Agents/{id}/deactivateDeactivate Agent
POST/api/Agents/{id}/reactivateReactivate Agent
POST/api/Agents/bulk-importBulk Import Agents
GET/api/Agents/import-templateDownload Import Template
GET/api/Agents/exportExport Agents

Analytics

MethodEndpointRequest
GET/api/Analytics/dashboard-metricsGet Dashboard Metrics
GET/api/Analytics/kpisGet KPIs
GET/api/Analytics/regional-distributionGet Regional Distribution
GET/api/Analytics/farmer-trends?periodType=Month&periods=12Get Farmer Trends
GET/api/Analytics/agent-trends?periodType=Month&periods=12Get Agent Trends
GET/api/Analytics/monthly-trends?months=12Get Monthly Trends

Agent Collection Points

MethodEndpointRequest
GET/api/agent/collection-points/my-proposals?page=1&pageSize=10Get My Proposals
POST/api/agent/collection-points/proposePropose Collection Point
GET/api/agent/collection-points/{id}Get Proposal by ID
PUT/api/agent/collection-points/{id}Update Proposal
DELETE/api/agent/collection-points/{id}Delete Proposal

Collection Points (Admin)

MethodEndpointRequest
GET/api/admin/collection-points?page=1&pageSize=10&searchQuery=&status=ApprovedGet All Collection Points
GET/api/admin/collection-points/{id}Get Collection Point by ID
POST/api/admin/collection-points/{id}/approveApprove Collection Point
POST/api/admin/collection-points/{id}/rejectReject Collection Point

Business Types

MethodEndpointRequest
GET/api/admin/business-typesGet All Business Types
GET/api/admin/business-types/{id}Get Business Type by ID
POST/api/admin/business-typesCreate Business Type
PUT/api/admin/business-types/{id}Update Business Type
DELETE/api/admin/business-types/{id}Delete Business Type

Swagger Documentation

Interactive API documentation is available at:

EnvironmentURL
Developmenthttp://localhost:5000/swagger
Staginghttps://api-staging.almafrica.com/swagger

Notes

  • This page reflects the checked-in Postman collection, not automatic runtime introspection of the backend.
  • If an endpoint exists in the backend but is missing here, add it to Almafrica_API.postman_collection.json and rerun the sync script.
  • If developers need request bodies and ready-to-run examples, import the downloadable Postman collection.