Add one leg to an existing group.
POST
/api/position-groups/{id}/legs
const url = 'https://api.tradr.cloud/api/position-groups/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/legs';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"positionId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tradr.cloud/api/position-groups/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/legs \ --header 'Content-Type: application/json' \ --data '{ "positionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Authed. Adds one ungrouped, non-draft position to the group, subject to the same checks as linking and the 8-leg cap. A 9th leg is refused with 400, naming the cap, and carries no leg index.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”id
required
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
positionId
required
string format: uuid
Examplegenerated
{ "positionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Responses
Section titled “ Responses ”The group
Validation error
The group or the position was not found (or not owned by the user).
The position is a draft or already grouped