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

# Measure

> Start measuring factor risk for 1 to 10 books over 1 to 60 dates of the factor model, on one model version: the one named, or the one live at the start. A book is a saved portfolio or a list of weights. model.as_of measures one date; model.range measures the last day of each month in it and its end (step month_end, the default) or each weekday (step daily); neither measures the newest publication. Each date reads the newest publication on or before it. Before the version's daily publications begin (model.dates.daily_from in an answer), a daily grid reads month-end publications, so use month_end for older history. A saved book without holdings_at follows its snapshots date by date; with holdings_at it stays the same book. Funds in a book, and the benchmark, are read through their stored holdings on or before each publication's model date. Answers 202 with a measure_id: read it until its status is not running. Keep the request_key: the same request with it joins the measure until 24 hours after it ends; another request with it is 409. A measure counts toward the 3 risk runs and measures an owner may have going, and stops if it runs past its time limit, at most 60 minutes; 429 and 503 carry Retry-After. For today's full report, start a risk run instead.

Operation ID: startRiskMeasure.



## OpenAPI

````yaml /openapi/itoflow-public.openapi.json post /risk/measure
openapi: 3.1.0
info:
  description: >-
    All Itoflow APIs are experimental and may change without notice. Read-only
    operations marked interactive can be tried from the documentation; the
    others are reference-only.
  title: Itoflow Developer API
  version: 1.0.0
servers:
  - description: Itoflow API
    url: https://api.itoflow.ai
security: []
tags:
  - name: Account
  - name: Billing
  - name: Brokers
  - name: Chat
  - name: Connected MCP servers
  - name: GitHub
  - name: Market data
  - name: Monitors
  - name: Notifications
  - name: Portfolios
  - name: Risk runs
  - name: Sharing and data
  - name: Strategies
paths:
  /risk/measure:
    post:
      tags:
        - Risk runs
      summary: Start a risk measure
      description: >-
        Start measuring factor risk for 1 to 10 books over 1 to 60 dates of the
        factor model, on one model version: the one named, or the one live at
        the start. A book is a saved portfolio or a list of weights. model.as_of
        measures one date; model.range measures the last day of each month in it
        and its end (step month_end, the default) or each weekday (step daily);
        neither measures the newest publication. Each date reads the newest
        publication on or before it. Before the version's daily publications
        begin (model.dates.daily_from in an answer), a daily grid reads
        month-end publications, so use month_end for older history. A saved book
        without holdings_at follows its snapshots date by date; with holdings_at
        it stays the same book. Funds in a book, and the benchmark, are read
        through their stored holdings on or before each publication's model
        date. Answers 202 with a measure_id: read it until its status is not
        running. Keep the request_key: the same request with it joins the
        measure until 24 hours after it ends; another request with it is 409. A
        measure counts toward the 3 risk runs and measures an owner may have
        going, and stops if it runs past its time limit, at most 60 minutes; 429
        and 503 carry Retry-After. For today's full report, start a risk run
        instead.


        Operation ID: startRiskMeasure.
      operationId: startRiskMeasure
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Gateway_RiskMeasureStart'
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Gateway_startRiskMeasureResponse'
          description: Started, or joined the measure with this key and request
          headers:
            Cache-Control:
              schema:
                const: no-store
                type: string
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Gateway_RiskMeasureError'
          description: >-
            invalid_request names the field: the shape, a limit, more than 60
            dates, from after to, or a date after today in New York.
          headers:
            Cache-Control:
              schema:
                const: no-store
                type: string
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Gateway_RiskMeasureError'
          description: No session or API bearer.
          headers:
            Cache-Control:
              schema:
                const: no-store
                type: string
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Gateway_RiskMeasureError'
          description: 'portfolio_not_found: a portfolio that is missing or not yours.'
          headers:
            Cache-Control:
              schema:
                const: no-store
                type: string
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Gateway_RiskMeasureError'
          description: >-
            risk_measure_request_key_conflict: this request_key started a
            measure of another request.
          headers:
            Cache-Control:
              schema:
                const: no-store
                type: string
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Gateway_RiskMeasureError'
          description: 'risk_engine_busy: 3 risk runs or measures are going.'
          headers:
            Cache-Control:
              schema:
                const: no-store
                type: string
            Retry-After:
              description: Seconds to wait before calling again.
              schema:
                minimum: 1
                type: integer
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Gateway_RiskMeasureError'
          description: >-
            risk_engine_unavailable: the risk engine did not answer. Retry the
            same call; a start with the same request_key joins the measure it
            may have started.
          headers:
            Cache-Control:
              schema:
                const: no-store
                type: string
            Retry-After:
              description: Seconds to wait before calling again.
              schema:
                minimum: 1
                type: integer
      security:
        - bearerAuth: []
