> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wealthyhood.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Past performance (template allocation)

> Historical performance chart and metrics for a hypothetical portfolio defined by asset weights.



## OpenAPI

````yaml GET /insights/past-performance
openapi: 3.0.3
info:
  title: Wealthyhood Insights API
  version: 1.0.0
  description: >
    Template allocation insights for hypothetical portfolios defined by asset
    weights.


    All requests require a bearer token with the scopes advertised in the
    primary specification,

    and must include the `x-user-id` header so the platform can resolve the
    acting investor.


    **Allocation query parameters:** In addition to the documented query
    parameters, you pass one

    query parameter per asset you want to include in the hypothetical portfolio.
    The parameter **name**

    is the asset `assetCommonId` (any active id from the investment universe)
    and the **value** is the

    weight as a number; the weights across all asset parameters must sum to
    exactly **100**.


    Because the parameter **names are dynamic**, they are not listed in each
    operation's Query

    Parameters table — only the fixed parameters (`initial`, `monthly`) are.
    Example query string

    using two arbitrary asset ids:

    `?initial=10000&equities_uk=50&equities_eu=50` (add `&monthly=...` on the
    future performance

    endpoints when you want to override the default).
servers:
  - url: https://{host}
    variables:
      host:
        default: api.wealthyhood.com
        description: Wealthyhood API host name.
security:
  - bearerAuth: []
tags:
  - name: Insights
    description: Past and projected performance charts for template allocations.
paths:
  /insights/past-performance:
    get:
      tags:
        - Insights
      summary: Past performance for a template allocation
      description: >
        Returns historical performance time series by tenor and summary metrics
        (drawdown, volatility,

        annualised return) for the given initial amount and asset weights.


        In addition to `initial`, pass one query parameter per asset
        (`<assetCommonId>=<weight>`); the

        weights must sum to **100**. See the API overview for details on
        allocation parameters.


        **Example query string:** `initial=10000&equities_uk=50&equities_eu=50`
      parameters:
        - $ref: '#/components/parameters/ExternalUserId'
        - name: initial
          in: query
          required: true
          description: >-
            Initial portfolio value (whole currency units) used for the
            simulation.
          schema:
            type: string
            example: '10000'
      responses:
        '200':
          description: Past performance series and metrics.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PastPerformanceResponse'
              examples:
                sample:
                  summary: £10,000 equally split UK/EU equities
                  value:
                    pastPerformance:
                      1y:
                        - date: '2024-09-15T00:00:00.000Z'
                          value: 10000
                        - date: '2024-09-16T00:00:00.000Z'
                          value: 10023
                      5y:
                        - date: '2020-09-15T00:00:00.000Z'
                          value: 10000
                        - date: '2020-09-16T00:00:00.000Z'
                          value: 10008
                      10y:
                        - date: '2015-09-15T00:00:00.000Z'
                          value: 10000
                        - date: '2015-09-16T00:00:00.000Z'
                          value: 10011
                    metrics:
                      1y:
                        maximum_drawdown: 6.3
                        volatility: 9.8
                        annualised_return: 7.5
                      5y:
                        maximum_drawdown: 18.2
                        volatility: 12.4
                        annualised_return: 8.7
                      10y:
                        maximum_drawdown: 28.5
                        volatility: 15.1
                        annualised_return: 10.2
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |
            curl --request GET \
              --url 'https://api.wealthyhood.com/insights/past-performance?initial=10000&equities_uk=50&equities_eu=50' \
              --header 'Authorization: Bearer <token>' \
              --header 'x-user-id: <x-user-id>'
components:
  parameters:
    ExternalUserId:
      name: x-user-id
      in: header
      required: true
      description: MongoDB identifier of the user (B2B acting investor).
      schema:
        type: string
        pattern: ^[a-f0-9]{24}$
  schemas:
    PastPerformanceResponse:
      type: object
      required:
        - pastPerformance
        - metrics
      properties:
        pastPerformance:
          $ref: '#/components/schemas/PerformanceSeriesByTenor'
        metrics:
          type: object
          description: >-
            Metrics keyed by tenor (e.g. maximum_drawdown, volatility,
            annualised_return).
          additionalProperties: true
      additionalProperties: false
    PerformanceSeriesByTenor:
      type: object
      description: >
        Map of performance tenor (e.g. `1m`, `6m`, `1y`, `5y`, `10y`) to arrays
        of portfolio value

        points over time. Tenor keys come from the statistics service; a
        response includes multiple

        tenors in practice. See the 200 example for the exact shape.
      additionalProperties:
        type: array
        items:
          type: object
          properties:
            date:
              type: string
              format: date-time
            value:
              type: number
          additionalProperties: false
    ApiErrorResponse:
      type: object
      properties:
        status:
          type: integer
        error:
          type: object
          properties:
            message:
              type: string
            description:
              type: string
              nullable: true
        responseId:
          type: string
          format: uuid
      additionalProperties: false
  responses:
    BadRequestError:
      description: Invalid query parameters or allocation weights.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
    UnauthorizedError:
      description: Missing or invalid bearer token, or user not found for partner.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
    ForbiddenError:
      description: Authenticated caller cannot access this resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Auth0-issued access token that includes the scopes listed for the route.

````