Skip to main content

POST /v1/portfolio/hedge

Return constrained factor hedge candidates for a portfolio with compact residual exposure and trust metadata
Use this endpoint from server-side applications, SDKs, or agent workflows.

Response metadata

  • requestId
  • traceparent

Example request

curl -X POST \
  -H "x-api-key: $SECAPI_API_KEY" \
  -H "secapi-version: 2026-03-19" \
  -H "content-type: application/json" \
  -d '{
    "holdings": [
      {"symbol": "AAPL", "weight": 0.35},
      {"symbol": "MSFT", "weight": 0.30},
      {"symbol": "NVDA", "weight": 0.20},
      {"symbol": "JPM", "weight": 0.15}
    ],
    "objective": "factor_neutral",
    "constraints": {
      "maxHedges": 3,
      "maxPositionWeight": 0.10,
      "allowedInstrumentTypes": ["etf"]
    }
  }' \
  "https://api.secapi.ai/v1/portfolio/hedge?response_mode=compact"

Example response

{
  "requestId": "req_example_123",
  "traceparent": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
}

Give this prompt to your agent

Copy this SEC API prompt for your agent.

Errors and partial results

  • Treat non-2xx responses as API errors and log the response body for debugging
  • Log requestId and traceparent so SEC API support can trace the request
  • if provenance or freshness metadata is present, return it unchanged so trust is not lost in the handoff