# Portfolio data

Read-only endpoints to verify data availability and retrieve normalized custody positions and transactions (aggregated across custodians and portfolios).

## Custodian availability for positions and/or transactions

> Returns readiness (per custodian) for a given date.\
> Aggregates across all portfolios under each custodian.<br>

```json
{"openapi":"3.0.3","info":{"title":"Apentis API","version":"1.1.0"},"tags":[{"name":"Portfolio data","description":"Read-only endpoints to verify data availability and retrieve normalized custody positions and transactions (aggregated across custodians and portfolios)."}],"servers":[{"url":"https://www.riskquadrant.com/api","description":"API for Production environment - Luxembourg"},{"url":"https://www.riskquadrant.ch/api","description":"API for Production environment - Switzerland"},{"url":"https://www.rq-test.com/api","description":"API for Test environment (for sandbox integration)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"AvailabilitySingleDate":{"type":"object","required":["asOfDate","custodians"],"properties":{"asOfDate":{"type":"string","format":"date"},"custodians":{"type":"array","items":{"$ref":"#/components/schemas/CustodianAvailability"}}}},"CustodianAvailability":{"type":"object","required":["custodianId"],"properties":{"custodianId":{"type":"string","description":"Custodian code (custodian ID code provided by Apentis)"},"positionsStatus":{"type":"string","nullable":true,"description":"Aggregated status across all portfolios at this custodian","enum":["COMPLETE","PARTIAL","LOADING","FAILED"]},"positionsLoadedAt":{"type":"string","format":"date-time","nullable":true,"description":"Latest contributing portfolio timestamp (UTC)"},"positionsIngestionRuns":{"type":"array","items":{"type":"string"},"description":"Distinct ingestion run IDs that contributed to the status"},"transactionsStatus":{"type":"string","nullable":true,"enum":["COMPLETE","PARTIAL","LOADING","FAILED"]},"transactionsLoadedAt":{"type":"string","format":"date-time","nullable":true},"transactionsIngestionRuns":{"type":"array","items":{"type":"string"}},"notes":{"type":"string","nullable":true,"description":"Short diagnostic text (present only if includeNotes=true)"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string","description":"Short description of the error"},"code":{"type":"integer","description":"Application-specific or HTTP error code"}}}}},"paths":{"/v1.1/data/availability":{"get":{"summary":"Custodian availability for positions and/or transactions","tags":["Portfolio data"],"description":"Returns readiness (per custodian) for a given date.\nAggregates across all portfolios under each custodian.\n","operationId":"getDataAvailability","parameters":[{"in":"query","name":"asOfDate","required":true,"description":"Snapshot date (YYYY-MM-DD)","schema":{"type":"string","format":"date"}},{"in":"query","name":"custodianId","required":false,"description":"Filter to a single custodian (internal code provided by Apentis)","schema":{"type":"string"}},{"in":"query","name":"scope","required":false,"description":"What readiness to return","schema":{"type":"string","enum":["POSITIONS","TRANSACTIONS","BOTH"],"default":"BOTH"}},{"in":"query","name":"includeNotes","required":false,"description":"Include short diagnostic notes","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailabilitySingleDate"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Positions snapshot by date

> Returns custody positions (cash + securities) for all portfolios as of a start date and until an optional end date.\
> If no custodianId is provided, includes positions from all \*ready\* custodians and omits not-ready ones.\
> If a custodianId is provided and that custodian is not ready, returns 409 Conflict.<br>

```json
{"openapi":"3.0.3","info":{"title":"Apentis API","version":"1.1.0"},"tags":[{"name":"Portfolio data","description":"Read-only endpoints to verify data availability and retrieve normalized custody positions and transactions (aggregated across custodians and portfolios)."}],"servers":[{"url":"https://www.riskquadrant.com/api","description":"API for Production environment - Luxembourg"},{"url":"https://www.riskquadrant.ch/api","description":"API for Production environment - Switzerland"},{"url":"https://www.rq-test.com/api","description":"API for Test environment (for sandbox integration)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"PositionsCollectionResponse":{"type":"object","required":["startDate","positions"],"properties":{"startDate":{"type":"string","format":"date","description":"Snapshot start date"},"endDate":{"type":"string","format":"date","nullable":true,"description":"Snapshot end date; when null, positions are returned from startDate until now"},"includedCustodians":{"type":"array","items":{"type":"string"},"description":"Custodians included in this response (ready at the time of request)"},"excludedCustodians":{"type":"array","items":{"$ref":"#/components/schemas/CustodianExclusion"},"description":"Custodians that were not ready and therefore excluded"},"positions":{"type":"array","items":{"$ref":"#/components/schemas/PositionRecord"}},"nextCursor":{"type":"string","nullable":true,"description":"Opaque cursor for fetching the next page; null if last page"}}},"CustodianExclusion":{"type":"object","properties":{"custodianId":{"type":"string"},"positionsStatus":{"type":"string","enum":["COMPLETE","PARTIAL","LOADING","FAILED"]}}},"PositionRecord":{"type":"object","required":["date","portfolioCustodianId","portfolioId","portfolioCurrencyId","crmCode","isCash","quantity","marketValueSecurityCcy","marketValuePortfolioCcy","custodianId","importationTime"],"properties":{"date":{"type":"string","format":"date","description":"Position date (YYYY-MM-DD)"},"portfolioCustodianId":{"type":"string","description":"Portfolio/account code at custodian"},"portfolioId":{"type":"string","description":"Apentis portfolio id"},"portfolioCurrencyId":{"type":"string","description":"ISO 4217 code, e.g. EUR"},"crmCode":{"type":"string","description":"Holder of the portfolio"},"portfolioManager":{"type":"string","description":"Manager of the portfolio"},"isCash":{"type":"boolean","description":"True if the row represents cash"},"securityOtherCode":{"type":"array","nullable":true,"description":"Alternative security identifiers","items":{"$ref":"#/components/schemas/SecurityOtherCode"}},"securityBankId":{"type":"string","nullable":true},"securityId":{"type":"string","nullable":true,"description":"Apentis security id; may be null for cash"},"securityName":{"type":"string","nullable":true},"securityCurrencyId":{"type":"string","nullable":true},"securityMultiplier":{"type":"number","format":"double","nullable":true},"securitySectorId":{"nullable":true,"$ref":"#/components/schemas/SecuritySectorEnum"},"securityCountryId":{"type":"string","nullable":true,"description":"ISO 3166 country code"},"securityAssetClassId":{"nullable":true,"$ref":"#/components/schemas/SecurityAssetClassEnum"},"securityIndustryId":{"nullable":true,"$ref":"#/components/schemas/SecurityIndustryEnum"},"quantity":{"type":"string","description":"Decimal as string"},"priceDate":{"type":"string","format":"date","nullable":true},"price":{"type":"string","nullable":true,"description":"Decimal as string; price in security currency"},"marketValueSecurityCcy":{"type":"string","description":"Decimal as string; MV in security currency"},"marketValuePortfolioCcy":{"type":"string","description":"Decimal as string; MV in portfolio currency"},"costPrice":{"type":"string","nullable":true},"accruedInterest":{"type":"string","nullable":true},"custodianId":{"type":"string","description":"Custodian code (custodian ID code provided by Apentis)"},"importationTime":{"type":"string","format":"date-time","description":"UTC timestamp when imported into Apentis"}}},"SecurityOtherCode":{"type":"object","required":["scheme","value"],"properties":{"scheme":{"type":"string","description":"Identifier scheme (e.g., ISIN, Bloomberg, CUSIP)"},"value":{"type":"string","description":"Code value in the given scheme"}}},"SecuritySectorEnum":{"type":"string","description":"Security sector code (see GitBook reference)","enum":["-","CD","CS","EN","FN","HC","ID","IT","MA","Others","RE","TE","UT"]},"SecurityAssetClassEnum":{"type":"string","description":"Asset class code (see GitBook reference)","enum":["AR","CA","CC","CF","CO","CV","DE","EQ","FI","FRN","FX","HF","MAC","MZ","NFA","OTHER","PD","PE","PP","RE","RLI","SE","SP","VOL","YI"]},"SecurityIndustryEnum":{"type":"string","description":"Security industry code (see GitBook reference)","enum":["-","AC","BK","CDA","CG","CPS","DF","EN","FBT","FSR","HCES","HPP","HRL","IN","MA","ME","PB","RE","RT","SS","SSE","THE","TR","TS","UT"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string","description":"Short description of the error"},"code":{"type":"integer","description":"Application-specific or HTTP error code"}}}}},"paths":{"/v1.1/data/positions":{"get":{"tags":["Portfolio data"],"summary":"Positions snapshot by date","description":"Returns custody positions (cash + securities) for all portfolios as of a start date and until an optional end date.\nIf no custodianId is provided, includes positions from all *ready* custodians and omits not-ready ones.\nIf a custodianId is provided and that custodian is not ready, returns 409 Conflict.\n","operationId":"listPositions","parameters":[{"in":"query","name":"startDate","required":true,"description":"Snapshot start date (YYYY-MM-DD)","schema":{"type":"string","format":"date"}},{"in":"query","name":"endDate","required":false,"description":"Snapshot end date (YYYY-MM-DD). If null, the positions will be provided as of startDate","schema":{"type":"string","format":"date"}},{"in":"query","name":"custodianId","required":false,"description":"Filter to a single custodian. If provided and not ready -> 409.","schema":{"type":"string"}},{"in":"query","name":"portfolioId","required":false,"description":"Optional filter to one portfolio (or multiple via repeated param).","schema":{"type":"string"},"style":"form","explode":true},{"in":"query","name":"type","required":false,"description":"Filter by position type","schema":{"type":"string","enum":["ALL","SECURITY","CASH"],"default":"ALL"}},{"in":"query","name":"pageSize","required":false,"description":"Number of records per page (max 5000)","schema":{"type":"integer","minimum":1,"maximum":5000,"default":1000}},{"in":"query","name":"cursor","required":false,"description":"Opaque pagination cursor returned by the previous page","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PositionsCollectionResponse"}}}},"409":{"description":"Conflict — requested custodian not ready","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# Agent Instructions: 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://apentis.gitbook.io/apentis-api/api-reference/portfolio-data.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.
