Assign strategy to portfolio
curl --request PUT \
--url https://api.itoflow.ai/portfolios/{id}/link \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"strategy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.itoflow.ai/portfolios/{id}/link"
payload = { "strategy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
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({strategy_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.itoflow.ai/portfolios/{id}/link', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"link_type": "follower",
"linked_at": "<string>",
"message": "<string>",
"portfolio_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"strategy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"strategy_name": "<string>",
"cancelled_pending_trades": 123,
"previous_strategy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"sync_status": "<string>",
"sync_task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"link_type": "follower",
"linked_at": "<string>",
"message": "<string>",
"portfolio_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"strategy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"strategy_name": "<string>",
"cancelled_pending_trades": 123,
"previous_strategy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"sync_status": "<string>",
"sync_task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": "<string>",
"available": "<string>",
"billing_action": {
"href": "<string>",
"kind": "upgrade",
"label": "<string>"
},
"code": "<string>",
"currentVersion": 123,
"details": "<unknown>",
"expectedVersion": 123,
"message": "<string>",
"requested": "<string>",
"usage": "<unknown>"
}{
"error": "<string>",
"available": "<string>",
"billing_action": {
"href": "<string>",
"kind": "upgrade",
"label": "<string>"
},
"code": "<string>",
"currentVersion": 123,
"details": "<unknown>",
"expectedVersion": 123,
"message": "<string>",
"requested": "<string>",
"usage": "<unknown>"
}{
"error": "<string>",
"available": "<string>",
"billing_action": {
"href": "<string>",
"kind": "upgrade",
"label": "<string>"
},
"code": "<string>",
"currentVersion": 123,
"details": "<unknown>",
"expectedVersion": 123,
"message": "<string>",
"requested": "<string>",
"usage": "<unknown>"
}{
"error": "<string>",
"available": "<string>",
"billing_action": {
"href": "<string>",
"kind": "upgrade",
"label": "<string>"
},
"code": "<string>",
"currentVersion": 123,
"details": "<unknown>",
"expectedVersion": 123,
"message": "<string>",
"requested": "<string>",
"usage": "<unknown>"
}{
"error": "<string>",
"available": "<string>",
"billing_action": {
"href": "<string>",
"kind": "upgrade",
"label": "<string>"
},
"code": "<string>",
"currentVersion": 123,
"details": "<unknown>",
"expectedVersion": 123,
"message": "<string>",
"requested": "<string>",
"usage": "<unknown>"
}Strategies
Assign strategy to portfolio
Assigns a strategy to a portfolio. Supported live broker portfolios become the strategy primary portfolio.
Operation ID: put__portfolios_id_link.
PUT
https://api.itoflow.ai
/
portfolios
/
{id}
/
link
Assign strategy to portfolio
curl --request PUT \
--url https://api.itoflow.ai/portfolios/{id}/link \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"strategy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.itoflow.ai/portfolios/{id}/link"
payload = { "strategy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
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({strategy_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.itoflow.ai/portfolios/{id}/link', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"link_type": "follower",
"linked_at": "<string>",
"message": "<string>",
"portfolio_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"strategy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"strategy_name": "<string>",
"cancelled_pending_trades": 123,
"previous_strategy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"sync_status": "<string>",
"sync_task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"link_type": "follower",
"linked_at": "<string>",
"message": "<string>",
"portfolio_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"strategy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"strategy_name": "<string>",
"cancelled_pending_trades": 123,
"previous_strategy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"sync_status": "<string>",
"sync_task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": "<string>",
"available": "<string>",
"billing_action": {
"href": "<string>",
"kind": "upgrade",
"label": "<string>"
},
"code": "<string>",
"currentVersion": 123,
"details": "<unknown>",
"expectedVersion": 123,
"message": "<string>",
"requested": "<string>",
"usage": "<unknown>"
}{
"error": "<string>",
"available": "<string>",
"billing_action": {
"href": "<string>",
"kind": "upgrade",
"label": "<string>"
},
"code": "<string>",
"currentVersion": 123,
"details": "<unknown>",
"expectedVersion": 123,
"message": "<string>",
"requested": "<string>",
"usage": "<unknown>"
}{
"error": "<string>",
"available": "<string>",
"billing_action": {
"href": "<string>",
"kind": "upgrade",
"label": "<string>"
},
"code": "<string>",
"currentVersion": 123,
"details": "<unknown>",
"expectedVersion": 123,
"message": "<string>",
"requested": "<string>",
"usage": "<unknown>"
}{
"error": "<string>",
"available": "<string>",
"billing_action": {
"href": "<string>",
"kind": "upgrade",
"label": "<string>"
},
"code": "<string>",
"currentVersion": 123,
"details": "<unknown>",
"expectedVersion": 123,
"message": "<string>",
"requested": "<string>",
"usage": "<unknown>"
}{
"error": "<string>",
"available": "<string>",
"billing_action": {
"href": "<string>",
"kind": "upgrade",
"label": "<string>"
},
"code": "<string>",
"currentVersion": 123,
"details": "<unknown>",
"expectedVersion": 123,
"message": "<string>",
"requested": "<string>",
"usage": "<unknown>"
}Response
Strategy assigned (no sync needed)