For the latest stable version, please use Unifly Services v4.7!

Unifly GCS API Developer Guide

This guide helps developers integrate Ground Control Stations with the Unifly UTM Platform using the GCS API.

Getting Started

Prerequisites

Before using the GCS API, you need:

  • A valid Unifly Operator account

  • An API key for authentication

Authentication

Obtaining an API Key

  1. Log in to the Unifly Operator Web App

  2. Click your operator name in the top left

  3. Select "Operator settings"

  4. Click the pencil icon next to "API Keys"

  5. Click "Generate new"

api key

Store your API key securely. Never share or commit it to version control.

Using the API Key

Include your API key in all REST requests:

apikey: your-api-key-here

Using the REST API Documentation

The REST API documentation is an interactive OpenAPI documentation that helps you understand the API endpoints.

Understanding the Structure

The documentation is organized by tags/categories:

Main Sections

The left sidebar shows the main API categories (tags):

  • Flight Status - for managing flight execution

  • Operations - for planning and managing operations

  • PermissionRequests - for authorization workflows

  • UAS - for drone fleet management

  • Geofences - for airspace information

Endpoint Documentation

Each endpoint shows:

  1. HTTP Method & Path

    • The HTTP verb (GET, POST, etc.)

    • The endpoint path with any path parameters

  2. Parameters

    • Path parameters - variables in the URL path

    • Query parameters - optional URL parameters

    • Header parameters - required headers

    • Request body - payload structure if needed

  3. Responses

    • Success responses with example payloads

    • Error responses with error codes

    • Response schema descriptions

Click an endpoint to expand its full documentation including all parameters, request/response examples and possible error scenarios.

Reading an Endpoint

Taking the takeoff endpoint as an example:

API spec screen

Each endpoint documentation shows:

  1. The HTTP method (POST, GET, etc.) and endpoint path

  2. Required parameters:

    • Path parameters (like {serialNumber})

    • Header parameters (like apikey)

  3. Expected responses:

    • Success responses (200, 201)

    • Error responses (401, 403, 404, 409)

  4. Sample request/response payloads

Click the endpoint to expand and see all details including sample responses.

Using the MQTT API Documentation

The MQTT API documentation is an interactive AsyncAPI documentation that helps you understand the available MQTT topics and message formats.

Understanding the Structure

The documentation is organized by topic categories:

Main Categories

The documentation shows two main types of interactions:

  • Publish - topics where you send data to UTM

  • Subscribe - topics where you receive data from UTM

Click a topic to expand its full documentation including all message formats and examples.

Connection Requirements

All MQTT connections require:

  • Host: portal.demo.unifly.tech

  • Port: 8883 (TLS)

  • Protocol: MQTT v5

  • Authentication:

    • Username: your-api-key-here

    • Password: your-api-key-here

TLS encryption is mandatory - unencrypted connections will be rejected.

API Flow Overview

The typical flow for using the GCS API follows these steps:

Diagram
  1. Register UAS (REST)

  2. Create Operation (REST)

  3. Request Operation Acceptance (REST)

  4. Submit Permission Requests (REST)

  5. Request Operation Activation (REST)

  6. Take-off (REST)

  7. Send Telemetry (MQTT)

  8. Real-time alerts (MQTT)

  9. Land (REST)

1. Register UAS

Before you can start any operation, you need to register your UAS (drone) in the system. This creates a digital representation of your drone that can be used in operations.

API Reference

Refer to the Create UAS endpoint in the API documentation.

Key Concepts

  • Each UAS must have a unique serialNumber within your organization

  • The registration includes three main feature sets:

    • generalFeatures - physical characteristics of the drone

    • flightFeatures - operational capabilities

    • controllerFeatures - command and control information

API Examples

See the following examples for common API calls:

2. Create Operation

Creating an operation defines when and where you plan to fly. Operations management involves several API endpoints for the complete lifecycle.

API Reference

Key Concepts

Operation States

An operation goes through several states:

  • DRAFT → Initial state

  • PENDING_ACCEPTANCE → Waiting for acceptance

  • ACCEPTED → Operation accepted

  • PENDING_ACTIVATION → Waiting for activation

  • ACTIVATED → Ready for execution

  • ENDED/WITHDRAWN → Terminal states

Operations must be created with sufficient lead time before the planned flight to allow for validation and authorization processes.

API Examples

See the following examples for common API calls:

