Skip to content

Update Position

PATCH
/positions/{position_id}
curl --request PATCH \
--url https://example.com/positions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Content-Type: application/json' \
--data '{ "closed": true, "name": "example" }'

Rename a position, or close one that holds nothing today.

position_id
required
Position Id
string format: uuid
Media typeapplication/json
PositionUpdate
object
closed
Any of:
boolean
name
Any of:
string
<= 200 characters

Successful Response

Media typeapplication/json
PositionOut

A position as it stands today, computed from its events and the close in effect (newest date first; manual, then provider, then feed-implied only on a tie).

object
account_id
required
Account Id
string format: uuid
closed_at
required
Any of:
string format: date-time
cost_basis
required
Any of:
string
events
required
Events
integer
id
required
Id
string format: uuid
market_value
required
Any of:
string
name
required
Any of:
string
opened_on
required
Opened On
string format: date
price
required
Any of:
string
price_as_of
required
Any of:
string format: date
price_source
required
Any of:
string
quantity
required
Quantity
string
stale_price
required
Stale Price
boolean
symbol
required
Symbol
string
unrealized_gain
required
Any of:
string
value_out_of_range
required
Value Out Of Range
boolean

Example generated

{
"account_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"closed_at": "2026-04-15T12:00:00Z",
"cost_basis": "example",
"events": 1,
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"market_value": "example",
"name": "example",
"opened_on": "2026-04-15",
"price": "example",
"price_as_of": "2026-04-15",
"price_source": "example",
"quantity": "example",
"stale_price": true,
"symbol": "example",
"unrealized_gain": "example",
"value_out_of_range": true
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string

Example generated

{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}