PATCH
https://api.cryptohopper.com/v1/hopper/{id}
Updates the name and enabled state of the hopper and merges the config keys you send into its config. Returns the result with API keys masked.
OAuth scope:
manage About scopes
Always send name and enabled: a missing name renames the hopper to "Unnamed bot", and a missing enabled (or any value other than 1) disables it. The api_config object in the request model is not read; put keys in config instead.
Example request
curl -X PATCH "https://api.cryptohopper.com/v1/hopper/HOPPER_ID" \
-H "access-token: YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"My BTC bot","enabled":1,"config":{"max_open_positions":10,"stop_loss":1,"stop_loss_percentage":5}}'
const response = await fetch('https://api.cryptohopper.com/v1/hopper/HOPPER_ID', {
method: 'PATCH',
headers: {
"access-token": "YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"name": "My BTC bot",
"enabled": 1,
"config": {
"max_open_positions": 10,
"stop_loss": 1,
"stop_loss_percentage": 5
}
})
});
const data = await response.json();
import requests
response = requests.patch(
"https://api.cryptohopper.com/v1/hopper/HOPPER_ID",
headers={
"access-token": "YOUR_ACCESS_TOKEN"
},
json={
"name": "My BTC bot",
"enabled": 1,
"config": {
"max_open_positions": 10,
"stop_loss": 1,
"stop_loss_percentage": 5
}
},
)
data = response.json()
$ch = curl_init('https://api.cryptohopper.com/v1/hopper/HOPPER_ID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'access-token: YOUR_ACCESS_TOKEN',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'My BTC bot',
'enabled' => 1,
'config' => [
'max_open_positions' => 10,
'stop_loss' => 1,
'stop_loss_percentage' => 5,
],
]),
]);
$data = json_decode(curl_exec($ch), true);
Parameters
Headers
| Name | Type | Required | Description |
|---|---|---|---|
access-token |
string | Required | The OAuth access token of the user. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | Required | Hopper ID. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Optional | |
enabled | integer | Optional | |
api_config | object | Optional | |
api_key | string | Optional | |
api_secret | string | Optional | |
kraken_extra_key | string | Optional | |
kraken_private_extra_key | string | Optional | |
gdax_api_passphrase | string | Optional | |
gdax_post_only | string | Optional |
Response
{
"data": {
"status": 1,
"message": "Bot has been updated.",
"name": "My BTC bot",
"enabled": "1",
"config": {
"name": "My BTC bot",
"exchange": "binance",
"collect_currency": "usdt",
"api_key": "***",
"api_secret": "***",
"max_open_positions": 10,
"stop_loss": 1,
"stop_loss_percentage": 5
}
}
}