Preview target changes
curl --request POST \
--url https://api.glassmarkets.io/v2/organizations/targets/preview/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"scopes": [
{
"organization": "<string>",
"asset": "<string>",
"metrics": [
"<string>"
]
}
],
"targets": [
{
"organization": "<string>",
"asset": "<string>",
"exchange": "<string>",
"pair": "<string>",
"metric": "<string>",
"threshold": 123,
"telegram_notifications": false,
"scaling_enabled": true,
"scaling_reference_price": 123
}
],
"apply_scaling": true
}
'import requests
url = "https://api.glassmarkets.io/v2/organizations/targets/preview/"
payload = {
"scopes": [
{
"organization": "<string>",
"asset": "<string>",
"metrics": ["<string>"]
}
],
"targets": [
{
"organization": "<string>",
"asset": "<string>",
"exchange": "<string>",
"pair": "<string>",
"metric": "<string>",
"threshold": 123,
"telegram_notifications": False,
"scaling_enabled": True,
"scaling_reference_price": 123
}
],
"apply_scaling": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
scopes: [{organization: '<string>', asset: '<string>', metrics: ['<string>']}],
targets: [
{
organization: '<string>',
asset: '<string>',
exchange: '<string>',
pair: '<string>',
metric: '<string>',
threshold: 123,
telegram_notifications: false,
scaling_enabled: true,
scaling_reference_price: 123
}
],
apply_scaling: true
})
};
fetch('https://api.glassmarkets.io/v2/organizations/targets/preview/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"prefill": {
"default": [
{
"id": 123,
"type": "gb",
"organization": "<string>",
"asset": "<string>",
"exchange": "<string>",
"pair": "<string>",
"metric": "<string>",
"threshold": 123,
"display_threshold": 123,
"direction": "above",
"active": true,
"telegram_notifications": true,
"market_hours": "<string>",
"scaling": {
"mode": "<string>",
"enabled": true,
"scaling_source": "<string>",
"reference_price": 123
}
}
],
"market_hours": {}
},
"changes": [
{
"action": "added",
"existing_id": 123,
"before": {
"id": 123,
"type": "gb",
"organization": "<string>",
"asset": "<string>",
"exchange": "<string>",
"pair": "<string>",
"metric": "<string>",
"threshold": 123,
"display_threshold": 123,
"direction": "above",
"active": true,
"telegram_notifications": true,
"market_hours": "<string>",
"scaling": {
"mode": "<string>",
"enabled": true,
"scaling_source": "<string>",
"reference_price": 123
}
},
"after": {
"id": 123,
"type": "gb",
"organization": "<string>",
"asset": "<string>",
"exchange": "<string>",
"pair": "<string>",
"metric": "<string>",
"threshold": 123,
"display_threshold": 123,
"direction": "above",
"active": true,
"telegram_notifications": true,
"market_hours": "<string>",
"scaling": {
"mode": "<string>",
"enabled": true,
"scaling_source": "<string>",
"reference_price": 123
}
},
"changed_fields": [
"<string>"
],
"used_default_fallback": true
}
],
"summary": {
"added": 123,
"modified": 123,
"removed": 123
},
"batch": {
"delete_ids": [
123
],
"create_targets": [
{
"type": "gb",
"organization": "<string>",
"asset": "<string>",
"exchange": "<string>",
"pair": "<string>",
"metric": "<string>",
"threshold": 123,
"direction": "above",
"telegram_notifications": false,
"scaling_enabled": true,
"scaling_source": "asset_twap_24h",
"scaling_reference_price": 123,
"market_hours": "market-hours"
}
]
}
}Targets
Preview target changes
Shows what saving this complete set of targets for the given scopes would create, update and delete. Nothing is saved.
Preview target changes
curl --request POST \
--url https://api.glassmarkets.io/v2/organizations/targets/preview/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"scopes": [
{
"organization": "<string>",
"asset": "<string>",
"metrics": [
"<string>"
]
}
],
"targets": [
{
"organization": "<string>",
"asset": "<string>",
"exchange": "<string>",
"pair": "<string>",
"metric": "<string>",
"threshold": 123,
"telegram_notifications": false,
"scaling_enabled": true,
"scaling_reference_price": 123
}
],
"apply_scaling": true
}
'import requests
url = "https://api.glassmarkets.io/v2/organizations/targets/preview/"
payload = {
"scopes": [
{
"organization": "<string>",
"asset": "<string>",
"metrics": ["<string>"]
}
],
"targets": [
{
"organization": "<string>",
"asset": "<string>",
"exchange": "<string>",
"pair": "<string>",
"metric": "<string>",
"threshold": 123,
"telegram_notifications": False,
"scaling_enabled": True,
"scaling_reference_price": 123
}
],
"apply_scaling": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
scopes: [{organization: '<string>', asset: '<string>', metrics: ['<string>']}],
targets: [
{
organization: '<string>',
asset: '<string>',
exchange: '<string>',
pair: '<string>',
metric: '<string>',
threshold: 123,
telegram_notifications: false,
scaling_enabled: true,
scaling_reference_price: 123
}
],
apply_scaling: true
})
};
fetch('https://api.glassmarkets.io/v2/organizations/targets/preview/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"prefill": {
"default": [
{
"id": 123,
"type": "gb",
"organization": "<string>",
"asset": "<string>",
"exchange": "<string>",
"pair": "<string>",
"metric": "<string>",
"threshold": 123,
"display_threshold": 123,
"direction": "above",
"active": true,
"telegram_notifications": true,
"market_hours": "<string>",
"scaling": {
"mode": "<string>",
"enabled": true,
"scaling_source": "<string>",
"reference_price": 123
}
}
],
"market_hours": {}
},
"changes": [
{
"action": "added",
"existing_id": 123,
"before": {
"id": 123,
"type": "gb",
"organization": "<string>",
"asset": "<string>",
"exchange": "<string>",
"pair": "<string>",
"metric": "<string>",
"threshold": 123,
"display_threshold": 123,
"direction": "above",
"active": true,
"telegram_notifications": true,
"market_hours": "<string>",
"scaling": {
"mode": "<string>",
"enabled": true,
"scaling_source": "<string>",
"reference_price": 123
}
},
"after": {
"id": 123,
"type": "gb",
"organization": "<string>",
"asset": "<string>",
"exchange": "<string>",
"pair": "<string>",
"metric": "<string>",
"threshold": 123,
"display_threshold": 123,
"direction": "above",
"active": true,
"telegram_notifications": true,
"market_hours": "<string>",
"scaling": {
"mode": "<string>",
"enabled": true,
"scaling_source": "<string>",
"reference_price": 123
}
},
"changed_fields": [
"<string>"
],
"used_default_fallback": true
}
],
"summary": {
"added": 123,
"modified": 123,
"removed": 123
},
"batch": {
"delete_ids": [
123
],
"create_targets": [
{
"type": "gb",
"organization": "<string>",
"asset": "<string>",
"exchange": "<string>",
"pair": "<string>",
"metric": "<string>",
"threshold": 123,
"direction": "above",
"telegram_notifications": false,
"scaling_enabled": true,
"scaling_source": "asset_twap_24h",
"scaling_reference_price": 123,
"market_hours": "market-hours"
}
]
}
}Authorizations
Token-based authentication with required prefix "Token ". Example: "Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b"
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data

