Skip to content
These docs describe Tradr v0.17.0. Running an older release? Check the release notes for what changed.

Link ungrouped positions into a group.

POST
/api/position-groups/link
curl --request POST \
--url https://api.tradr.cloud/api/position-groups/link \
--header 'Content-Type: application/json' \
--data '{ "labelOverride": "example", "positionIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ] }'

Authed. Links 2 to 8 existing open or closed, ungrouped positions sharing one account and underlying into a new group. Writes only the group row and each leg’s groupId — no fill or ledger row, and each leg’s updatedAt is left unchanged. Refuses a draft leg or one already in a group (409, naming the symbol), legs in different accounts or with a bad leg set (400, naming the leg index), or a foreign position id (404), before any write.

Media typeapplication/json
object
labelOverride
string
nullable >= 1 characters <= 40 characters
positionIds
required
Array<string>
>= 2 items <= 8 items
Examplegenerated
{
"labelOverride": "example",
"positionIds": [
"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
]
}

The new group

Validation error

A position id was not found (or not owned by the user).

A leg is a draft or already grouped; names its symbol.