API Endpoints Reference
Generated from
Almafrica_API.postman_collection.json. Update the Postman collection, then runnpm 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
- Explore the API in a read-only Swagger-style UI
- Download the Almafrica Postman collection
- Import it into Postman and update the
base_url,access_token, andrefresh_tokenvariables for your environment.
Base URL
| Environment | URL |
|---|---|
| Collection default | https://api-dev.almafrica.com |
| Staging | https://api-staging.almafrica.com |
| Production | https://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.
| Group | Endpoints |
|---|---|
| Auth | 7 |
| Agents | 10 |
| Analytics | 6 |
| Agent Collection Points | 5 |
| Collection Points (Admin) | 4 |
| Business Types | 5 |
Available Endpoints
Auth
| Method | Endpoint | Request |
|---|---|---|
POST | /api/Auth/register | Register Agent |
POST | /api/Auth/login | Login |
POST | /api/Auth/refresh-token | Refresh Token |
POST | /api/Auth/logout | Logout |
POST | /api/Auth/change-password | Change Password |
POST | /api/Auth/forgot-password | Forgot Password |
POST | /api/Auth/reset-password | Reset Password |
Agents
| Method | Endpoint | Request |
|---|---|---|
GET | /api/Agents?page=1&pageSize=10&searchQuery=&isActive=true&sortBy=CreatedAt&sortDescending=true | Get All Agents |
GET | /api/Agents/{id} | Get Agent by ID |
POST | /api/Agents | Create Agent |
PUT | /api/Agents/{id} | Update Agent |
DELETE | /api/Agents/{id} | Delete Agent |
POST | /api/Agents/{id}/deactivate | Deactivate Agent |
POST | /api/Agents/{id}/reactivate | Reactivate Agent |
POST | /api/Agents/bulk-import | Bulk Import Agents |
GET | /api/Agents/import-template | Download Import Template |
GET | /api/Agents/export | Export Agents |
Analytics
| Method | Endpoint | Request |
|---|---|---|
GET | /api/Analytics/dashboard-metrics | Get Dashboard Metrics |
GET | /api/Analytics/kpis | Get KPIs |
GET | /api/Analytics/regional-distribution | Get Regional Distribution |
GET | /api/Analytics/farmer-trends?periodType=Month&periods=12 | Get Farmer Trends |
GET | /api/Analytics/agent-trends?periodType=Month&periods=12 | Get Agent Trends |
GET | /api/Analytics/monthly-trends?months=12 | Get Monthly Trends |
Agent Collection Points
| Method | Endpoint | Request |
|---|---|---|
GET | /api/agent/collection-points/my-proposals?page=1&pageSize=10 | Get My Proposals |
POST | /api/agent/collection-points/propose | Propose 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)
| Method | Endpoint | Request |
|---|---|---|
GET | /api/admin/collection-points?page=1&pageSize=10&searchQuery=&status=Approved | Get All Collection Points |
GET | /api/admin/collection-points/{id} | Get Collection Point by ID |
POST | /api/admin/collection-points/{id}/approve | Approve Collection Point |
POST | /api/admin/collection-points/{id}/reject | Reject Collection Point |
Business Types
| Method | Endpoint | Request |
|---|---|---|
GET | /api/admin/business-types | Get All Business Types |
GET | /api/admin/business-types/{id} | Get Business Type by ID |
POST | /api/admin/business-types | Create 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:
| Environment | URL |
|---|---|
| Development | http://localhost:5000/swagger |
| Staging | https://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.jsonand rerun the sync script. - If developers need request bodies and ready-to-run examples, import the downloadable Postman collection.