Risk Controls
Upsert account risk control
Creates or updates risk limits for a trading account owned by the authenticated principal’s organization. The caller must have Controls Premium and organization control edit access.
PUT
/
v1
/
controls
/
accounts
/
{account_id}
/
risk
Upsert account risk control
curl --request PUT \
--url https://api.anthid.com/v1/controls/accounts/{account_id}/risk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"max_daily_loss_amount": "<string>",
"max_daily_loss_percent": "<string>",
"max_order_size": "<string>",
"max_position_size": "<string>"
}
'import requests
url = "https://api.anthid.com/v1/controls/accounts/{account_id}/risk"
payload = {
"max_daily_loss_amount": "<string>",
"max_daily_loss_percent": "<string>",
"max_order_size": "<string>",
"max_position_size": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
max_daily_loss_amount: '<string>',
max_daily_loss_percent: '<string>',
max_order_size: '<string>',
max_position_size: '<string>'
})
};
fetch('https://api.anthid.com/v1/controls/accounts/{account_id}/risk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.anthid.com/v1/controls/accounts/{account_id}/risk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'max_daily_loss_amount' => '<string>',
'max_daily_loss_percent' => '<string>',
'max_order_size' => '<string>',
'max_position_size' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.anthid.com/v1/controls/accounts/{account_id}/risk"
payload := strings.NewReader("{\n \"max_daily_loss_amount\": \"<string>\",\n \"max_daily_loss_percent\": \"<string>\",\n \"max_order_size\": \"<string>\",\n \"max_position_size\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.anthid.com/v1/controls/accounts/{account_id}/risk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"max_daily_loss_amount\": \"<string>\",\n \"max_daily_loss_percent\": \"<string>\",\n \"max_order_size\": \"<string>\",\n \"max_position_size\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anthid.com/v1/controls/accounts/{account_id}/risk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"max_daily_loss_amount\": \"<string>\",\n \"max_daily_loss_percent\": \"<string>\",\n \"max_order_size\": \"<string>\",\n \"max_position_size\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"max_daily_loss_amount": 123,
"max_daily_loss_percent": 123,
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updated_at": "2023-11-07T05:31:56Z",
"version": 123,
"max_order_size": "<string>",
"max_position_size": "<string>"
}"<string>""<string>""<string>""<string>""<string>"Authorizations
bearerAuthapiKeyAuth
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Trading account id
Body
application/json
Optional loss, position-size, and order-size limits for the account
Response
Account risk control upserted
Previous
Delete account risk controlDeletes risk limits for a trading account owned by the authenticated principal's organization. The caller must have Controls Premium and organization control edit access.
Next
⌘I
Upsert account risk control
curl --request PUT \
--url https://api.anthid.com/v1/controls/accounts/{account_id}/risk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"max_daily_loss_amount": "<string>",
"max_daily_loss_percent": "<string>",
"max_order_size": "<string>",
"max_position_size": "<string>"
}
'import requests
url = "https://api.anthid.com/v1/controls/accounts/{account_id}/risk"
payload = {
"max_daily_loss_amount": "<string>",
"max_daily_loss_percent": "<string>",
"max_order_size": "<string>",
"max_position_size": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
max_daily_loss_amount: '<string>',
max_daily_loss_percent: '<string>',
max_order_size: '<string>',
max_position_size: '<string>'
})
};
fetch('https://api.anthid.com/v1/controls/accounts/{account_id}/risk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.anthid.com/v1/controls/accounts/{account_id}/risk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'max_daily_loss_amount' => '<string>',
'max_daily_loss_percent' => '<string>',
'max_order_size' => '<string>',
'max_position_size' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.anthid.com/v1/controls/accounts/{account_id}/risk"
payload := strings.NewReader("{\n \"max_daily_loss_amount\": \"<string>\",\n \"max_daily_loss_percent\": \"<string>\",\n \"max_order_size\": \"<string>\",\n \"max_position_size\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.anthid.com/v1/controls/accounts/{account_id}/risk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"max_daily_loss_amount\": \"<string>\",\n \"max_daily_loss_percent\": \"<string>\",\n \"max_order_size\": \"<string>\",\n \"max_position_size\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anthid.com/v1/controls/accounts/{account_id}/risk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"max_daily_loss_amount\": \"<string>\",\n \"max_daily_loss_percent\": \"<string>\",\n \"max_order_size\": \"<string>\",\n \"max_position_size\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"max_daily_loss_amount": 123,
"max_daily_loss_percent": 123,
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updated_at": "2023-11-07T05:31:56Z",
"version": 123,
"max_order_size": "<string>",
"max_position_size": "<string>"
}"<string>""<string>""<string>""<string>""<string>"