API Reference v1
REST API Documentation
All endpoints return JSON. Authenticated requests require a Bearer token in the Authorization header.
v1.0.0
All systems operational
Authentication
POST
/v1/auth/sessionCreate a session for a role.
{ "role": "operator" }DELETE
/v1/auth/sessionAuth requiredSign out the current session.
Customers
GET
/v1/customersAuth requiredList customers with filters & pagination.
POST
/v1/customersAuth requiredCreate a new customer with custom fields.
{ "name": "Studio Ferrari", "address": "Via Roma 12", "city": "Milano",
"wasteType": "toner", "cerCode": "080318",
"pickupFrequencyDays": 30 }GET
/v1/customers/{id}Auth requiredFetch a single customer with status.
PATCH
/v1/customers/{id}Auth requiredUpdate customer fields.
DELETE
/v1/customers/{id}Auth requiredPermanently delete a customer.
GET
/v1/customers/{id}/statusAuth requiredGet traffic-light status & overdue days.
{ "status": "red", "daysSinceLast": 75, "overdueDays": 45 }Pickups
GET
/v1/pickupsAuth requiredList pickups (filter by date, driver, status).
POST
/v1/pickupsAuth requiredSchedule a new pickup.
PATCH
/v1/pickups/{id}Auth requiredUpdate status (start, complete, cancel).
{ "status": "completed", "weightKg": 12 }DELETE
/v1/pickups/{id}Auth requiredDelete a pickup record.
Routes
GET
/v1/routesAuth requiredList planned and completed routes.
POST
/v1/routesAuth requiredCreate a route from selected customers.
POST
/v1/routes/{id}/suggestAuth requiredGet on-the-way overdue suggestions.
{ "suggestions": [{ "customerId": "c-003", "overdueDays": 50 }] }GET
/v1/routes/{id}/pdfAuth requiredGenerate one-page driver PDF sheet.
Imports
POST
/v1/imports/excelAuth requiredUpload Excel dataset and recompute history.
Analytics
GET
/v1/analytics/backlogAuth requiredCounts by status across all customers.
{ "green": 4, "yellow": 1, "red": 3 }GET
/v1/analytics/throughputAuth requiredPickups completed per week.