POST
/
v1
/
portfolios
/
create-from-template
curl --request POST \
  --url '/v1/portfolios/create-from-template' \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: your_api_key_here' \
  --data '{
    "templateId": "tmpl_xyz789",
    "userAddress": "0xYourWalletAddress",
    "chainIds": [8453],
    "name": "My Custom Template Portfolio",
    "description": "Created from a template with custom name",
    "accountIndex": 0
  }'
{
  "success": true,
  "data": {
    "portfolioId": "port_def456",
    "message": "Portfolio created from template successfully",
    "vaults": [
      {
        "chainId": "8453",
        "address": "0xPortfolioVaultAddress"
      }
    ],
    "template": {
      "blueprintId": "tmpl_xyz789",
      "editId": "edit_def456",
      "version": 1,
      "name": "My Custom Template Portfolio"
    }
  },
  "correlationId": "corr_abc123",
  "requestId": "req_xyz789",
  "timestamp": "2023-05-21T12:34:56.789Z"
}
Creates a new portfolio from a pre-defined template.
templateId
string
required
The ID of the template to use
userAddress
string
required
The Ethereum address of the user who will own the portfolio
chainIds
number[]
required
Array of chain IDs where the portfolio will operate
name
string
Custom name for the portfolio (overrides template name)
description
string
Custom description for the portfolio (overrides template description)
accountIndex
number
default:"0"
The account index
curl --request POST \
  --url '/v1/portfolios/create-from-template' \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: your_api_key_here' \
  --data '{
    "templateId": "tmpl_xyz789",
    "userAddress": "0xYourWalletAddress",
    "chainIds": [8453],
    "name": "My Custom Template Portfolio",
    "description": "Created from a template with custom name",
    "accountIndex": 0
  }'
{
  "success": true,
  "data": {
    "portfolioId": "port_def456",
    "message": "Portfolio created from template successfully",
    "vaults": [
      {
        "chainId": "8453",
        "address": "0xPortfolioVaultAddress"
      }
    ],
    "template": {
      "blueprintId": "tmpl_xyz789",
      "editId": "edit_def456",
      "version": 1,
      "name": "My Custom Template Portfolio"
    }
  },
  "correlationId": "corr_abc123",
  "requestId": "req_xyz789",
  "timestamp": "2023-05-21T12:34:56.789Z"
}