Admin incidents

Back-office panel for order incidents reported by clients and drivers: a CSV export, a cursor-paginated list, and a detail view with the order's context. Paths are relative to the /api/v1 prefix; these are back-office endpoints that require an admin token.

Requires an admin bearer token (see Admin auth). Admin only.

See Common errors. Incidents are created from the order flow — see Incidents.

Endpoints

Method URI Access Description
GET /admin/incidents/export Admin CSV export of incidents
GET /admin/incidents Admin Paginated incident list (cursor-based)
GET /admin/incidents/{incidentId} Admin Incident detail with order context

GET /admin/incidents/export

Streams the filtered incidents as a CSV download (text/csv); there is no JSON body on success. Accepts the same filters as the list. Capped at 10,000 rows.

Query

Field Type Required Rules
type string no one of ACCESO_BLOQUEADO, CLIENTE_NO_RESPONDE, DIRECCION_INCORRECTA, PROBLEMA_VEHICULO, AGUA_INSUFICIENTE, PROBLEMA_PAGO, OTRO
reporter_role string no CLIENT or DRIVER
order_id integer no filter by order
date_from date no filter created_at >=
date_to date no filter created_at <=; >= date_from

Response 200 — a text/csv stream (incidents_export_<timestamp>.csv) with the columns ID, Order ID, Order Status, Type, Reporter Role, Reporter Name, Description, Created At.

Errors

Status Body When
422 { "error": "TooManyResults", "message": "…" } More than 10,000 rows match the filters

GET /admin/incidents

Cursor-paginated list of incidents, newest first. See Pagination → cursor-based.

Query

Field Type Required Rules
type string no one of the incident type values (see export above)
reporter_role string no CLIENT or DRIVER
order_id integer no filter by order
date_from date no filter created_at >=
date_to date no filter created_at <=; >= date_from
limit integer no 1–100, default 25
cursor string no opaque cursor from next_cursor

Response 200

{
  "items": [
    {
      "id": 88,
      "order_id": 42,
      "order_status": "IN_PROGRESS",
      "type": "ACCESO_BLOQUEADO",
      "reporter_role": "DRIVER",
      "reporter": { "id": 3, "name": "Carlos RodrĂ­guez" },
      "description": "PortĂłn cerrado, nadie responde.",
      "created_at": "2026-06-26T12:34:00+00:00"
    }
  ],
  "next_cursor": "eyJpZCI6ODd9",
  "has_more": true
}

GET /admin/incidents/{incidentId}

Full incident detail, including the reporter's contact and the order's client and driver context.

Response 200

{
  "incident": {
    "id": 88,
    "type": "ACCESO_BLOQUEADO",
    "description": "PortĂłn cerrado, nadie responde.",
    "reporter_role": "DRIVER",
    "reporter": { "id": 3, "name": "Carlos RodrĂ­guez", "phone": "+584241001001" },
    "created_at": "2026-06-26T12:34:00+00:00",
    "order": {
      "id": 42,
      "status": "IN_PROGRESS",
      "address": "Av. Principal, Las Mercedes",
      "client": { "id": 1, "name": "Ana MartĂ­nez", "phone": "+584241000001" },
      "driver": { "id": 3, "name": "Carlos RodrĂ­guez", "phone": "+584241001001" }
    }
  }
}

order.driver is null when the incident's order has no assigned driver.

Errors

Status Body When
404 { "error": "IncidentNotFound" } Unknown incident id