Create, update or delete targets
curl --request POST \
--url https://api.glassmarkets.io/v2/organizations/targets/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"delete": [
2
],
"create": [
{
"organization": "<string>",
"asset": "<string>",
"exchange": "<string>",
"pair": "<string>",
"metric": "<string>",
"threshold": 123,
"telegram_notifications": false,
"scaling_enabled": true,
"scaling_reference_price": 123
}
],
"update": [
{
"id": 2,
"active": true,
"telegram_notifications": true,
"scaling_enabled": true,
"scaling_reference_price": 123
}
]
}
'import requests
url = "https://api.glassmarkets.io/v2/organizations/targets/"
payload = {
"delete": [2],
"create": [
{
"organization": "<string>",
"asset": "<string>",
"exchange": "<string>",
"pair": "<string>",
"metric": "<string>",
"threshold": 123,
"telegram_notifications": False,
"scaling_enabled": True,
"scaling_reference_price": 123
}
],
"update": [
{
"id": 2,
"active": True,
"telegram_notifications": True,
"scaling_enabled": True,
"scaling_reference_price": 123
}
]
}
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({
delete: [2],
create: [
{
organization: '<string>',
asset: '<string>',
exchange: '<string>',
pair: '<string>',
metric: '<string>',
threshold: 123,
telegram_notifications: false,
scaling_enabled: true,
scaling_reference_price: 123
}
],
update: [
{
id: 2,
active: true,
telegram_notifications: true,
scaling_enabled: true,
scaling_reference_price: 123
}
]
})
};
fetch('https://api.glassmarkets.io/v2/organizations/targets/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.glassmarkets.io/v2/organizations/targets/"
payload := strings.NewReader("{\n \"delete\": [\n 2\n ],\n \"create\": [\n {\n \"organization\": \"<string>\",\n \"asset\": \"<string>\",\n \"exchange\": \"<string>\",\n \"pair\": \"<string>\",\n \"metric\": \"<string>\",\n \"threshold\": 123,\n \"telegram_notifications\": false,\n \"scaling_enabled\": true,\n \"scaling_reference_price\": 123\n }\n ],\n \"update\": [\n {\n \"id\": 2,\n \"active\": true,\n \"telegram_notifications\": true,\n \"scaling_enabled\": true,\n \"scaling_reference_price\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.glassmarkets.io/v2/organizations/targets/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"delete\": [\n 2\n ],\n \"create\": [\n {\n \"organization\": \"<string>\",\n \"asset\": \"<string>\",\n \"exchange\": \"<string>\",\n \"pair\": \"<string>\",\n \"metric\": \"<string>\",\n \"threshold\": 123,\n \"telegram_notifications\": false,\n \"scaling_enabled\": true,\n \"scaling_reference_price\": 123\n }\n ],\n \"update\": [\n {\n \"id\": 2,\n \"active\": true,\n \"telegram_notifications\": true,\n \"scaling_enabled\": true,\n \"scaling_reference_price\": 123\n }\n ]\n}")
.asString();{
"deleted": [
123
],
"updated": [
123
],
"created": [
123
]
}Targets
Create, update or delete targets
Applies a batch of delete ids, update items and create items in one transaction and returns the affected ids. Members of an organization can manage its gb (global) targets on its assets. Only project owners of an asset, and staff, can manage mm (market-maker) targets on it. A single target object without these keys is also accepted and returns 201.
POST
/
v2
/
organizations
/
targets
/
Create, update or delete targets
curl --request POST \
--url https://api.glassmarkets.io/v2/organizations/targets/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"delete": [
2
],
"create": [
{
"organization": "<string>",
"asset": "<string>",
"exchange": "<string>",
"pair": "<string>",
"metric": "<string>",
"threshold": 123,
"telegram_notifications": false,
"scaling_enabled": true,
"scaling_reference_price": 123
}
],
"update": [
{
"id": 2,
"active": true,
"telegram_notifications": true,
"scaling_enabled": true,
"scaling_reference_price": 123
}
]
}
'import requests
url = "https://api.glassmarkets.io/v2/organizations/targets/"
payload = {
"delete": [2],
"create": [
{
"organization": "<string>",
"asset": "<string>",
"exchange": "<string>",
"pair": "<string>",
"metric": "<string>",
"threshold": 123,
"telegram_notifications": False,
"scaling_enabled": True,
"scaling_reference_price": 123
}
],
"update": [
{
"id": 2,
"active": True,
"telegram_notifications": True,
"scaling_enabled": True,
"scaling_reference_price": 123
}
]
}
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({
delete: [2],
create: [
{
organization: '<string>',
asset: '<string>',
exchange: '<string>',
pair: '<string>',
metric: '<string>',
threshold: 123,
telegram_notifications: false,
scaling_enabled: true,
scaling_reference_price: 123
}
],
update: [
{
id: 2,
active: true,
telegram_notifications: true,
scaling_enabled: true,
scaling_reference_price: 123
}
]
})
};
fetch('https://api.glassmarkets.io/v2/organizations/targets/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.glassmarkets.io/v2/organizations/targets/"
payload := strings.NewReader("{\n \"delete\": [\n 2\n ],\n \"create\": [\n {\n \"organization\": \"<string>\",\n \"asset\": \"<string>\",\n \"exchange\": \"<string>\",\n \"pair\": \"<string>\",\n \"metric\": \"<string>\",\n \"threshold\": 123,\n \"telegram_notifications\": false,\n \"scaling_enabled\": true,\n \"scaling_reference_price\": 123\n }\n ],\n \"update\": [\n {\n \"id\": 2,\n \"active\": true,\n \"telegram_notifications\": true,\n \"scaling_enabled\": true,\n \"scaling_reference_price\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.glassmarkets.io/v2/organizations/targets/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"delete\": [\n 2\n ],\n \"create\": [\n {\n \"organization\": \"<string>\",\n \"asset\": \"<string>\",\n \"exchange\": \"<string>\",\n \"pair\": \"<string>\",\n \"metric\": \"<string>\",\n \"threshold\": 123,\n \"telegram_notifications\": false,\n \"scaling_enabled\": true,\n \"scaling_reference_price\": 123\n }\n ],\n \"update\": [\n {\n \"id\": 2,\n \"active\": true,\n \"telegram_notifications\": true,\n \"scaling_enabled\": true,\n \"scaling_reference_price\": 123\n }\n ]\n}")
.asString();{
"deleted": [
123
],
"updated": [
123
],
"created": [
123
]
}Authorizations
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data

