-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference
Akash Goswami edited this page Jun 29, 2026
·
1 revision
All endpoints under /api/v1. Every endpoint except POST /auth/login and GET /health requires Authorization: Bearer <jwt>.
Single resource: { data, error }. List: { data, meta, error }. On success error is null; on failure data is null.
{
"data": [ /* items */ ],
"meta": { "total_count": 1250, "page": 1, "page_size": 50, "total_pages": 25 },
"error": null
}| Method | Route | Description |
|---|---|---|
| GET | /api/v1/health |
DB connectivity health check (unauthenticated) |
| POST | /api/v1/auth/login |
Verify password, issue JWT, return user + sites |
| GET | /api/v1/auth/me |
Current user profile + sites (session rehydration) |
| GET | /api/v1/sites |
Sites the authenticated user can access |
| GET | /api/v1/batches |
Paginated/filterable/sortable batch list |
| GET | /api/v1/batches/{id} |
Batch detail summary |
| GET | /api/v1/batches/{id}/files |
Files in a batch (paginated) |
| GET | /api/v1/dashboard/summary |
Status counters |
| GET | /api/v1/dashboard/throughput?range=7d |
Throughput chart series |
| GET | /api/v1/dashboard/status-distribution |
Status breakdown |
| GET | /api/v1/dashboard/recent-failures |
Paginated recent failures |
| GET | /api/v1/files/{id}/details |
File step history + error + remediation |
| GET | /api/v1/files/{id}/line-items |
Invoice line items + categories + totals |
| GET | /api/v1/errors/top-frequencies |
Top 10 errors + remediation |
| GET | /api/v1/errors/trend?range=30d |
Error trend series |
| GET | /api/v1/errors |
Filtered/paginated error list |
| GET | /api/v1/errors/export |
CSV export of filtered errors |
| GET | /api/v1/activity-log |
Paginated, filtered audit trail |
| Code | When |
|---|---|
| 200 | Success |
| 400 | Validation failure (bad date, pageSize > 100, bad enum) |
| 401 | Missing / invalid / expired JWT |
| 403 | Authenticated but not authorized for the requested site (SITE_FORBIDDEN) |
| 404 | Resource ID does not exist |
| 500 | Unhandled exception (logged, generic message returned) |
Password for all seed users: Password123!
| Role | Tenant | Sites the user can access | |
|---|---|---|---|
user.a@acme.com |
Viewer | Acme | Mumbai, Delhi |
admin@acme.com |
Admin | Acme | all 3 (Mumbai, Delhi, Chennai) |
user.b@acme.com |
Viewer | Acme | Chennai only |
user.c@globex.com |
Viewer | Globex | Berlin only |
admin@globex.com |
Admin | Globex | both (Berlin, Munich) |
Access is uneven on purpose so you can demonstrate 403
SITE_FORBIDDEN(see Tenant and Site Isolation).
-
GET /api/v1/health→{ "status": "healthy", "db": "connected" } -
POST /api/v1/auth/login(Acme user) → JWT + sites - Click Authorize, paste the token (no
Bearerprefix) -
GET /api/v1/auth/me→ your profile + sites -
GET /api/v1/sites→ your authorized sites - Wrong password → clean 401 with
INVALID_CREDENTIALSenvelope -
GET /api/v1/batches→ your tenant's batches - Log in as
user.c@globex.com→ confirm you cannot see Acme's data (cross-tenant isolation) - Log in as
user.b@acme.com(Chennai only), setX-Site-Idto Mumbai → 403SITE_FORBIDDEN(site-level isolation, FR-5.3)