cURL
curl --request POST \ --url https://carboncopy.inc/api/v1/portfolio/positions/close \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "positionId": "<string>", "marketSlug": "will-x-happen", "direction": "YES", "shares": 15.5, "outcome": "YES" } '
{ "success": true }
Sell all shares in an open position at the current market price.
API key in the format cc_<64 hex characters>. Obtain from the Dashboard under Settings → API Keys.
cc_<64 hex characters>
Convex document ID of the position.
"will-x-happen"
"YES"
Number of shares to sell.
15.5
Optional outcome override.
Position closed successfully.
true
Was this page helpful?