Hedge
Search…
⌃K

API

Automate transfers, remotely set settings, and control licenses.
You can tell Hedge to do something by calling this URL – hedge://. You can call this from any app or script that can open an URL.

Using a browser

Copy/paste the URL below in a web browser, press Enter, and Hedge will open.
hedge://open

Using a shell

Copy/paste the command below in a shell, press Enter, and Hedge will open.
Mac
Windows
Using Terminal
open 'hedge://open'
Using PowerShell
start 'hedge://open'

Using a script

Mac
Windows
AppleScript:
do shell script ("open 'hedge://open'")
Python:
import os
os.system("open 'hedge://open'")
Python
import os
os.system("start 'hedge://open'")
The result of an API call is logged in a text file.
Mac
Windows
Location: ~/Library/Logs/Hedge/urlSchemeResponseLog.txt
This log will contain a single line with either a success or fail state. It's empty when Hedge starts, then emptied after each call.
Location: C:\Users\$username\AppData\Roaming\Hedge\HedgeCallback.log
This is a multi-line log. It's emptied on app start and after each call.
$time | $id | $arguments_passed
$time | $id | $call_result

Hedge API calls

Control the Hedge application state.

• Open

hedge://open

• Quit

hedge://quit

• Restart

hedge://restart

• Check for updates

hedge://update

• Activate

hedge://activate?key=xxxx-xxxx-xxxx-xxxx
URL Parameter
Type
Description
key
String
Required

• Deactivate

hedge://deactivate

• Chain Actions

Trigger multiple actions with a single API call. Uses the following URL scheme:
hedge://<action-name>?<property-name>=<value>
The actions call allows you to pass multiple API calls in a single request:
hedge://actions?json=[{"<action>":{"<property>": "<value>"},},{"<action>":{"<property>": "<value>"}}]
URL Parameter
Type
Description
json
Array containing JSON object(s)
Required

Example

hedge://deactivate
hedge://activate?key=xxxx-xxxx-xxxx-xxxx
hedge://actions?json=[{"deactivate":{}},{"activate":{"key":"xxxx-xxxx-xxxx-xxxx"}}]
Call not working? URL encode the JSON string.
Actions without properties are passed as{}
Chained Actions can create timing issues. Keep this in mind when debugging. If you run into timing issues, cut up your chained action into multiple calls and proceed based on timers/Hedge Events or logging output.

Pro

Email [email protected] if you are interested in a Hedge Pro license, or check all pro features here.
Hedge Pro users can use the following API calls to control Hedge:

• Reset Disks

Removes disks from Sources and/or Destinations dropzones. Existing transfers are not affected. If type is not defined, both Sources and Destinations are reset.
hedge://reset?type="sources"
URL Parameter
Type
Description
type
Sting
Optional (sources or destinations).

• Set Source

Sets a single Source or a collection of paths and applies a Label when defined.
hedge://setSource?paths=["/Volumes/UNTITLED"]&label=Clips
URL Parameter
Type
Description
paths
Array
Required
label
String
Optional
Call not working? Try URL encoding the JSON string.
Mac
Windows
Terminal examples:
open 'hedge://actions?json=[{"setSource":{"paths":["/Volumes/Untitled/The Clips"],"label":"test"}}]'
Call with URL encoded json= value
open 'hedge://actions?json=%5B%7B%22setSource%22%3A%7B%22paths%22%3A%5B%22%2FVolumes%2FUntitled%2FThe%20Clips%22%5D%2C%22label%22%3A%22test%22%7D%7D%5D
PowerShell examples:
Call with escaped quotes
start 'hedge://actions?json=[{\"setSource\":{\"paths\":[\"G:\The Clips\"],\"label\":\"test\"}}]'
Call with URL encoded json= value (don't escape quotes)
start 'hedge://actions?json=[{"setSource":{"paths":["G:\The Clips"],"label":"test"}}]'
start 'hedge://actions?json=%5B%7B%22setSource%22%3A%7B%22paths%22%3A%5B%22G%3A%5CThe%20Clips%22%5D%2C%22label%22%3A%22test%22%7D%7D%5D'

• Set Destination

Sets a single Destination
hedge://setDestination?path=/Volumes/BACKUP
URL Parameter
Type
Description
path
Array
Required / URL encoded
Call not working? URL encode the JSON string.
Mac
Windows
Terminal examples:
open 'hedge://actions?json=[{"setDestination":{"path":"/Volumes/Untitled/The Project"}}]'
Call with URL encoded json= value
open 'hedge://actions?json=%5B%7B%22setDestination%22%3A%7B%22path%22%3A%22%2FVolumes%2FUntitled%2FThe%20Project%22%7D%7D%5D'
PowerShell examples:
Call with escaped quotes
start 'hedge://actions?json=[{\"setDestination\":{\"path\":\"G:\The Clips\"}}]'
Call with URL encoded json= value (don't escape quotes)
start 'hedge://actions?json=[{"setSource":{"paths":["G:\The Clips"],"label":"test"}}]'
start 'hedge://actions?json=%5B%7B%22setSource%22%3A%7B%22paths%22%3A%5B%22G%3A%5CThe%20Clips%22%5D%2C%22label%22%3A%22test%22%7D%7D%5D'

• Add transfers

Creates transfers for all new combinations of Sources and Destinations. Identical to pressing the Add Transfers button in Hedge.
hedge://addTransfers

• Set Preferences

Sets a specific preference to a specific value. A complete list of all key names is available here: /Applications/Hedge.app/Contents/Resources/SFIDefaults.plist
hedge://setPreferences?preferences={"SFIDefaultsAutoSources":"0"}
URL Parameter
Type
Description
preferences
JSON Object
Required
The SetPreferences action is for macOS only.
On Windows, you can set the corresponding keys and values in the Windows Registry under <current-user>\Software\Hedge.