curl --request POST \
--url https://api.itoflow.ai/risk/measure \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"request": {
"books": [
{
"label": "<string>",
"portfolio": {
"portfolio_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"holdings_at": "2023-11-07T05:31:56Z"
}
}
],
"benchmark": "<string>",
"model": {},
"top_names": 10
},
"request_key": "<string>"
}
'import requests
url = "https://api.itoflow.ai/risk/measure"
payload = {
"request": {
"books": [
{
"label": "<string>",
"portfolio": {
"portfolio_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"holdings_at": "2023-11-07T05:31:56Z"
}
}
],
"benchmark": "<string>",
"model": {},
"top_names": 10
},
"request_key": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
request: {
books: [
{
label: '<string>',
portfolio: {
portfolio_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
holdings_at: '2023-11-07T05:31:56Z'
}
}
],
benchmark: '<string>',
model: {},
top_names: 10
},
request_key: '<string>'
})
};
fetch('https://api.itoflow.ai/risk/measure', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"dates_total": 30,
"joined_existing_measure": true,
"measure_id": "<string>",
"status": "running"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Measure
Start measuring factor risk for 1 to 10 books over 1 to 60 dates of the factor model, on one model version: the one named, or the one live at the start. A book is a saved portfolio or a list of weights. model.as_of measures one date; model.range measures the last day of each month in it and its end (step month_end, the default) or each weekday (step daily); neither measures the newest publication. Each date reads the newest publication on or before it. Before the version’s daily publications begin (model.dates.daily_from in an answer), a daily grid reads month-end publications, so use month_end for older history. A saved book without holdings_at follows its snapshots date by date; with holdings_at it stays the same book. Funds in a book, and the benchmark, are read through their stored holdings on or before each publication’s model date. Answers 202 with a measure_id: read it until its status is not running. Keep the request_key: the same request with it joins the measure until 24 hours after it ends; another request with it is 409. A measure counts toward the 3 risk runs and measures an owner may have going, and stops if it runs past its time limit, at most 60 minutes; 429 and 503 carry Retry-After. For today’s full report, start a risk run instead.
Operation ID: startRiskMeasure.
curl --request POST \
--url https://api.itoflow.ai/risk/measure \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"request": {
"books": [
{
"label": "<string>",
"portfolio": {
"portfolio_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"holdings_at": "2023-11-07T05:31:56Z"
}
}
],
"benchmark": "<string>",
"model": {},
"top_names": 10
},
"request_key": "<string>"
}
'import requests
url = "https://api.itoflow.ai/risk/measure"
payload = {
"request": {
"books": [
{
"label": "<string>",
"portfolio": {
"portfolio_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"holdings_at": "2023-11-07T05:31:56Z"
}
}
],
"benchmark": "<string>",
"model": {},
"top_names": 10
},
"request_key": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
request: {
books: [
{
label: '<string>',
portfolio: {
portfolio_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
holdings_at: '2023-11-07T05:31:56Z'
}
}
],
benchmark: '<string>',
model: {},
top_names: 10
},
request_key: '<string>'
})
};
fetch('https://api.itoflow.ai/risk/measure', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"dates_total": 30,
"joined_existing_measure": true,
"measure_id": "<string>",
"status": "running"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Body
Response
Started, or joined the measure with this key and request