> For the complete documentation index, see [llms.txt](https://docs.clickoptions.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clickoptions.ai/api/trading-api-v1-positions.md).

# Trading API v1   Positions

Position management operations

## Get positions

> Retrieve positions for the authenticated account with optional filtering

```json
{"openapi":"3.1.0","info":{"title":"fintp-public-api","version":"0.0.1"},"tags":[{"name":"Trading API v1 - Positions","description":"Position management operations"}],"servers":[{"url":"https://api.clickoptions.ai/api","description":"Generated server url"}],"paths":{"/v1/positions":{"get":{"tags":["Trading API v1 - Positions"],"summary":"Get positions","description":"Retrieve positions for the authenticated account with optional filtering","operationId":"getPositions","parameters":[{"name":"symbol","in":"query","description":"Symbol filter","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","description":"Position status filter (open, closed, exercised, liquidated)","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number (1-based)","required":false,"schema":{"type":"integer","format":"int32","default":1}},{"name":"size","in":"query","description":"Page size","required":false,"schema":{"type":"integer","format":"int32","default":20}}],"responses":{"200":{"description":"Positions retrieved successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PagedResponseV1PositionResponseV1"}}}},"400":{"description":"Invalid request parameters","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiErrorV1"}}}},"500":{"description":"Internal server error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiErrorV1"}}}}}}}},"components":{"schemas":{"PagedResponseV1PositionResponseV1":{"type":"object","properties":{"total":{"type":"integer","format":"int32","description":"Total number of items"},"page":{"type":"integer","format":"int32","description":"Current page number"},"pageSize":{"type":"integer","format":"int32","description":"Number of items per page"},"items":{"type":"array","description":"List of items for the current page","items":{"$ref":"#/components/schemas/PositionResponseV1"}}}},"PositionResponseV1":{"type":"object","description":"Response DTO for position operations in v1 API","properties":{"positionId":{"type":"string","description":"Unique identifier of the position"},"parentPositionId":{"type":"string","description":"Parent position, form which this positionw as created"},"symbol":{"type":"string","description":"Trading symbol"},"asset":{"type":"string","description":"Underlaying asset name"},"type":{"type":"string","description":"Option type"},"expiryDate":{"type":"integer","format":"int64","description":"Expiry date as epoch millis"},"sizeUsdt":{"type":"string","description":"Position size in USDT"},"size":{"type":"string","description":"Position size"},"sizeContracts":{"type":"string","description":"Position size in contracts"},"sizeUsdtClosed":{"type":"string","description":"Position closed size in USDT"},"sizeClosed":{"type":"string","description":"Position closed size"},"sizeContractsClosed":{"type":"string","description":"Position closed size in contracts"},"strikePrice":{"type":"string","description":"Strike price"},"openPrice":{"type":"string","description":"Open price (VWAP)"},"openDate":{"type":"integer","format":"int64","description":"Open date as epoch millis"},"status":{"type":"string","description":"Position status"},"fee":{"type":"string","description":"Fee paid"},"premiumTotal":{"type":"string","description":"Total collected premium"},"closePrice":{"type":"string","description":"Close price"},"pl":{"type":"string","description":"Trade Profit/Loss"},"plClosed":{"type":"string","description":"Trade Profit/Loss closed"},"contractQty":{"type":"string","description":"Contract quantity"},"tradeSide":{"type":"string","description":"Trade side"},"excercisePlClosed":{"type":"string","description":"Closed exercise P/L"},"excercisePlFloating":{"type":"string","description":"Floating exercise P/L"},"curIdxPrice":{"type":"string","description":"Current index price, used for calculation of floating excercise P/L"},"settlementPrice":{"type":"string","description":"Settlement price for exercise"},"easyOptionId":{"type":"string","description":"Id of easy option"}}},"ApiErrorV1":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"type":"object","additionalProperties":{}}}}}}}
```

## Get position by ID

> Retrieve a specific position by its ID

```json
{"openapi":"3.1.0","info":{"title":"fintp-public-api","version":"0.0.1"},"tags":[{"name":"Trading API v1 - Positions","description":"Position management operations"}],"servers":[{"url":"https://api.clickoptions.ai/api","description":"Generated server url"}],"paths":{"/v1/positions/{id}":{"get":{"tags":["Trading API v1 - Positions"],"summary":"Get position by ID","description":"Retrieve a specific position by its ID","operationId":"getPosition","parameters":[{"name":"id","in":"path","description":"Position ID","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Position retrieved successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PositionResponseV1"}}}},"400":{"description":"Invalid request parameters","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiErrorV1"}}}},"404":{"description":"Position not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiErrorV1"}}}},"500":{"description":"Internal server error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiErrorV1"}}}}}}}},"components":{"schemas":{"PositionResponseV1":{"type":"object","description":"Response DTO for position operations in v1 API","properties":{"positionId":{"type":"string","description":"Unique identifier of the position"},"parentPositionId":{"type":"string","description":"Parent position, form which this positionw as created"},"symbol":{"type":"string","description":"Trading symbol"},"asset":{"type":"string","description":"Underlaying asset name"},"type":{"type":"string","description":"Option type"},"expiryDate":{"type":"integer","format":"int64","description":"Expiry date as epoch millis"},"sizeUsdt":{"type":"string","description":"Position size in USDT"},"size":{"type":"string","description":"Position size"},"sizeContracts":{"type":"string","description":"Position size in contracts"},"sizeUsdtClosed":{"type":"string","description":"Position closed size in USDT"},"sizeClosed":{"type":"string","description":"Position closed size"},"sizeContractsClosed":{"type":"string","description":"Position closed size in contracts"},"strikePrice":{"type":"string","description":"Strike price"},"openPrice":{"type":"string","description":"Open price (VWAP)"},"openDate":{"type":"integer","format":"int64","description":"Open date as epoch millis"},"status":{"type":"string","description":"Position status"},"fee":{"type":"string","description":"Fee paid"},"premiumTotal":{"type":"string","description":"Total collected premium"},"closePrice":{"type":"string","description":"Close price"},"pl":{"type":"string","description":"Trade Profit/Loss"},"plClosed":{"type":"string","description":"Trade Profit/Loss closed"},"contractQty":{"type":"string","description":"Contract quantity"},"tradeSide":{"type":"string","description":"Trade side"},"excercisePlClosed":{"type":"string","description":"Closed exercise P/L"},"excercisePlFloating":{"type":"string","description":"Floating exercise P/L"},"curIdxPrice":{"type":"string","description":"Current index price, used for calculation of floating excercise P/L"},"settlementPrice":{"type":"string","description":"Settlement price for exercise"},"easyOptionId":{"type":"string","description":"Id of easy option"}}},"ApiErrorV1":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"type":"object","additionalProperties":{}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.clickoptions.ai/api/trading-api-v1-positions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