components:
  schemas:
    Gateway_RiskMeasureStart:
      additionalProperties: false
      properties:
        request:
          $ref: '#/components/schemas/Gateway_RiskMeasureRequest'
        request_key:
          description: >-
            Your key for this measure. Retrying the same request with it joins
            the measure.
          maxLength: 200
          minLength: 1
          type: string
      required:
        - request_key
        - request
      type: object
    Gateway_startRiskMeasureResponse:
      additionalProperties: false
      properties:
        dates_total:
          maximum: 60
          minimum: 1
          type: integer
        joined_existing_measure:
          type: boolean
        measure_id:
          pattern: ^measure-[0-9a-f]{32}$
          type: string
        status:
          description: running for a new measure; a joined one gives its own status.
          enum:
            - running
            - ok
            - failed
          type: string
      required:
        - measure_id
        - status
        - joined_existing_measure
        - dates_total
      type: object
    Gateway_RiskMeasureError:
      additionalProperties: false
      properties:
        error:
          additionalProperties: false
          properties:
            code:
              type: string
            details:
              additionalProperties: {}
              propertyNames:
                type: string
              type: object
            message:
              type: string
          required:
            - code
            - message
          type: object
      required:
        - error
      type: object
    Gateway_RiskMeasureRequest:
      additionalProperties: false
      properties:
        benchmark:
          description: >-
            A fund, such as SPY.US. Its stored holdings book on or before the
            publication's model date gives each book active risk; without one,
            active is null and a warning says why.
          maxLength: 32
          minLength: 1
          type: string
        books:
          description: 1 to 10 books, each a saved portfolio or a list of weights.
          items:
            anyOf:
              - additionalProperties: false
                properties:
                  label:
                    description: Your name for the book. Labels are unique within a call.
                    maxLength: 80
                    minLength: 1
                    type: string
                  portfolio:
                    additionalProperties: false
                    properties:
                      holdings_at:
                        anyOf:
                          - format: date-time
                            pattern: >-
                              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                            type: string
                          - pattern: >-
                              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                            type: string
                        description: >-
                          A time with its offset, such as 2026-07-31T20:00:00Z.
                          The book is the newest saved snapshot on or before it.
                          Omitted with no as_of or range: the newest snapshot at
                          the measure's start time, shared by every book. A
                          dated request uses the end of the publication's model
                          date in New York.
                      portfolio_id:
                        description: A saved portfolio you own.
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                        type: string
                    required:
                      - portfolio_id
                    type: object
                required:
                  - label
                  - portfolio
                type: object
              - additionalProperties: false
                properties:
                  holdings:
                    description: >-
                      1 to 3000 lines, as fractions of net assets. With a CASH
                      line the weights add to 1, within 0.01. Without one, the
                      rest of the book is cash; a book that borrows lists CASH
                      below zero. Nothing is rescaled.
                    items:
                      additionalProperties: false
                      properties:
                        symbol:
                          description: >-
                            Ticker symbol such as NVDA.US; a bare ticker means
                            its US listing. CASH is US dollars.
                          maxLength: 32
                          minLength: 1
                          type: string
                        weight:
                          description: >-
                            Fraction of the portfolio's net assets, so 0.25 is
                            25%. A short is below zero, and CASH holds what its
                            sale raised.
                          type: number
                      required:
                        - symbol
                        - weight
                      type: object
                    maxItems: 3000
                    minItems: 1
                    type: array
                  label:
                    description: Your name for the book. Labels are unique within a call.
                    maxLength: 80
                    minLength: 1
                    type: string
                required:
                  - label
                  - holdings
                type: object
          maxItems: 10
          minItems: 1
          type: array
        model:
          additionalProperties: false
          default: {}
          description: >-
            Which dates of the factor model to measure on. Neither as_of nor
            range: the version's newest publication.
          properties:
            as_of:
              description: >-
                One date, YYYY-MM-DD, not after today in New York. The newest
                publication on or before it counts. Not with range.
              format: date
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
              type: string
            range:
              additionalProperties: false
              description: >-
                A range of model dates, at most 60. Each date reads the newest
                publication on or before it.
              properties:
                from:
                  description: YYYY-MM-DD, on or before to.
                  format: date
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                  type: string
                step:
                  default: month_end
                  description: >-
                    month_end: the last day of each month in the range, and to
                    when it is not one. daily: each weekday in the range.
                  enum:
                    - month_end
                    - daily
                  type: string
                to:
                  description: YYYY-MM-DD, not after today in New York.
                  format: date
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                  type: string
              required:
                - from
                - to
              type: object
            version:
              description: >-
                A factor model version. Omitted: the version live when the
                measure starts. Every date uses it.
              maxLength: 200
              minLength: 1
              type: string
          type: object
        top_names:
          default: 10
          description: How many names to list by their share of each book's risk, 0 to 50.
          maximum: 50
          minimum: 0
          type: integer
      required:
        - books
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: Itoflow access token issued for the Itoflow API.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.