Products How to Use Guide API Docs Desktop Downloads Contact About
API REFERENCE · v1

FlyNat API Documentation

Complete reference for integrating with the FlyNat UTM server. Covers pilot sessions, live telemetry, DJI Cloud API, and ASTM F3411 feeds.

Introduction


The FlyNat API is a RESTful server built in Rust, running at api.flynat.net. It serves two audiences:

1. FlyNat Mobile App — manages pilot sessions, receives GPS telemetry, and exposes a live pilot feed for the map.

2. DJI Pilot 2 (Enterprise Drones) — implements the DJI Cloud API v2 protocol so that Mavic 3E, Matrice, and other enterprise DJI drones can connect directly and stream real-time OSD telemetry via MQTT.

All endpoints are served over HTTPS (TLS 1.3) via Cloudflare. No unencrypted connections are accepted.

Base URL & Connection


ServiceAddressProtocol
REST APIhttps://api.flynat.netHTTPS / TLS 1.3

How It All Connects


The full data flow from a DJI enterprise drone to the UTM authority feed:

Enterprise Drone
DJI Mavic 3E
App on Controller
DJI Pilot 2
Rust Server
api.flynat.net
Realtime DB
Firebase
ASTM F3411
UTM Feed

The FlyNat Mobile App connects via a parallel path — sharing the pilot's GPS location and creating sessions that get merged with DJI telemetry using the pilot's Firebase UID as the common identifier.

Pilot Sessions


Sessions track when a pilot is actively flying. The FlyNat Mobile App creates a session when SHARE MY LOCATION is activated.

Create Session

POST /api/v1/sessions

Creates a new pilot session. Called automatically by the FlyNat app when sharing starts.

Request body
{
  "firebase_uid":  "google-uid-123",
  "pilot_name":   "Avi Cohen",
  "drone_model":  "DJI Mavic 3E",
  "altitude":     80,
  "mission_type": "Survey"
}
Response 201
{
  "session_id": "uuid-v4",
  "started_at": "2025-04-02T10:00:00Z"
}

End Session

DELETE /api/v1/sessions/:session_id

Closes an active session. Called automatically when the pilot stops sharing location.

Live Pilots


GET /api/v1/pilots/live

Returns all pilots with an active session seen within the last 30 seconds.

Response 200
[
  {
    "session_id":   "uuid-v4",
    "firebase_uid": "google-uid-123",
    "pilot_name":   "Avi Cohen",
    "drone_serial": "1ZNBC8D0D10001",
    "started_at":   "2025-04-02T10:00:00Z",
    "last_seen":    "2025-04-02T10:15:30Z",
    "active":       true
  }
]

UTM Feed (ASTM F3411)


The UTM feed exposes real-time drone telemetry in ASTM F3411-22a format. This endpoint is intended for aviation authorities (CAAA / רת"א) to monitor active drone operations.

GET /api/v1/utm/feed
Response 200 · ASTM F3411-22a
[
  {
    "uas_id":    "1ZNBC8D0D10001",
    "timestamp": "2025-04-02T10:15:30Z",
    "uas_location": {
      "latitude":     32.0853,
      "longitude":    34.7818,
      "altitude_geo": 80.0,
      "altitude_agl": 75.0
    },
    "uas_velocity": {
      "speed": 8.2,
      "track": 145.0
    }
  }
]

DJI Cloud API — Pilot Login


DJI Pilot 2 calls this endpoint when the pilot logs into the cloud server on the RC controller. The server verifies the credentials against Firebase and returns a session token.

POST /pilotserver/api/v1/users/login
Request body
{
  "username": "google-uid-123",   // Firebase UID from FlyNat App → Profile
  "password": "FlyNat14chars"    // Auto-generated password from FlyNat App → Profile
}
Response 200
{
  "code": 0,
  "data": {
    "token":        "flynat-uuid-v4",
    "user_id":      "google-uid-123",
    "username":     "Avi Cohen",
    "workspace_id": "flynat-workspace-001"
  }
}
After successful login, DJI Pilot 2 automatically connects to the FlyNat server and begins streaming drone telemetry in real time.

DJI Cloud API — Device Binding


When a drone powers on and connects to DJI Pilot 2, the app binds the drone serial number to the authenticated pilot. This creates a verified session linking pilot identity to drone.

POST /manage/api/v1/devices/binding
Request · Authorization: Bearer <token>
{
  "device_sn":   "1ZNBC8D0D10001",
  "device_name": "Mavic 3E - Unit 1"
}

Setting Up in FlyNat App


To connect DJI Pilot 2 to the FlyNat server, follow these steps:

  1. Install FlyNat MobileDownload and install the FlyNat LogBook app on your Android device. Sign in with your Google account.
  2. Open Your ProfileTap the Profile tab. You will see the DJI Cloud Credentials card with your auto-generated Username and Password.
  3. Copy the CredentialsTap the copy icon next to each field. These credentials are unique to your Google account and never change.
  4. Open DJI Pilot 2 on the RC ControllerGo to ··· → Cloud Services → Add Cloud Server.
  5. Enter Server DetailsServer URL: https://api.flynat.net · Username and Password from your profile.
  6. Power On Your DroneOnce connected, the drone automatically binds and begins streaming telemetry. Your pilot identity is verified in real-time.

DJI Credentials Explained


The credentials shown in the FlyNat app Profile screen are generated automatically from your Google account ID. They are deterministic — the same account always produces the same password.

FieldValueNotes
UsernameYour Google Account IDUnique Firebase UID
Password14-character auto-generatedStored encrypted in Firebase
Server URLhttps://api.flynat.netEnter once in DJI Pilot 2
Do not share your DJI credentials with others. Each pilot must use their own FlyNat app credentials so that telemetry is correctly linked to their certified pilot record.
VIDEO GUIDE
How to Connect DJI RC to FlyNat API — Live Map Setup Guide
Step-by-step guide to configure DJI Pilot 2 Cloud Services with your FlyNat credentials and appear on the Live Map in real time.