End Session

Manually end a Cannonball tracking session

POST /api/v1/cannonball/sessions/{id}/end/

Manually ends a tracking session. Use this to close sessions that are no longer relevant or to mark threats as cleared.

Path Parameters

ParameterTypeDescription
idintegerSession ID to end

Request Body

No request body required.

Response

{
  "id": 1,
  "icao_hex": "A12345",
  "callsign": "N123HP",
  "registration": "N123HP",
  "identification_method": "database",
  "identification_reason": "Known LAPD helicopter",
  "operator_name": "Los Angeles Police Department",
  "operator_icao": null,
  "aircraft_type": "EC130",
  "is_active": false,
  "threat_level": "warning",
  "threat_level_display": "Warning",
  "urgency_score": 75.0,
  "last_lat": 34.0522,
  "last_lon": -118.2437,
  "last_altitude": 1500,
  "last_ground_speed": 85,
  "last_track": 270,
  "distance_nm": 2.5,
  "bearing": 45.0,
  "closing_speed_kts": 15.0,
  "first_seen": "2024-01-15T12:00:00Z",
  "last_seen": "2024-01-15T12:30:00Z",
  "session_duration_seconds": 1800,
  "pattern_count": 3,
  "alert_count": 2,
  "position_count": 150,
  "patterns": [
    {
      "id": 1,
      "pattern_type": "circling",
      "confidence": "high",
      "confidence_score": 0.92,
      "detected_at": "2024-01-15T12:15:00Z",
      "duration_seconds": 300
    }
  ],
  "metadata": {}
}

Response Fields

FieldTypeDescription
idintegerSession ID
icao_hexstringAircraft ICAO hex code
callsignstringAircraft callsign
registrationstringAircraft registration number
identification_methodstringHow aircraft was identified
identification_reasonstringHuman-readable identification reason
operator_namestringAircraft operator name
operator_icaostringOperator ICAO code
aircraft_typestringAircraft type designation
is_activebooleanFalse after ending
threat_levelstringThreat level at time of ending
threat_level_displaystringHuman-readable threat level
urgency_scorefloatFinal urgency score
last_latfloatLast known latitude
last_lonfloatLast known longitude
last_altitudeintegerLast known altitude in feet
last_ground_speedintegerLast known ground speed in knots
last_trackintegerLast known track in degrees
distance_nmfloatLast distance from user
bearingfloatLast bearing from user
closing_speed_ktsfloatLast closing speed
first_seenstringSession start timestamp
last_seenstringSession end timestamp
session_duration_secondsintegerTotal session duration
pattern_countintegerTotal patterns detected
alert_countintegerTotal alerts generated
position_countintegerTotal position updates received
patternsarrayList of patterns detected during session
metadataobjectAdditional session metadata

Example Request

curl -X POST "https://api.skyspy.io/api/v1/cannonball/sessions/1/end/" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response Codes

CodeDescription
200Session ended successfully
404Session not found
401Unauthorized - Invalid or missing authentication