Repository navigation
Mission API
Accessor: server.mission
Server documentation: https://docs.tak.gov/api/takserver#tag/mission-api
All examples in this page use an async client. Set it up once — every snippet below is a fragment that runs inside main():
import asyncio
from python_takserver_api import Server
# Connects to https://tak.example.com:8443 using mutual TLS
srv = Server(host="tak.example.com", cert="client.pem", key="client-key.pem")
async def main() -> None:
# ... your mission API calls go here ...
await srv.close()
asyncio.run(main())Every function in this API returns (status_code, data). status_code is the HTTP status; data is the parsed JSON payload, or the raw response text when the response is not JSON (e.g. ZIP or KML output). On connection errors you get (999, error_text).
You will want to save the token returned by create_mission() and create_mission_subscription() — most write operations (content, keywords, roles, subscriptions) require it as a bearer token.
Usage: await server.mission.get_mission(name, password=None, changes=False, logs=False, secago=None, start=None, end=None)
Returns the full mission with name name.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
password |
str |
(Optional) Mission password, required if the mission is password-protected |
changes |
bool |
(Optional) Include the mission's change history in the response |
logs |
bool |
(Optional) Include the mission's logs in the response |
secago |
int |
(Optional) Only include content and changes from the last N seconds |
start |
str |
(Optional) Only include content and changes from this start time (ISO 8601) |
end |
str |
(Optional) Only include content and changes until this end time (ISO 8601) |
Returns: (status_code, mission_data)
Example:
status, data = await srv.mission.get_mission(
name="area-recon",
changes=True,
logs=True,
)Usage: await server.mission.get_mission_names(password_protected=None, default_role=None, tool=None)
Returns the names of all missions the certificate user can see on the server.
| Parameter | Type | Description |
|---|---|---|
password_protected |
bool |
(Optional) Only list missions with (True) or without (False) a password |
default_role |
str |
(Optional) Only list missions with this default role. Valid values: MISSION_SUBSCRIBER, MISSION_OWNER, MISSION_READONLY_SUBSCRIBER
|
tool |
str |
(Optional) Only list missions for this tool (e.g. public, private) |
Returns: (status_code, names_data) — a list of mission names.
Example:
status, data = await srv.mission.get_mission_names()
if status == 200:
for mission in data:
print(mission)Usage: await server.mission.get_paged_missions(page=None, pagesize=None, sort=None, name_filter=None, uid_filter=None, ascending=None, password_protected=None, default_role=None, tool=None)
Returns a single page of missions with filtering and sorting. Useful on servers with lots of missions where get_mission_names() would return too much.
| Parameter | Type | Description |
|---|---|---|
page |
int |
(Optional) Page number, 0-based |
pagesize |
int |
(Optional) Number of missions per page |
sort |
str |
(Optional) Sort field (e.g. createTime, name) |
name_filter |
str |
(Optional) Only missions whose name contains this string |
uid_filter |
str |
(Optional) Only missions containing this content UID |
ascending |
bool |
(Optional) Sort direction, True for ascending |
password_protected |
bool |
(Optional) Only missions with (True) or without (False) a password |
default_role |
str |
(Optional) Only missions with this default role |
tool |
str |
(Optional) Only missions for this tool |
Returns: (status_code, paged_data)
Example:
status, data = await srv.mission.get_paged_missions(
page=0,
pagesize=10,
sort="createTime",
ascending=False,
name_filter="recon",
)Usage: await server.mission.get_mission_count(password_protected=None, default_role=None, tool=None)
Returns the number of missions on the server, optionally filtered the same way as get_mission_names().
| Parameter | Type | Description |
|---|---|---|
password_protected |
bool |
(Optional) Only count missions with (True) or without (False) a password |
default_role |
str |
(Optional) Only count missions with this default role |
tool |
str |
(Optional) Only count missions for this tool |
Returns: (status_code, count_data)
Example:
status, data = await srv.mission.get_mission_count()
print(f"Missions on server: {data}")Usage: await server.mission.create_mission(name, creator_uid, group="", default_role="", classification="")
Creates a mission. You will want to save the token in the returned data for further use.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
creator_uid |
str |
UID of the creating client |
group |
str |
(Optional) Group to associate with the mission |
default_role |
str |
(Optional) Default role for subscribers. Must be ALL_CAPS. Valid values: MISSION_SUBSCRIBER, MISSION_OWNER, MISSION_READONLY_SUBSCRIBER
|
classification |
str |
(Optional) Classification marking |
Returns: (status_code, mission_data) — the returned data contains the token needed for subsequent API calls.
Example:
status, data = await srv.mission.create_mission(
name="area-recon",
creator_uid="UAV-007",
group="recon-team",
default_role="MISSION_SUBSCRIBER",
)
# Save the token from the response
token = data.get("token")Usage: await server.mission.delete_mission(name, creator_uid=None, deep_delete=False)
Deletes the mission with name name. There is no undo — the mission and its subscriptions are gone.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
creator_uid |
str |
(Optional) UID of the requesting client |
deep_delete |
bool |
(Optional) Also delete the mission's content. Default is False, which only deletes the mission itself.
|
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.delete_mission(
name="area-recon",
deep_delete=True,
)Usage: await server.mission.delete_mission_by_guid(guid, creator_uid=None, deep_delete=False)
Deletes a mission identified by its GUID instead of its name. Same semantics as delete_mission() — the GUID is what you find in the guid field of the mission object returned by create_mission() or get_mission().
| Parameter | Type | Description |
|---|---|---|
guid |
str |
Mission GUID (UUID) |
creator_uid |
str |
(Optional) UID of the requesting client |
deep_delete |
bool |
(Optional) Also delete the mission's content |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.delete_mission_by_guid(
guid="27e8a1d9-9804-4be8-a538-fba9f3d2abe8",
)Usage: await server.mission.copy_mission(name, creator_uid, copy_name, copy_path=None, default_role=None, password=None)
Copies a mission to a new mission with the given name. Handy for reusing a mission template — the copy gets fresh content, and you can hand it a different default role or a password right away.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Name of the mission to copy |
creator_uid |
str |
UID of the requesting client |
copy_name |
str |
Name of the new mission. Required. |
copy_path |
str |
(Optional) Path of the new mission |
default_role |
str |
(Optional) Default role for the new mission |
password |
str |
(Optional) Password for the new mission |
Returns: (status_code, mission_data)
Example:
status, data = await srv.mission.copy_mission(
name="area-recon",
creator_uid="UAV-007",
copy_name="area-recon-backup",
)Usage: await server.mission.get_mission_archive(name)
Returns a ZIP archive of the mission's content. The response is not JSON — data is the raw archive bytes, so write it straight to a file.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
Returns: (status_code, archive_bytes)
Example:
status, data = await srv.mission.get_mission_archive(name="area-recon")
if status == 200:
with open("area-recon.zip", "wb") as f:
f.write(data)Usage: await server.mission.send_mission(name)
Sends the mission to all subscribed users — i.e. it pushes the current mission state out to everyone subscribed, which is handy after bulk changes so clients don't have to wait for the next sync.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.send_mission(name="area-recon")Usage: await server.mission.get_mission_parent(name)
Returns the parent mission of a mission. Missions can be organized hierarchically — child missions inherit the parent's subscriptions and content context.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
Returns: (status_code, parent_data)
Example:
status, data = await srv.mission.get_mission_parent(name="area-recon-east")Usage: await server.mission.get_mission_children(name)
Returns the child missions of a mission — the counterpart to get_mission_parent().
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
Returns: (status_code, children_data)
Example:
status, data = await srv.mission.get_mission_children(name="area-recon")Usage: await server.mission.set_mission_expiration(name, expiration=None)
Sets the expiration time of a mission. Expirations are epoch milliseconds — not seconds, not ISO strings. An expiration of -1 means the mission never expires, which is the default for newly created missions.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
expiration |
int |
(Optional) Expiration as epoch millis. -1 = never expires. |
Returns: (status_code, response_data)
Example:
import time
# Expire the mission in one hour
status, data = await srv.mission.set_mission_expiration(
name="area-recon",
expiration=int(time.time() * 1000) + 3600 * 1000,
)Usage: await server.mission.add_mission_content(name, uids, my_uid, token)
Adds UIDs to a mission.
Important — required sequence:
-
First, send the CoTs to a TAK server stream input that has archiving enabled. Each CoT must include
<marti><dest mission="MISSIONNAME"></marti>in its detail field, whereMISSIONNAMEis the target mission name. -
Then, call
add_mission_content()with the UIDs of those already-sent CoTs.
The uids list must reference CoTs that have already been archived on the server through step 1. Calling this function with UIDs that do not exist on the server will fail.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
uids |
list[str] |
List of CoT UIDs to add. Must reference CoTs already sent and archived on the server. |
my_uid |
str |
UID of the requesting client |
token |
str |
Bearer token for authorization. Obtain from create_mission() or create_mission_subscription() response. |
Returns: (status_code, response_data)
Requires a bearer token in the Authorization header.
Note
Hashes will be implemented later.
Example:
# Step 1 — send CoTs to an archiving-enabled stream input first.
# Each CoT must carry:
# <marti><dest mission="area-recon"></marti>
# in its detail field.
#
# Step 2 — then attach them to the mission:
status, data = await srv.mission.add_mission_content(
name="area-recon",
uids=["cot-msg-abc", "cot-msg-def"],
my_uid="UAV-007",
token="eyJhbGciOi...",
)Usage: await server.mission.remove_mission_content(name, uid, my_uid, token)
Removes object uid from mission name. Note the asymmetry: add_mission_content() takes a list of UIDs, remove_mission_content() takes a single UID. If you need to remove multiple items, loop over them.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
uid |
str |
CoT UID to remove |
my_uid |
str |
UID of the requesting client |
token |
str |
Bearer token for authorization |
Returns: (status_code, response_data)
Requires a bearer token in the Authorization header.
Example:
for uid in ["cot-msg-abc", "cot-msg-def"]:
status, data = await srv.mission.remove_mission_content(
name="area-recon",
uid=uid,
my_uid="UAV-007",
token="eyJhbGciOi...",
)
if status == 200:
print(f"Removed {uid}")Usage: await server.mission.remove_mission_content_by_hash(name, content_hash, creator_uid=None)
Removes a mission content item identified by its hash. While remove_mission_content() works on CoT UIDs, this one targets data-package style content (files) that the server tracks by SHA-256 hash. You can find the hashes in the contents array of get_mission().
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
content_hash |
str |
Hash of the content item to remove |
creator_uid |
str |
(Optional) UID of the requesting client |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.remove_mission_content_by_hash(
name="area-recon",
content_hash="a1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4e5f67890",
creator_uid="UAV-007",
)Usage: build_mission_package(name, mission_name, mission_server, creator_uid, cot_files, resource_files=None, groups=None)
Builds a TAK mission package ZIP in memory. This is a standalone helper function, not a method — import it directly:
from python_takserver_api import build_mission_package| Parameter | Type | Description |
|---|---|---|
name |
str |
Human-readable package name (e.g. "POI Export") |
mission_name |
str |
TAK mission name the package targets |
mission_server |
str |
Server identifier, format host:port:tls (e.g. "tak.example.com:8443:ssl") |
creator_uid |
str |
UID of the creating client |
cot_files |
dict[str, str | bytes] |
Map of CoT UID → CoT XML content (string or bytes). Each entry becomes a file in cot/ inside the ZIP. |
resource_files |
dict[str, tuple] |
(Optional) Map of path → (content, mimeType, name, resource_uid). Each entry becomes a file in contents/. |
groups |
list[str] |
(Optional) Group names for access control |
Returns: bytes — the complete ZIP file, ready to upload via add_mission_package().
The package ZIP follows the TAK mission package format: a MANIFEST/manifest.xml with configuration, CoT entries, resource entries, groups, and the default subscriber role.
Example:
package = build_mission_package(
name="Observation Export",
mission_name="obs-mission",
mission_server="tak.example.com:8443:ssl",
creator_uid="DRONE-001",
cot_files={
"cot-msg-abc": "<event version='2.0' uid='cot-msg-abc' ...>",
},
resource_files={
"screenshot.png": (png_data, "image/png", "Screenshot.png", str(uuid.uuid4())),
},
groups=["recon-team"],
)Usage: await server.mission.add_mission_package(name, creator_uid, token, mission_package)
Uploads a pre-built mission package to a mission. The package is base64-encoded and sent to the server, which unpacks it, processes the included CoTs, and distributes them to subscribers.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
creator_uid |
str |
UID of the requesting client |
token |
str |
Bearer token for authorization. Obtain from create_mission() or create_mission_subscription() response. |
mission_package |
bytes |
ZIP bytes, typically from build_mission_package()
|
Returns: (status_code, response_data) — response_data is an ApiResponseListMissionChange containing the content metadata.
Requires a bearer token in the Authorization header.
How it differs from add_mission_content():
add_mission_content() links existing CoTs (by UID) that were already sent to an archiving stream input. With add_mission_package(), the CoTs are inside the package — the server unpacks and processes them. No prior stream input step needed.
Example:
from python_takserver_api import build_mission_package
package = build_mission_package(
name="POI Export",
mission_name="area-recon",
mission_server="tak.example.com:8443:ssl",
creator_uid="ANDROID-abc123",
cot_files={"uid-001": "<event ...>", "uid-002": "<event ...>"},
groups=["recon-team"],
)
status, data = await srv.mission.add_mission_package(
name="area-recon",
creator_uid="ANDROID-abc123",
token="eyJhbGciOi...",
mission_package=package,
)Usage: await server.mission.set_content_keywords(name, content_hash, keywords, creator_uid=None)
Sets the keywords of a mission content item, identified by its hash. Keywords are searchable metadata — ATAK clients use them to filter mission content. The call replaces the existing keyword set, not appends.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
content_hash |
str |
Hash of the content item |
keywords |
list[str] |
Keywords to set |
creator_uid |
str |
(Optional) UID of the requesting client |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.set_content_keywords(
name="area-recon",
content_hash="a1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4e5f67890",
keywords=["overwatch", "phase-1"],
creator_uid="UAV-007",
)Usage: await server.mission.delete_content_keywords(name, content_hash, creator_uid=None)
Removes all keywords from a mission content item, identified by its hash. There is no per-keyword removal on the server — to drop a single keyword, use the delete_content_keyword_by_hash() helper below, or set_content_keywords() with the remaining list.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
content_hash |
str |
Hash of the content item |
creator_uid |
str |
(Optional) UID of the requesting client |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.delete_content_keywords(
name="area-recon",
content_hash="a1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4e5f67890",
creator_uid="UAV-007",
)Usage: await server.mission.delete_content_keyword_by_hash(name, content_hash, keyword, creator_uid=None)
Removes a single keyword from a mission content item, identified by its hash. The TAK API only supports replacing the whole keyword list or removing all keywords, so this helper reads the current list from the mission, drops the keyword and writes the reduced list back — without you having to fetch and diff the list yourself.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
content_hash |
str |
Hash of the content item |
keyword |
str |
The keyword to remove |
creator_uid |
str |
(Optional) UID of the requesting client |
Returns: (status_code, response_data) — (404, message) if the content item is not in the mission. Deleting a keyword that is not present is a no-op: it returns (200, current_keywords) without touching the server.
Example:
status, data = await srv.mission.delete_content_keyword_by_hash(
name="area-recon",
content_hash="a1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4e5f67890",
keyword="urgent",
)Usage: await server.mission.set_uid_keywords(name, uid, keywords, creator_uid=None)
Sets the keywords of a mission content item, identified by its UID instead of its hash — the counterpart to set_content_keywords(). Use whichever identifier you have at hand; CoT-based content is usually easier to address by UID.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
uid |
str |
UID of the content item |
keywords |
list[str] |
Keywords to set |
creator_uid |
str |
(Optional) UID of the requesting client |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.set_uid_keywords(
name="area-recon",
uid="cot-msg-abc",
keywords=["urgent", "sensor-data"],
creator_uid="UAV-007",
)Usage: await server.mission.delete_uid_keywords(name, uid, creator_uid=None)
Removes all keywords from a mission content item, identified by its UID.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
uid |
str |
UID of the content item |
creator_uid |
str |
(Optional) UID of the requesting client |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.delete_uid_keywords(
name="area-recon",
uid="cot-msg-abc",
creator_uid="UAV-007",
)Usage: await server.mission.delete_content_keyword_by_uid(name, uid, keyword, creator_uid=None)
Same as delete_content_keyword_by_hash(), but identifies the content item by its UID — use this for CoT-based content, which is usually easier to address by UID. Reads the current keyword list, removes the keyword, writes the reduced list back.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
uid |
str |
UID of the content item |
keyword |
str |
The keyword to remove |
creator_uid |
str |
(Optional) UID of the requesting client |
Returns: (status_code, response_data) — (404, message) if the content item is not in the mission. Deleting a keyword that is not present is a no-op: it returns (200, current_keywords) without touching the server.
Example:
status, data = await srv.mission.delete_content_keyword_by_uid(
name="area-recon",
uid="cot-msg-abc",
keyword="urgent",
)Usage: await server.mission.set_mission_keywords(name, keywords, creator_uid=None)
Sets the keywords of the mission itself (as opposed to its content items). Mission keywords are returned in the mission object's keywords field and show up in mission lists and searches.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
keywords |
list[str] |
Keywords to set |
creator_uid |
str |
(Optional) UID of the requesting client |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.set_mission_keywords(
name="area-recon",
keywords=["south-sector", "night-ops"],
creator_uid="UAV-007",
)Usage: await server.mission.delete_mission_keywords(name, creator_uid=None)
Removes all keywords from a mission. The whole set goes in one call — for removing a single keyword, use delete_mission_keyword().
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
creator_uid |
str |
(Optional) UID of the requesting client |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.delete_mission_keywords(
name="area-recon",
creator_uid="UAV-007",
)Usage: await server.mission.delete_mission_keyword(name, keyword, creator_uid=None)
Removes a single keyword from a mission. The keyword in the URL is URL-encoded by the library, so spaces and special characters in keywords are fine.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
keyword |
str |
Keyword to remove |
creator_uid |
str |
(Optional) UID of the requesting client |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.delete_mission_keyword(
name="area-recon",
keyword="night-ops",
creator_uid="UAV-007",
)Usage: await server.mission.get_mission_subscriptions(name)
Returns all subscriptions for mission name.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
Returns: (status_code, subscriptions_data)
Example:
status, data = await srv.mission.get_mission_subscriptions(name="area-recon")Usage: await server.mission.get_mission_subscription_roles(name)
Returns all roles for users subscribed to mission name.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
Returns: (status_code, roles_data)
Example:
status, data = await srv.mission.get_mission_subscription_roles(name="area-recon")Usage: await server.mission.get_mission_role(name)
Returns the role of the certificate user in the mission name.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
Returns: (status_code, role_data)
Example:
status, data = await srv.mission.get_mission_role(name="area-recon")Usage: await server.mission.create_mission_subscription(name, uid, topic="", password="", secago="", start="", end="")
Creates a mission subscription. You will want to save the token in the returned data for further use.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
uid |
str |
UID of the subscribing client |
topic |
str |
(Optional) Topic filter |
password |
str |
(Optional) Mission password |
secago |
str |
(Optional) Subscribe to content from N seconds ago |
start |
str |
(Optional) Subscribe to content from this start time |
end |
str |
(Optional) Subscribe to content until this end time |
Returns: (status_code, subscription_data) — the returned data contains the token needed for subsequent API calls.
Example:
status, data = await srv.mission.create_mission_subscription(
name="area-recon",
uid="ANDROID-111",
)
# Save the token for later write operations
token = data["data"]["token"]Usage: await server.mission.create_mission_subscriptions(name, creator_uid, uids)
Subscribes multiple UIDs to a mission in one call. The batch counterpart to create_mission_subscription() — handy when onboarding a whole team at once.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
creator_uid |
str |
UID of the requesting client |
uids |
list[str] |
List of client UIDs to subscribe |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.create_mission_subscriptions(
name="area-recon",
creator_uid="UAV-007",
uids=["ANDROID-111", "ANDROID-222", "ANDROID-333"],
)Usage: await server.mission.get_mission_subscription(name, uid=None)
Returns the subscription of a single UID to a mission — the focused version of get_mission_subscriptions().
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
uid |
str |
(Optional) Client UID to look up. Without it, the server uses the certificate user. |
Returns: (status_code, subscription_data)
Example:
status, data = await srv.mission.get_mission_subscription(
name="area-recon",
uid="ANDROID-111",
)Usage: await server.mission.delete_mission_subscription(name, uid=None, topic=None, disconnect_only=False)
Unsubscribes a UID from a mission. With disconnect_only=True it only disconnects the client's topics (a soft kick — the subscription stays), which is the gentler way to push a client off a mission temporarily.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
uid |
str |
(Optional) Client UID to unsubscribe |
topic |
str |
(Optional) Topic to disconnect |
disconnect_only |
bool |
(Optional) Only disconnect the topics, keep the subscription |
Returns: (status_code, response_data)
Example:
# Full unsubscribe
status, data = await srv.mission.delete_mission_subscription(
name="area-recon",
uid="ANDROID-111",
)
# Or just cut the topic connection, keeping the subscription
status, data = await srv.mission.delete_mission_subscription(
name="area-recon",
uid="ANDROID-111",
topic="a-f.tak.server",
disconnect_only=True,
)Usage: await server.mission.get_all_subscriptions()
Returns the subscriptions of all missions the certificate user can see — the server-wide view.
Returns: (status_code, subscriptions_data)
Example:
status, data = await srv.mission.get_all_subscriptions()Usage: await server.mission.get_all_subscriptions_by_guid()
Same as get_all_subscriptions(), but the subscriptions are keyed by mission GUID instead of mission name. Useful when you track missions by GUID (e.g. after create_mission()).
Returns: (status_code, subscriptions_by_guid)
Example:
status, data = await srv.mission.get_all_subscriptions_by_guid()Usage: await server.mission.set_mission_role(name, client_uid, username, role, token)
Sets the role for a user in mission name.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
client_uid |
str |
UID of the target client |
username |
str |
Username of the target client |
role |
str |
Role to assign. Must be ALL_CAPS. Valid values: MISSION_OWNER, MISSION_SUBSCRIBER, MISSION_READONLY_SUBSCRIBER
|
token |
str |
Bearer token for authorization. Obtain from create_mission() or create_mission_subscription() response. |
Returns: (status_code, response_data)
Requires a bearer token in the Authorization header.
Example:
status, data = await srv.mission.set_mission_role(
name="area-recon",
client_uid="UAV-007",
username="operator1",
role="MISSION_OWNER",
token="eyJhbGciOi...",
)Usage: await server.mission.get_mission_invitations(name)
Returns the invitations of a single mission.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
Returns: (status_code, invitations_data)
Example:
status, data = await srv.mission.get_mission_invitations(name="area-recon")Usage: await server.mission.get_all_invitations(client_uid=None)
Returns all mission invitations across all missions — the server-wide view. With client_uid you get the invitations for a single client.
| Parameter | Type | Description |
|---|---|---|
client_uid |
str |
(Optional) Only return invitations for this client UID |
Returns: (status_code, invitations_data)
Example:
status, data = await srv.mission.get_all_invitations(client_uid="ANDROID-111")Usage: await server.mission.get_invitations(client_uid)
Returns mission invitations for a specific client UID. Unlike get_all_invitations(), the UID is required here.
| Parameter | Type | Description |
|---|---|---|
client_uid |
str |
Client UID to look up |
Returns: (status_code, invitations_data)
Example:
status, data = await srv.mission.get_invitations(client_uid="ANDROID-111")
if status == 200:
print(f"You have {len(data)} pending invitations")Usage: await server.mission.invite_to_mission(name, creator_uid=None)
Invites the current user (the certificate user) to a mission. This is how you accept an invite-only mission: once invited, the user can subscribe.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
creator_uid |
str |
(Optional) UID of the requesting client |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.invite_to_mission(
name="area-recon",
creator_uid="ANDROID-111",
)Usage: await server.mission.set_mission_invite(name, invite_type, invitee, creator_uid, role=None)
Sets the invitation state of a user or group for a mission. This is the owner-side counterpart to invite_to_mission() — it invites someone else.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
invite_type |
str |
What is being invited. Must be user or group.
|
invitee |
str |
Username (for user) or group name (for group) to invite |
creator_uid |
str |
UID of the requesting client |
role |
str |
(Optional) Role to grant with the invitation. Valid values: MISSION_OWNER, MISSION_SUBSCRIBER, MISSION_READONLY_SUBSCRIBER
|
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.set_mission_invite(
name="area-recon",
invite_type="user",
invitee="operator1",
creator_uid="UAV-007",
role="MISSION_SUBSCRIBER",
)
# Inviting a whole group works the same way:
status, data = await srv.mission.set_mission_invite(
name="area-recon",
invite_type="group",
invitee="recon-team",
creator_uid="UAV-007",
)Usage: await server.mission.delete_mission_invite(name, invite_type, invitee, creator_uid)
Removes the invitation of a user or group for a mission — the undo for set_mission_invite().
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
invite_type |
str |
Must be user or group. |
invitee |
str |
Username or group name whose invitation to remove |
creator_uid |
str |
UID of the requesting client |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.delete_mission_invite(
name="area-recon",
invite_type="user",
invitee="operator1",
creator_uid="UAV-007",
)Usage: await server.mission.set_mission_password(name, password, creator_uid=None)
Sets (or changes) the password of a mission. Password-protected missions require the password for get_mission() and create_mission_subscription(). There is no "current password" parameter — an owner can always set a new one.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
password |
str |
The new mission password |
creator_uid |
str |
(Optional) UID of the requesting client |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.set_mission_password(
name="area-recon",
password="hunter2",
creator_uid="UAV-007",
)Usage: await server.mission.clear_mission_password(name, creator_uid=None)
Removes the password from a mission, making it publicly accessible (within its groups) again.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
creator_uid |
str |
(Optional) UID of the requesting client |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.clear_mission_password(
name="area-recon",
creator_uid="UAV-007",
)Usage: await server.mission.get_mission_token(name, password=None)
Returns a bearer token for a mission without creating a subscription. Handy for giving a programmatic client write access to a mission (e.g. a feeder) without subscribing it. If the mission is password-protected, pass the password.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
password |
str |
(Optional) Mission password, required for password-protected missions |
Returns: (status_code, token_data) — the bearer token is in the returned data. You will want to save it.
Example:
status, data = await srv.mission.get_mission_token(
name="area-recon",
password="hunter2",
)
print(status, data)Usage: await server.mission.get_mission_layers(name)
Returns the layers of a mission. Layers are how mission content is organized for display — CoT layers, imagery, video and data packages can each live in their own layer.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
Returns: (status_code, layers_data)
Example:
status, data = await srv.mission.get_mission_layers(name="area-recon")Usage: await server.mission.get_mission_layer(name, layer_uid)
Returns a single layer of a mission, identified by its UID.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
layer_uid |
str |
UID of the layer |
Returns: (status_code, layer_data)
Example:
status, data = await srv.mission.get_mission_layer(
name="area-recon",
layer_uid="layer-001",
)Usage: await server.mission.create_mission_layer(name, layer_name, layer_type, uid=None, parent_uid=None, after_uid=None, creator_uid=None)
Creates a layer in a mission. Layers can be nested — pass parent_uid to create the layer under an existing one, or after_uid to order it after a sibling.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
layer_name |
str |
Display name of the layer |
layer_type |
str |
Type of the layer. One of Cot, Imagery, Video, DataPackage. |
uid |
str |
(Optional) UID for the layer; the server generates one if omitted |
parent_uid |
str |
(Optional) UID of the parent layer |
after_uid |
str |
(Optional) Create this layer after the layer with this UID |
creator_uid |
str |
(Optional) UID of the requesting client |
Returns: (status_code, layer_data)
Example:
status, data = await srv.mission.create_mission_layer(
name="area-recon",
layer_name="Phase 1 Objectives",
layer_type="Cot",
creator_uid="UAV-007",
)Usage: await server.mission.rename_mission_layer(name, layer_uid, new_name, creator_uid)
Renames a layer of a mission.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
layer_uid |
str |
UID of the layer to rename |
new_name |
str |
New display name |
creator_uid |
str |
UID of the requesting client |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.rename_mission_layer(
name="area-recon",
layer_uid="layer-001",
new_name="Phase 2 Objectives",
creator_uid="UAV-007",
)Usage: await server.mission.delete_mission_layer(name, uid, creator_uid)
Deletes a layer from a mission.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
uid |
str |
UID of the layer to delete |
creator_uid |
str |
UID of the requesting client |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.delete_mission_layer(
name="area-recon",
uid="layer-001",
creator_uid="UAV-007",
)Usage: await server.mission.set_mission_layer_parent(name, layer_uid, parent_uid=None, after_uid=None, creator_uid=None)
Moves a layer under a parent layer — reorganizing the mission's layer hierarchy. With after_uid you can additionally position it after a specific sibling.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
layer_uid |
str |
UID of the layer to move |
parent_uid |
str |
(Optional) UID of the new parent layer |
after_uid |
str |
(Optional) Position the layer after this UID |
creator_uid |
str |
(Optional) UID of the requesting client |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.set_mission_layer_parent(
name="area-recon",
layer_uid="layer-002",
parent_uid="layer-001",
creator_uid="UAV-007",
)Usage: await server.mission.add_mission_maplayer(name, creator_uid, map_layer)
Adds a map layer to a mission. Map layers are the base maps clients can switch between (think OSM, satellite imagery, WMS tiles) — a different concept from the content layers of create_mission_layer(). The payload follows the MapLayer schema in the API spec.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
creator_uid |
str |
UID of the requesting client |
map_layer |
dict[str, Any] |
Map layer data (e.g. name, type, url) per the MapLayer schema |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.add_mission_maplayer(
name="area-recon",
creator_uid="UAV-007",
map_layer={
"name": "OSM Streets",
"type": "IMAGERY",
"url": "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
},
)Usage: await server.mission.update_mission_maplayer(name, creator_uid, map_layer)
Updates a map layer of a mission. Include the layer's uid in the payload so the server knows which layer to change.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
creator_uid |
str |
UID of the requesting client |
map_layer |
dict[str, Any] |
Updated map layer data, including the uid of the layer to update |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.update_mission_maplayer(
name="area-recon",
creator_uid="UAV-007",
map_layer={
"uid": "maplayer-001",
"name": "OSM Streets (updated)",
"type": "IMAGERY",
"url": "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
},
)Usage: await server.mission.delete_mission_maplayer(name, uid, creator_uid)
Deletes a map layer from a mission.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
uid |
str |
UID of the map layer to delete |
creator_uid |
str |
UID of the requesting client |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.delete_mission_maplayer(
name="area-recon",
uid="maplayer-001",
creator_uid="UAV-007",
)Usage: await server.mission.create_mission_feed(name, creator_uid, data_feed_uid, filter_polygon=None, filter_cot_types=None, filter_callsign=None)
Adds a data feed to a mission. Data feeds are server-side stream inputs (e.g. video or sensor feeds) whose output gets injected into the mission. The filters let you only forward matching traffic.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
creator_uid |
str |
UID of the requesting client |
data_feed_uid |
str |
UID of the data feed to add |
filter_polygon |
str |
(Optional) Only forward traffic inside this polygon |
filter_cot_types |
str |
(Optional) Only forward CoTs of these types |
filter_callsign |
str |
(Optional) Only forward CoTs from this callsign |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.create_mission_feed(
name="area-recon",
creator_uid="UAV-007",
data_feed_uid="video-feed-001",
filter_callsign="DRONE-007",
)Usage: await server.mission.delete_mission_feed(name, uid, creator_uid)
Removes a data feed from a mission — the undo for create_mission_feed().
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
uid |
str |
UID of the feed to remove |
creator_uid |
str |
UID of the requesting client |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.delete_mission_feed(
name="area-recon",
uid="video-feed-001",
creator_uid="UAV-007",
)Usage: await server.mission.get_mission_log(name, secago=None, start=None, end=None)
Returns the mission log of a mission — the human-readable event trail (content added, roles changed, etc.) that mission owners use to see what happened.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
secago |
int |
(Optional) Only log entries from the last N seconds |
start |
str |
(Optional) Only log entries from this start time (ISO 8601) |
end |
str |
(Optional) Only log entries until this end time (ISO 8601) |
Returns: (status_code, log_data)
Example:
status, data = await srv.mission.get_mission_log(name="area-recon", secago=86400)Usage: await server.mission.get_all_logs()
Returns the mission logs of all missions — the server-wide view, useful for audits.
Returns: (status_code, logs_data)
Example:
status, data = await srv.mission.get_all_logs()Usage: await server.mission.get_log_entry(log_id)
Returns a single mission log entry by its ID. Log entry IDs are UUIDs you get back from create_log_entry() or from the entries in get_mission_log().
| Parameter | Type | Description |
|---|---|---|
log_id |
str |
ID (UUID) of the log entry |
Returns: (status_code, log_entry_data)
Example:
status, data = await srv.mission.get_log_entry(log_id="a3f0c1e2-9b2d-4d5e-8f6a-1b2c3d4e5f60")Usage: await server.mission.create_log_entry(log_entry)
Creates a mission log entry. The payload follows the LogEntry schema in the API spec — an entries list, where each entry needs at least a text (and you will usually want an authorUid).
| Parameter | Type | Description |
|---|---|---|
log_entry |
dict[str, Any] |
Log entry data per the LogEntry schema |
Returns: (status_code, log_entry_data)
Example:
status, data = await srv.mission.create_log_entry(
log_entry={
"entries": [
{
"text": "Mission established, phase 1 objectives loaded",
"authorUid": "UAV-007",
}
]
}
)Usage: await server.mission.update_log_entry(log_entry)
Updates a mission log entry. Include the entry's id in the payload so the server knows which entry to change — you got that ID from create_log_entry() or get_mission_log().
| Parameter | Type | Description |
|---|---|---|
log_entry |
dict[str, Any] |
Log entry data per the LogEntry schema, including the entry id
|
Returns: (status_code, log_entry_data)
Example:
status, data = await srv.mission.update_log_entry(
log_entry={
"entries": [
{
"id": "a3f0c1e2-9b2d-4d5e-8f6a-1b2c3d4e5f60",
"text": "Mission established, phase 1 objectives loaded (revised)",
"authorUid": "UAV-007",
}
]
}
)Usage: await server.mission.delete_log_entry(log_id)
Deletes a mission log entry by its ID.
| Parameter | Type | Description |
|---|---|---|
log_id |
str |
ID (UUID) of the log entry to delete |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.delete_log_entry(log_id="a3f0c1e2-9b2d-4d5e-8f6a-1b2c3d4e5f60")Usage: await server.mission.create_external_data(name, creator_uid, external_data)
Creates an external data entry in a mission. External data links mission content that lives outside the TAK server (a web map service, an external file server, a camera feed) — the mission keeps a reference instead of the bytes. The payload follows the ExternalMissionData schema in the API spec.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
creator_uid |
str |
UID of the requesting client |
external_data |
dict[str, Any] |
External data entry per the ExternalMissionData schema |
Returns: (status_code, external_data_response)
Example:
status, data = await srv.mission.create_external_data(
name="area-recon",
creator_uid="UAV-007",
external_data={
"name": "Traffic cam feed",
"url": "https://cam.example.com/feed1",
"mimeType": "video/mp4",
"size": 1024,
"hash": "a1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4e5f67890",
"notes": "Road condition camera",
},
)Usage: await server.mission.change_external_data(name, data_id, creator_uid, notes, data=None)
Changes an external data entry in a mission. notes is required (it becomes the change note on the entry); the optional data is sent as the raw request body — typically the new data payload for the entry.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
data_id |
str |
ID of the external data entry to change |
creator_uid |
str |
UID of the requesting client |
notes |
str |
Change note |
data |
str |
(Optional) New data payload, sent as the raw request body |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.change_external_data(
name="area-recon",
data_id="ext-001",
creator_uid="UAV-007",
notes="Camera moved to new location",
data="https://cam.example.com/feed2",
)Usage: await server.mission.delete_external_data(name, data_id, notes, creator_uid)
Deletes an external data entry from a mission. Note the notes parameter — it is required even for deletion.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
data_id |
str |
ID of the external data entry to delete |
notes |
str |
Deletion note |
creator_uid |
str |
UID of the requesting client |
Returns: (status_code, response_data)
Example:
status, data = await srv.mission.delete_external_data(
name="area-recon",
data_id="ext-001",
notes="Camera decommissioned",
creator_uid="UAV-007",
)Usage: await server.mission.get_mission_changes(name, secago=None, start=None, end=None, squashed=False)
Returns the change history of a mission — the raw mission change events (content added/removed, subscriptions, etc.) that drive the t-x-m-c CoTs clients receive. With squashed=True the server collapses consecutive changes into a compact form.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
secago |
int |
(Optional) Only changes from the last N seconds |
start |
str |
(Optional) Only changes from this start time (ISO 8601) |
end |
str |
(Optional) Only changes until this end time (ISO 8601) |
squashed |
bool |
(Optional) Return squashed (compact) change entries |
Returns: (status_code, changes_data)
Example:
status, data = await srv.mission.get_mission_changes(
name="area-recon",
secago=3600,
squashed=True,
)Usage: await server.mission.get_mission_contacts(name)
Returns the contacts subscribed to a mission — the client UIDs and their contact details, useful for seeing who is currently attached.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
Returns: (status_code, contacts_data)
Example:
status, data = await srv.mission.get_mission_contacts(name="area-recon")Usage: await server.mission.get_mission_cot(name, path=None)
Returns the CoT events of a mission, optionally filtered by CoT path (e.g. a-f.G for ground units). The response is the raw CoT XML encapsulated in an <events> tag — not JSON.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
path |
str |
(Optional) CoT path filter, e.g. a-f.G
|
Returns: (status_code, cot_xml)
Example:
status, data = await srv.mission.get_mission_cot(
name="area-recon",
path="a-f.G",
)
print(data)Usage: await server.mission.get_mission_kml(name, download=False)
Returns a KML representation of a mission's content — handy for overlaying the mission in Google Earth or QGIS. The response is raw KML text, not JSON. With download=True the server sets a download content disposition, which matters if you feed the response into a file download handler.
| Parameter | Type | Description |
|---|---|---|
name |
str |
Mission name |
download |
bool |
(Optional) Treat the response as a file download |
Returns: (status_code, kml_text)
Example:
status, data = await srv.mission.get_mission_kml(name="area-recon", download=True)
if status == 200:
with open("area-recon.kml", "w") as f:
f.write(data)