PATCH
https://api.cryptohopper.com/v1/hopper/{id}/trigger/{trigger_id}
Updates a trigger of the hopper. All trigger fields are overwritten, so send the complete trigger, as for Create a trigger.
The handler checks no OAuth scope: any valid access token can call it. Not available for AI bots.
Example request
curl -X PATCH "https://api.cryptohopper.com/v1/hopper/HOPPER_ID/trigger/TRIGGER_ID" \
-H "access-token: YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Stop buying above 72k","exchange":"binance","market":"BTCUSDT","candle_size":1800,"indicators":["price"],"indicator_configs":{"price":{"trig_when":">","trig_when_value":72000}},"actions":["setbuyingstatus"],"action_configs":{"setbuyingstatus":{"config":0}},"status":1,"cooldown_count":1,"cooldown_val":"hours"}'
const response = await fetch('https://api.cryptohopper.com/v1/hopper/HOPPER_ID/trigger/TRIGGER_ID', {
method: 'PATCH',
headers: {
"access-token": "YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"name": "Stop buying above 72k",
"exchange": "binance",
"market": "BTCUSDT",
"candle_size": 1800,
"indicators": [
"price"
],
"indicator_configs": {
"price": {
"trig_when": ">",
"trig_when_value": 72000
}
},
"actions": [
"setbuyingstatus"
],
"action_configs": {
"setbuyingstatus": {
"config": 0
}
},
"status": 1,
"cooldown_count": 1,
"cooldown_val": "hours"
})
});
const data = await response.json();
import requests
response = requests.patch(
"https://api.cryptohopper.com/v1/hopper/HOPPER_ID/trigger/TRIGGER_ID",
headers={
"access-token": "YOUR_ACCESS_TOKEN"
},
json={
"name": "Stop buying above 72k",
"exchange": "binance",
"market": "BTCUSDT",
"candle_size": 1800,
"indicators": [
"price"
],
"indicator_configs": {
"price": {
"trig_when": ">",
"trig_when_value": 72000
}
},
"actions": [
"setbuyingstatus"
],
"action_configs": {
"setbuyingstatus": {
"config": 0
}
},
"status": 1,
"cooldown_count": 1,
"cooldown_val": "hours"
},
)
data = response.json()
$ch = curl_init('https://api.cryptohopper.com/v1/hopper/HOPPER_ID/trigger/TRIGGER_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' => 'Stop buying above 72k',
'exchange' => 'binance',
'market' => 'BTCUSDT',
'candle_size' => 1800,
'indicators' => [
'price',
],
'indicator_configs' => [
'price' => [
'trig_when' => '>',
'trig_when_value' => 72000,
],
],
'actions' => [
'setbuyingstatus',
],
'action_configs' => [
'setbuyingstatus' => [
'config' => 0,
],
],
'status' => 1,
'cooldown_count' => 1,
'cooldown_val' => 'hours',
]),
]);
$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 |
|---|---|---|---|
trigger_id |
string | Required | Trigger ID. |
id |
string | Required | Hopper ID. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
trigger_id | integer | Required | |
name | string | Optional | |
enabled | integer | Optional | |
exchange | integer | Optional | |
trading_pair | array of integer | Optional | |
candle_size | integer | Optional | |
indicators | array of object | Optional | |
type | string | Optional | |
items | integer | Optional | |
actions | array of object | Optional | |
type | string | Optional | |
items | integer | Optional | |
cooldown_until | integer | Optional | |
cooldown_time_unit | integer | Optional |
Response
{
"data": {
"trigger_id": 12845001,
"status": 1,
"triggers_left": 4,
"triggers_total": 1,
"message": "Trigger saved."
}
}