Selecting Flight Rules, Pilot, and Observers

When creating an operation, make sure to provide the following fields in the request body:

  • rulesetCode – code of the applicable operational rules (e.g., opena1). See the API reference for supported values.

  • lineOfSightType – how the mission will be flown (e.g., VLOS). See the API reference for supported values.

  • pilotUuid – UUID of the pilot-in-command. Retrieve candidates with the List Pilots Example.

  • observerUuids(optional) array of UUIDs of observers.
    The same UUID as the pilot is not allowed.
    If no observers are needed for the operation, this field can be left out.
    Retrieve candidates with the List Observers Example.

See Create Operation Example for a complete payload.

3. Request Operation Acceptance

After creating an operation and passing initial validation, you need to request acceptance. This step initiates the authorization process.

API Reference

Use the Request Acceptance endpoint to move your operation to the acceptance phase.

Some operations may require additional permission requests after acceptance. Monitor the operation status for any such requirements.

API Examples

See the following examples for common API calls:

4. Submit Permission Requests

Permission requests may be required based on your operation’s location, timing, or other characteristics. These requests must be submitted and approved before activating the operation.

API Reference

Use the Submit Permission Requests endpoint to submit all pending permission requests for an operation.

API Examples

See the following examples for common API calls:

5. Request Operation Activation

The operation needs to be activated before take-off can be requested. Activation confirms the operation is ready for immediate execution.

API Reference

Use the Request Activation endpoint to activate your operation.

Key Concepts

Activation Prerequisites
  • Operation must be in ACCEPTED state

  • All required permissions must be approved

  • Operation time window must be valid

  • No conflicting operations in the area

Operations can only be activated within their planned time window. Early or late activation requests will be rejected.

API Examples

See the following examples for common API calls:

6. Take-off

After operation activation, take-off must be declared to indicate the start of the actual flight. This is crucial for UTM awareness and tracking.

API Reference

Use the Take-off endpoint to declare the start of your flight.

Key Concepts

Take-off Prerequisites
  • Operation must be in ACTIVATED state

  • UAS must not be already in flight

API Examples

See the following examples for common API calls:

7. Get Company Information

You can retrieve your company UUID using your API key. This is useful when you need to reference your company identifier in other API calls (e.g., telemetry topics).

8. Send Telemetry

Once the flight is initiated, telemetry data is sent via MQTT for real-time tracking and monitoring.

MQTT Connection Details

Connection Parameters
  • Host: {base_url}

  • Port: 8883

  • Protocol: MQTT over TLS (v5)

  • Authentication:

    • Username: your-api-key-here

    • Password: your-api-key-here

Always use TLS encryption - unencrypted connections are not accepted.

MQTT Topics

Publishing Topics
  • telemetry/{companyUid}/{serialNumber}/location - position updates

  • telemetry/{companyUid}/{serialNumber}/heading - heading changes

  • telemetry/{companyUid}/{serialNumber}/velocity - speed updates

  • telemetry/{companyUid}/{serialNumber}/emergencyStatus - emergency declarations

Subscription Topics
  • tracking/nearby/{companyUid}/{serialNumber}/{trackId} - nearby traffic information

Replace {companyUid}, {serialNumber}, {trackId} with your actual values.

MQTT publish examples

9. Real-time alerts

The UTM platform sends real-time alerts about potential conflicts, emergency situations, and airspace changes that affect your flight.

API Reference

Use the Nearby Alerts subscription to receive alerts relevant to your UAS.

Subscription Details

Topic Pattern

alerts/nearby/{companyUid}/{serialNumber}/{alertId}

Parameters
  • {companyUid} - Your company unique identifier

  • {serialNumber} - Your UAS serial number

  • {alertId} - Unique identifier for the alert

Use wildcards in your subscription to receive all alerts for your UAS: alerts/nearby/{companyUid}/{serialNumber}/#

MQTT subscribe examples

10. Request Landing

When the flight is complete, you must declare the landing. This closes the active flight tracking and updates the operation status.

API Reference

Use the Landing endpoint to declare the end of your flight.

Key Concepts

Landing Prerequisites
  • UAS must be in flight status (after take-off)

Post-Landing Actions
  • Flight tracking stops

  • Telemetry streaming can stop

  • MQTT subscriptions can be cleaned up

  • Operation status updates

Don’t end the operation until you’re certain no more flights are needed within the operation time window.