Marker API Documentation

REST API endpoints for managing location markers in the system

GET
/marker

Gets all markers currently in the database

Responses

200
Successfully retrieved all markers
[
  {
    "id": "1",
    "position": [
      51.52016005,
      -0.16030636023550826
    ],
    "description": "Cat in the hat is lost",
    "title": "Lost Cat",
    "urgency": "High",
    "category": "Crime",
    "status": "Active",
    "address": {
      "street": "Beck Dr",
      "city": "Markham",
      "state": "Ontario",
      "postal_code": "",
      "country": "Canada"
    },
    "createdAt": "2025-10-05T10:30:00Z",
    "updatedAt": "2025-10-05T10:30:00Z"
  }
]
POST
/marker

Create a new marker with required fields

Request Body

Required

Example

{
  "position": [
    51.52016005,
    -0.16030636023550826
  ],
  "description": "Cat in the hat is lost",
  "title": "Lost Cat",
  "urgency": "High",
  "category": "Crime",
  "address": {
    "street": "Beck Dr",
    "city": "Markham",
    "state": "Ontario",
    "postal_code": "",
    "country": "Canada"
  }
}

Responses

201
Marker created successfully
{
  "id": "2",
  "position": [
    51.52016005,
    -0.16030636023550826
  ],
  "description": "Cat in the hat is lost",
  "title": "Lost Cat",
  "urgency": "High",
  "category": "Crime",
  "status": "Active",
  "address": {
    "street": "Beck Dr",
    "city": "Markham",
    "state": "Ontario",
    "postal_code": "",
    "country": "Canada"
  },
  "createdAt": "2025-10-05T10:30:00Z",
  "updatedAt": "2025-10-05T10:30:00Z"
}
400
Bad request - missing required fields or invalid data
{
  "error": "Validation failed",
  "message": "Missing required field: position",
  "details": {
    "field": "position",
    "code": "REQUIRED_FIELD_MISSING"
  }
}
POST
/submit-report-gemini

Submit a report description to Gemini AI for automated report generation. Returns a structured report object based on the description provided.

Request Body

Required

Example

{
  "description": "There's a large pothole on Main Street near the intersection with Oak Avenue that's causing damage to cars"
}

Responses

200
Successfully generated report from description
{
  "report": {
    "category": "Infrastructure",
    "position": [
      43.6532,
      -79.3832
    ],
    "title": "Large Pothole Report",
    "urgency": "Medium",
    "description": "Large pothole on Main Street near Oak Avenue intersection causing vehicle damage",
    "address": {
      "street": "Main Street & Oak Avenue",
      "city": "Toronto",
      "state": "Ontario",
      "postal_code": "M5V 1A1",
      "country": "Canada"
    }
  }
}
400
Bad request - missing or invalid description
{
  "error": "Validation failed",
  "message": "Description is required",
  "details": {
    "field": "description",
    "code": "REQUIRED_FIELD_MISSING"
  }
}
500
Internal server error - AI processing failed
{
  "error": "AI Processing Error",
  "message": "Failed to process report with Gemini AI",
  "details": {
    "code": "GEMINI_API_ERROR"
  }
}