Council developer API
Flag IT speaks Open311 GeoReport v2, so existing council CRM and highways systems can pull reports without new integration work. Every council gets its own API key and an HMAC-signed webhook.
1. Get your key
Council admins find the key in Council settings → API access. Send it as ?api_key= or the X-Api-Key header.
curl "https://your-app/api/open311/v2/requests?api_key=fi_live_..."2. Or take webhooks
Set a webhook URL and Flag IT posts JSON as reports arrive. Verify the X-FlagIT-Signature header: HMAC-SHA256 of the raw body, keyed with your webhook secret.
X-FlagIT-Event: report.created
X-FlagIT-Signature: sha256=5f2c...3. Keep it in sync
Push status changes back by calling GET /status, or let your officers work directly in the Flag IT council queue.
{ "service_request_id": "FI-8K2M4QX",
"status": "closed",
"status_notes": "Filled and resurfaced" }Endpoints
| Method | Path | Auth | What it does |
|---|---|---|---|
| GET | /api/open311/v2/discovery | Public | Service discovery document. |
| GET | /api/open311/v2/services | Public | Service codes you can report against. |
| GET | /api/open311/v2/requests | API key | Your council's reports. Filters: status, service_code, start_date, end_date, page, page_size. |
| POST | /api/open311/v2/requests | API key | Create a report inside your council. Accepts JSON or form-encoded bodies. |
| GET | /api/open311/v2/requests/{id} | API key | One report by Flag IT reference. |
| GET | /api/open311/v2/status | API key | Status for ?service_request_id=FI-XXXX. |
Service codes
The same codes are returned by /services.
pothole_road_damagefly_tippingunclaimed_rubbishstreet_light_faultpavement_damagegraffitiblocked_draintree_issueabandoned_vehicleotherCreate a report
Useful when a council phone line takes a report that should also appear in Flag IT.
POST /api/open311/v2/requests
Content-Type: application/json
{
"api_key": "fi_live_...",
"service_code": "pothole_road_damage",
"description": "Pothole 30cm wide outside the school gate",
"address_string": "Kirkstall Road, Leeds",
"lat": 53.8041,
"long": -1.5591,
"email": "highways@council.gov.uk"
}Responses use the Open311 shape: [{"service_request_id","service_notice","account_id"}].