Skip to main content
POST
/
api
/
v1
/
portfolio
/
positions
/
close
Close a position
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
}

Authorizations

Authorization
string
header
required

API key in the format cc_<64 hex characters>. Obtain from the Dashboard under Settings → API Keys.

Body

application/json
positionId
string
required

Convex document ID of the position.

marketSlug
string
required
Example:

"will-x-happen"

direction
string
required
Example:

"YES"

shares
number
required

Number of shares to sell.

Example:

15.5

outcome
string

Optional outcome override.

Example:

"YES"

Response

Position closed successfully.

success
boolean
Example:

true