Skip to content

API cheat sheet (plain language)

This page lists the main endpoints used for occurrences. Your environment may use a different base URL, but paths are consistent.

Citizen / Public

  • Submit an occurrence: POST /api/occurrences/public_submit/
  • Includes location validation and duplicate checking
  • May return a “duplicate detected” response (HTTP 409) depending on policy

  • Check duplicates (before submitting): POST /api/occurrences/check_duplicates/

  • Returns “has duplicates” + suggested action + list of similar reports

Staff / Backoffice

  • List/manage occurrences (backoffice): GET /api/backoffice/occurrences/
  • Transition state: POST /api/occurrences/{id}/transition_state/

Templates (Backoffice)

  • List templates: GET /api/backoffice/templates/
  • Get templates applicable to an occurrence: GET /api/backoffice/templates/for_occurrence/?occurrence_id={id}
  • Preview a template: POST /api/backoffice/templates/preview/
  • Apply a template: POST /api/backoffice/templates/apply/

States (Backoffice)

  • List states: GET /api/backoffice/states/
  • Get allowed transitions for an occurrence: GET /api/backoffice/states/allowed_transitions/?occurrence_id={id}

Behind the scenes (grounded in code)

  • Routes are defined in config/api_router.py.
  • Implementations live in apps/occurrences/views.py.