Bridge API

Updated July 2026

The bridge relay is the local HTTP service inside DousenDesktop (default 127.0.0.1:8766) that fans events out between DCCs. This page documents its full API so a studio tool — a batch exporter, a custom DCC, a watch-folder script — can participate in the pipeline exactly like the built-in addons do.

Everything here is local to one artist machine. The relay binds loopback only and is not reachable from the network. For talking to the Dousen server, see the endpoint tables on the Perforce, Naming conventions, and Settings pages.

Authentication

Every request needs a bearer token:

HTTPAuthorization: Bearer <token>

DousenDesktop mints a fresh token at each start and writes it, readable only by the current user, to:

Tools launched by DousenDesktop can instead read the DOUSEN_BRIDGE_TOKEN environment variable, which takes precedence. Read the token file fresh on every request — the token rotates when DousenDesktop restarts, and re-reading it means your tool survives that without a relaunch.

The relay also rejects, regardless of token: any request carrying an Origin header (403 — this blocks browsers outright) and any request whose Host is not a loopback address (403). A missing or wrong token gets 401.

Endpoints

Method & pathPurpose
POST /bridge/registerAnnounce a running app. Body {"id","name","command_port"}id required, command_port optional. Re-send every 10 seconds as a heartbeat.
DELETE /bridge/register?id=<id>Withdraw on clean shutdown.
POST /bridge/publishPush an event. Body fields: event_type (required), source_app, target_app, file_path, metadata_json. Returns {"ok":true}.
GET /bridge/events?since=<epoch>Poll for events strictly newer than since (Unix seconds).
GET /bridge/dccsThe currently connected apps — configured DCCs merged with live registrations. This is what populates "Open in DCC" menus.
GET /bridge/statusPer-app subscription counts; useful as a liveness probe.

The event envelope

GET /bridge/events returns:

JSON{
  "events": [
    {
      "timestamp_sec": 1751450000,
      "event_type": "mesh.export",
      "source_app": "maya",
      "target_app": "",
      "file_path": "D:/work/props/sword.fbx",
      "metadata_json": "{\"suggested_name\":\"S_Sword\", ...}",
      "task_id": "DOU-142",
      "changelist_id": "31"
    }
  ],
  "timestamp": 1751450001
}

An empty target_app means "everyone"; a set one means only that app should act on it. metadata_json is a JSON string — decode it a second time to get the metadata object.

Event types

EventMeaning
mesh.exportA published mesh. Metadata: suggested_name, source_file (required); suggested_ue_path, asset_type, convention_tags, cv_tags, references (optional).
texture.exportPublished textures. Metadata: suggested_name, textures (required); suggested_ue_path, master_material (optional).
animation.exportA published animation. Metadata: suggested_name, source_file (required); skeleton, suggested_ue_path and the mesh fields (optional).
scene.exportAn auto-publish triggered by saving the scene.
dcc.openA request to open a file in a specific DCC (target_app set).
task.contextPublished by DousenDesktop when the artist selects a task — metadata carries task_id and changelist_id. Consume this to tag your tool's output with the active task.

Don't confuse event types with validator rule ids — mesh.poly_count, texture.max_resolution and friends are validation rules, never bridge events.

Poll semantics

Registering a studio tool

The Python package that ships with DousenDesktop does all of the above for you. From any Python 3 environment with <install>/python on the path:

PYTHONfrom dousen.bridge import BridgeClient

bridge = BridgeClient()                       # port 8766, token auto-read
bridge.register("batchtool", "Batch Exporter")

def on_event(event):
    print(event.event_type, event.file_path, event.metadata)

# poll in a background thread; auto-reconnects with backoff
bridge.subscribe_async("batchtool", "mesh.*", on_event)

bridge.publish(
    event_type="mesh.export",
    source_app="batchtool",
    file_path="D:/work/props/sword.fbx",
    metadata={"suggested_name": "S_Sword", "source_file": "D:/work/props/sword.ma"},
    task_id="DOU-142",
)

Event-type filters accept an exact name (mesh.export), a prefix (mesh.*), or empty for everything. Once registered and heartbeating, your tool appears in /bridge/dccs, on the desktop's connected-apps badge, and in Unreal's "Open in DCC" menu.

If your tool can open files, accept dcc.open events addressed to your id (target_app == "batchtool") and artists can jump straight into it from Unreal's Content Browser.