Blog·Craft·

A state carries its own districts list

/state/{code}/districts nests every county or department under the state, the same pattern one level down from country.

A dropdown never stops at one list.

GET /state/NC/districts?country=US
{ "country": "US", "country_name": "United States", "state": "NC", "state_name": "North Carolina", "districts": [{ "district": "37001", "name": "Alamance County", "type": "county", "population": 183040 }, ...] }

Same shape as /country/{code}/states, one level down. A state resolves to its own districts on the same route, no second call against /district with a filter param bolted on. ?country= stays on the state call because state codes collide across countries.

Three calls, one direction

Country to states to districts is a straight line: /country/{code}/states for the first list, /state/{code}/districts?country={code} for the next. Neither needs the other's response reshaped, both hand back the same code/name/type fields, so the same dropdown component that renders the state list renders the district list underneath it.

Try it

Walk from /country/fr/states into /state/IDF/districts?country=FR. Same pattern, French names throughout. It gets predictable fast. That's the feature.