Close a position
curl --request POST \
--url https://api.useblueprints.ai/api/portfolio/positions/close \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tokenId": "<string>",
"amount": 123
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({tokenId: '<string>', amount: 123})
};
fetch('https://api.useblueprints.ai/api/portfolio/positions/close', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.useblueprints.ai/api/portfolio/positions/close"
payload = {
"tokenId": "<string>",
"amount": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"intentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"amount": 123
}{
"error": {
"message": "<string>"
},
"message": "<string>"
}{
"error": {
"message": "<string>"
},
"message": "<string>"
}{
"error": {
"message": "<string>"
},
"message": "<string>"
}Portfolio
Close a position
Creates a sell order intent to close part of an account position. API keys need the portfolio:write scope. Review the current position before calling this endpoint.
POST
/
api
/
portfolio
/
positions
/
close
Close a position
curl --request POST \
--url https://api.useblueprints.ai/api/portfolio/positions/close \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tokenId": "<string>",
"amount": 123
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({tokenId: '<string>', amount: 123})
};
fetch('https://api.useblueprints.ai/api/portfolio/positions/close', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.useblueprints.ai/api/portfolio/positions/close"
payload = {
"tokenId": "<string>",
"amount": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"intentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"amount": 123
}{
"error": {
"message": "<string>"
},
"message": "<string>"
}{
"error": {
"message": "<string>"
},
"message": "<string>"
}{
"error": {
"message": "<string>"
},
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.