REST API · v1 · live

Payroll ingestion, register generation and compliance status

Tenant scoping comes from the token, not from a request body. There is no tenant identifier to tamper with, which is what makes cross-tenant access structurally impossible rather than merely checked.

Base: /api/v1 Auth: Authorization: Bearer <token> Content-Type: application/json

Getting a token

Sign in, open Administration → API tokens and issue one. It is shown once. Tokens are signed with the server secret and carry only the organisation id, so rotating the secret revokes every token at once.

curl -H "Authorization: Bearer $TOKEN" \ https://complygrid-beta.vercel.app/api/v1/scorecard
GET /api/v1/health public

Liveness probe.

Response
{"status": "ok"}
POST /api/v1/applicability/evaluate public

Evaluate statutory applicability for one or more units. Public — the same engine the workspace uses.

Request body
{ "units": [ { "state": "Maharashtra", "unit_type": "factory", "headcount": 240, "contract_headcount": 60, "power_used": 1, "hazardous": 0 } ] }
Response
{"results": [{"unit": {...}, "applicable": [...], "not_applicable": [...]}]}
GET /api/v1/acts public

List the statutory library. Filter with ?category= and ?jurisdiction=.

Response
{"acts": [{"code": "EPF-1952", "name": "...", ...}]}
GET /api/v1/organisation token required

The calling tenant, its entities and units.

Response
{"organisation": {...}, "entities": [...], "locations": [...]}
GET /api/v1/compliance/tasks token required

Obligations. Filter with ?status=, ?period=, ?location_id=, ?due_before=.

Response
{"count": 128, "tasks": [...]}
POST /api/v1/compliance/tasks/<id>/submit token required

Record a maker submission with a challan reference.

Request body
{"challan_no": "TRRN7829103", "amount": 184500, "remarks": "Paid 14th"}
Response
{"id": 41, "status": "submitted"}
GET /api/v1/scorecard token required

The executive risk index with every component and weight.

Response
{"risk": {"index": 82.4, "band": "moderate", "components": [...]}}
POST /api/v1/payroll/batch token required

Ingest a payroll batch. Column names are normalised, statutory deductions computed, anomalies flagged. Replaces any existing run for the same unit and period.

Request body
{ "location_id": 3, "period": "2026-08", "records": [ { "emp_code": "EMP-10491", "name": "Sample Worker", "designation": "Machine Operator", "days_paid": 26, "ot_hours": 8, "basic": 18500, "da": 4200, "hra": 6000, "other_allow": 2500, "ot_amount": 1200 } ] }
Response
{"run_id": 12, "rows": 1, "totals": {...}, "flagged": [...]}
GET /api/v1/payroll/runs token required

List payroll runs for the tenant.

Response
{"runs": [...]}
POST /api/v1/registers/generate token required

Compile statutory registers from a run. Returns download links.

Request body
{"run_id": 12, "forms": ["FORM-A", "FORM-T", "FORM-XIX"]}
Response
{"generated": [{"id": 5, "form": "FORM-A", "rows": 240, "download": "/api/v1/registers/5/file"}]}
GET /api/v1/registers token required

List generated registers.

Response
{"registers": [...]}
GET /api/v1/registers/<id>/file token required

Download a generated register.

Response
binary
GET /api/v1/contractors token required

Contractors with their current scores.

Response
{"contractors": [...]}
GET /api/v1/contractors/reconciliation token required

Roster-vs-challan reconciliation for a period (?period=YYYY-MM), with the invoice release signal.

Response
{"period": "2026-08", "rows": [...]}
GET /api/v1/licenses token required

Licences with expiry banding and capacity-breach flags.

Response
{"licenses": [...], "expired": 1, "expiring": 3}

Try the public endpoint right now

Applicability evaluation needs no token. Edit the body and run it.