Send a command

Drive your devices around. The set of valid commands depends on device type - see each drone or controller page for the specifics.

Endpoint

POST /v1/devices/{code}

Body parameters

NameTypeDescription
commandstringCommand name. Type-specific.
...argsanyEach command takes its own arguments inline alongside command.

Example

POST /v1/devices/{code} 200 OK
# stow a deployed drone back into its host vessel
$ curl -X POST https://api.replicant.space/v1/devices/40ED8A3E \
    -H "Authorization: Bearer $API_KEY" \
    -d '{"command": "stow"}'
response response
{
  "device_code": "40ED8A3E",
  "status": "stowed"
}

Command reference

Each device has a specific list of features available. These features determine what commands it can process. Additional parameters are command-specific. For example, the travel command will require a destination: SOL-3, and the start_mining command will want resource_type: carbon for example.

Full details on the additional parameters for each command can be found in the documentation for the different device types.

FeatureCommands
cruisetravel, recall, decommission
surgetravel
stowdeploy, stow
attachattach, detach
system_scansystem_scan
surveyscan
censusstellar_census
prospectprospect
minestart_mining, retarget
transportcollect_resources, deposit_resources
printenqueue_print, dequeue_print, clear_queue
repairrepair
cradlereplicate
amiadopt, release, set_directive, clear_directive, launch, withdraw, activate
relayactivate

Universal commands

Every device, regardless of features, accepts the following:

  • change_owner - reassign the device to another replicant under your account.
  • deactivate - stop whatever the device is currently doing (mining, printing, travel, relaying, etc).

Custom commands

Some device types add their own commands on top of the feature list: