curl --request POST \
  --url '/v1/portfolio/create/signature' \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: your_api_key_here' \
  --data '{
    "userAddress": "0xYourWalletAddress",
    "chainIds": [8453],
    "accountIndex": 0
  }'
{
  "success": true,
  "data": {
    "userAddress": "0xYourWalletAddress",
    "chainIds": [8453],
    "accountIndex": 0,
    "kernelVersion": "0.3.2",
    "signatureAction": {
      "reason": "portfolio-permission",
      "type": "personal_sign",
      "message": "I authorize Glider to manage my portfolio\n\n0x8ad4d95c3c3d0a1e87bfdb1d2401905db4a97d8e05e77d69e5d79397da128b81"
    }
  },
  "correlationId": "corr_abc123",
  "requestId": "req_xyz789",
  "timestamp": "2023-05-21T12:34:56.789Z"
}
The Portfolio Creation endpoints allow you to create new portfolios with user signatures and from templates.

Generate Signature Request

Generates a message that must be signed by the user’s wallet to create a portfolio.
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 (e.g., [8453] for Base)
accountIndex
number
default:"0"
The account index (useful for supporting multiple portfolios from same address)
curl --request POST \
  --url '/v1/portfolio/create/signature' \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: your_api_key_here' \
  --data '{
    "userAddress": "0xYourWalletAddress",
    "chainIds": [8453],
    "accountIndex": 0
  }'
{
  "success": true,
  "data": {
    "userAddress": "0xYourWalletAddress",
    "chainIds": [8453],
    "accountIndex": 0,
    "kernelVersion": "0.3.2",
    "signatureAction": {
      "reason": "portfolio-permission",
      "type": "personal_sign",
      "message": "I authorize Glider to manage my portfolio\n\n0x8ad4d95c3c3d0a1e87bfdb1d2401905db4a97d8e05e77d69e5d79397da128b81"
    }
  },
  "correlationId": "corr_abc123",
  "requestId": "req_xyz789",
  "timestamp": "2023-05-21T12:34:56.789Z"
}

Create Portfolio

Creates a new portfolio using the signed message from the previous step.
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
accountIndex
number
default:"0"
The account index
kernelVersion
string
required
The kernel version (from signature request response)
signatureAction
object
required
The signature action object from the signature request response
signature
string
required
The signature obtained from the user’s wallet
templateData
object
Optional template data to initialize the portfolio
curl --request POST \
  --url '/v1/portfolio/create' \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: your_api_key_here' \
  --data '{
    "userAddress": "0xYourWalletAddress",
    "chainIds": [8453],
    "accountIndex": 0,
    "kernelVersion": "0.3.2",
    "signatureAction": {
      "reason": "portfolio-permission",
      "type": "personal_sign",
      "message": "I authorize Glider to manage my portfolio\n\n0x8ad4d95c3c3d0a1e87bfdb1d2401905db4a97d8e05e77d69e5d79397da128b81"
    },
    "signature": "0xYourSignatureFromWallet",
    "templateData": {
      "name": "70/30 ETH-USDC Portfolio",
      "description": "A simple portfolio with 70% ETH and 30% USDC allocation",
      "entry": {
        "blockType": "weight",
        "weightType": "specified-percentage",
        "weightings": ["70", "30"],
        "children": [
          {
            "blockType": "asset",
            "assetId": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE:8453"
          },
          {
            "blockType": "asset",
            "assetId": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913:8453"
          }
        ]
      }
    }
  }'
{
  "success": true,
  "data": {
    "portfolioId": "port_abc123",
    "message": "Portfolio created successfully",
    "vaults": [
      {
        "chainId": "8453",
        "address": "0xPortfolioVaultAddress"
      }
    ],
    "template": {
      "blueprintId": "tmpl_xyz789",
      "editId": "edit_abc123",
      "version": 1,
      "name": "70/30 ETH-USDC Portfolio"
    }
  },
  "correlationId": "corr_abc123",
  "requestId": "req_xyz789",
  "timestamp": "2023-05-21T12:34:56.789Z"
}

Create Portfolio from Template

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"
}

Resign Portfolio Permission

Generates a new signable message for an existing portfolio. This is useful when session keys need to be refreshed.
portfolioId
string
required
The ID of the portfolio to resign
curl --request POST \
  --url '/v1/portfolio/port_abc123/resign' \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: your_api_key_here' \
  --data '{}'
{
  "success": true,
  "data": {
    "signatureAction": {
      "reason": "portfolio-resign",
      "type": "personal_sign",
      "message": "I authorize Glider to manage my portfolio\n\n0x8ad4d95c3c3d0a1e87bfdb1d2401905db4a97d8e05e77d69e5d79397da128b81"
    },
    "signType": "personal_sign",
    "userAddress": "0xYourWalletAddress",
    "agentAddress": "0xAgentAddress",
    "accountIndex": "0",
    "chainIds": [8453],
    "portfolioId": "port_abc123",
    "portfolioAddresses": [
      {
        "chainId": 8453,
        "address": "0xPortfolioVaultAddress"
      }
    ]
  },
  "correlationId": "corr_abc123",
  "requestId": "req_xyz789",
  "timestamp": "2023-05-21T12:34:56.789Z"
}

Resubmit Signature

Submits a new signature for an existing portfolio to refresh session keys.
portfolioId
string
required
The ID of the portfolio
signature
string
required
The signature obtained from the user’s wallet
signatureAction
object
required
The signature action object from the resign response
curl --request POST \
  --url '/v1/portfolio/port_abc123/resubmit-signature' \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: your_api_key_here' \
  --data '{
    "signature": "0xYourSignatureFromWallet",
    "signatureAction": {
      "reason": "portfolio-resign",
      "type": "personal_sign",
      "message": "I authorize Glider to manage my portfolio\n\n0x8ad4d95c3c3d0a1e87bfdb1d2401905db4a97d8e05e77d69e5d79397da128b81"
    }
  }'
{
  "success": true,
  "data": {
    "portfolioId": "port_abc123",
    "userAddress": "0xYourWalletAddress",
    "message": "Portfolio signature resubmitted successfully",
    "updatedAt": "2023-05-21T13:45:12.345Z",
    "vaults": [
      {
        "chainId": 8453,
        "address": "0xPortfolioVaultAddress"
      }
    ]
  },
  "correlationId": "corr_abc123",
  "requestId": "req_xyz789",
  "timestamp": "2023-05-21T13:45:12.345Z"
}