Create or replace a portfolio snapshot
/portfoliosUploads the holdings of a portfolio for one date. Sending the same identifier with a date in the same quarter replaces that snapshot. A date in another quarter adds a new snapshot. When the identifier already exists, only the holdings are replaced or added: name and currency are changed only with PUT /portfolios/{identifier}. Use the identifier in the response to update or delete the portfolio later. A snapshot_at in a future year fails with 400 and the message Snapshot date cannot be higher than actual date. A date that cannot be read fails with 400 and the message You are not using a valid date as snapshot parameter.
Authorization
apiKey Your Connect Earth API key.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://eco.datia.app/portfolios" \ -H "x-api-key: $CE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Pension fund A", "identifier": "pension-fund-a", "currency": "USD", "snapshot_at": "2026-06-30", "holdings": [ { "name": "Apple Inc.", "isin": "US0378331005", "instrument_type": "stock", "currency": "USD", "weight": 30, "market_value": 3000000 }, { "name": "Microsoft Corp.", "isin": "US5949181045", "instrument_type": "stock", "currency": "USD", "weight": 25, "market_value": 2500000 }, { "name": "iShares Core MSCI World UCITS ETF", "isin": "IE00B4L5Y983", "instrument_type": "etf", "currency": "USD", "weight": 25, "market_value": 2500000 }, { "name": "Bund 2.6% 2033", "isin": "DE000BU2Z015", "instrument_type": "sovereign-bond", "currency": "EUR", "weight": 15, "market_value": 1500000 }, { "name": "Cash", "isin": null, "instrument_type": "cash", "currency": "USD", "weight": 5, "market_value": 500000 } ] }'{ "identifier": "datia-portfolio:12345_pension-fund-a", "metadata": { "message": "Fund created successfully at 2026-06-30" }}List portfolios GET
Lists every portfolio in your organization, including portfolios created in the Connect Earth app, and the snapshot dates each one has. Snapshots older than about five years are not listed.
Delete a portfolio snapshot DELETE
Deletes one snapshot of a portfolio. It works on any portfolio in your organization, including portfolios created in the Connect Earth app. When you delete the last listed snapshot, the portfolio is deleted too. A portfolio with no listed snapshots, for example one whose snapshots are all older than about five years, is deleted entirely by a DELETE, whatever snapshot_at you send. If the snapshot is not listed, nothing is deleted and the message says so. metadata.message is one of Fund snapshot deleted successfully, Fund deleted successfully with all snapshots, Fund deleted successfully or Fund snapshot not found.