Basic Usage
Core usage patterns for UrbanReflex APIs
Basic Usage
Base (dev): http://localhost:8000 (Swagger: /docs, ReDoc: /redoc, schema: /openapi.json). All endpoints use /api/v1/ prefix unless noted.
Auth status: In dev most endpoints are open. Planned: JWT Bearer (Authorization: Bearer <token>) and API Key (X-API-Key). Examples below show headers but they may be optional in dev.
Quick Calls (cURL)
Health
List citizen reports (with filters)
Create citizen report
Classify citizen report
AI chatbot (non-streaming)
NGSI-LD direct (Orion-LD)
Python (httpx, async)
TypeScript (fetch)
Response Shapes (typical)
List with pagination:
Error format (consistent):
Tips
- Pagination: use
limit/offset(orpage), defaults: limit 100, offset 0 (see API reference). - Filtering: common params
category,priority,status,type,created_after,created_before. - Sorting:
sort_by,order=asc|desc(default desc). - Chat streaming: omit
?stream=falseto receive SSE events (data: {"type":"token",...}).
For full endpoint list, auth plans, and examples, see docs/API_REFERENCE.md.
