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

# Queue a Point-in-Time Quantile Forecast Backtest for an Authorized Workspace

> Queues a durable worker. Each historical window produces final ensemble quantiles from prior real bars only. Entry blocks use requested forecast quantiles; quantile/percentage targets and trailing stops use completed observed closes, with fills at the next observed bar. No live orders. Requires forecast.create and monthly allowance; event-market display quotes are not executable bids or asks.



## OpenAPI

````yaml https://quantura.studio/api/openapi.json post /backtests
openapi: 3.1.0
info:
  title: Quantura Forecast Intelligence API
  version: 1.0.0
  description: >-
    Versioned access to Quantura forecasts, collaborator-aware workspaces,
    screeners, datasets, and provenance metadata.
  contact:
    name: Quantura
    url: https://quantura.studio/contact
  license:
    name: Quantura API Terms
    url: https://quantura.studio/terms
servers:
  - url: https://quantura.studio/api/v1
security:
  - bearerAuth: []
tags:
  - name: Access
    description: Identity, token scopes, plans, and effective workspace access.
  - name: Workspaces
    description: Resources are authorized against current membership on every request.
  - name: Uploaded CSVs
    description: Workspace-isolated CSV metadata, organization, and authorized exports.
  - name: Datasets
    description: Licensing-aware catalog and schema metadata.
  - name: Forecasts
    description: Prospective forecasts and immutable probability trajectories.
  - name: Ensemble Forecasts
    description: >-
      Asynchronous probabilistic time-series ensemble jobs and reproducible
      presets.
  - name: Backtests
    description: >-
      Asynchronous point-in-time ensemble-quantile simulations and versioned
      strategy exports; never live order execution.
paths:
  /backtests:
    post:
      tags:
        - Backtests
      summary: >-
        Queue a Point-in-Time Quantile Forecast Backtest for an Authorized
        Workspace
      description: >-
        Queues a durable worker. Each historical window produces final ensemble
        quantiles from prior real bars only. Entry blocks use requested forecast
        quantiles; quantile/percentage targets and trailing stops use completed
        observed closes, with fills at the next observed bar. No live orders.
        Requires forecast.create and monthly allowance; event-market display
        quotes are not executable bids or asks.
      operationId: createBacktest
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BacktestRequest'
            example:
              source:
                type: ticker
                symbol: SPY
                provider: auto
                frequency: 1Day
              forecast:
                prediction_length: 30
                quantiles:
                  - 0.01
                  - 0.1
                  - 0.25
                  - 0.5
                  - 0.75
                  - 0.9
                  - 0.99
                models:
                  prophet:
                    enabled: true
                    weight: 1
                failure_policy: fail
              replay:
                context_rows: 128
                evaluation_windows: 2
              strategy:
                schema_version: 2
                type: quantile_rules
                entry_logic: all
                rules:
                  - id: entry_p10
                    kind: entry
                    condition: crosses_above
                    quantile: 0.1
                  - id: take_p50
                    kind: take_profit
                    target_mode: quantile
                    quantile: 0.5
                  - id: stop_p01
                    kind: stop_loss
                    target_mode: quantile
                    quantile: 0.01
              execution:
                starting_capital: 1000
                position_fraction: 1
                commission_bps: 10
                slippage_bps: 5
      responses:
        '202':
          description: >-
            Durable quantile backtest queued; poll status_url for progress and
            the completed result.
          content:
            application/json:
              schema:
                type: object
              example:
                data:
                  backtest_id: bt_0123456789abcdef0123456789abcdef
                  status: queued
                  created_at: '2026-09-23T20:00:00.000Z'
                  status_url: /api/v1/backtests/bt_0123456789abcdef0123456789abcdef
                  result_url: /api/v1/backtests/bt_0123456789abcdef0123456789abcdef
                meta:
                  api_version: v1
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - request_id
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      request_id:
                        type: string
                        format: uuid
        '403':
          description: Scope, plan, or workspace authorization denied
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - request_id
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      request_id:
                        type: string
                        format: uuid
        '422':
          description: >-
            Unsupported source, incompatible rule stack or insufficient observed
            history.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - request_id
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      request_id:
                        type: string
                        format: uuid
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - request_id
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      request_id:
                        type: string
                        format: uuid
components:
  schemas:
    BacktestRequest:
      type: object
      additionalProperties: false
      required:
        - source
        - forecast
        - replay
        - strategy
      properties:
        workspace_id:
          type: string
        strategy:
          $ref: '#/components/schemas/BacktestStrategy'
        forecast:
          type: object
          additionalProperties: false
          required:
            - prediction_length
            - quantiles
            - models
          properties:
            prediction_length:
              type: integer
              minimum: 1
              maximum: 60
            quantiles:
              type: array
              minItems: 1
              maxItems: 21
              uniqueItems: true
              items:
                type: number
                exclusiveMinimum: 0
                exclusiveMaximum: 1
            models:
              type: object
              additionalProperties: false
              properties:
                prophet:
                  $ref: '#/components/schemas/ModelSelection'
                toto:
                  $ref: '#/components/schemas/ModelSelection'
                granite:
                  $ref: '#/components/schemas/ModelSelection'
                chronos:
                  $ref: '#/components/schemas/ModelSelection'
                timesfm:
                  $ref: '#/components/schemas/ModelSelection'
            toto_variant:
              type: string
              enum:
                - 4m
                - 22m
                - 313m
                - 1b
                - 2.5b
              default: 4m
            failure_policy:
              type: string
              enum:
                - fail
                - renormalize
        replay:
          type: object
          additionalProperties: false
          required:
            - context_rows
            - evaluation_windows
          properties:
            context_rows:
              type: integer
              minimum: 2
              maximum: 500
            evaluation_windows:
              type: integer
              minimum: 1
              maximum: 8
        source:
          oneOf:
            - type: object
              additionalProperties: false
              required:
                - type
                - symbol
              properties:
                type:
                  const: ticker
                symbol:
                  type: string
                provider:
                  type: string
                  enum:
                    - auto
                    - alpaca
                    - yahoo
                    - dukascopy
                price_side:
                  type: string
                  enum:
                    - bid
                    - ask
                  default: bid
                  description: >-
                    Dukascopy quote side, persisted for refresh and
                    observations.
                frequency:
                  type: string
                  enum:
                    - 1Day
                    - 1Hour
                    - 1Min
                end:
                  type: string
                  format: date-time
            - type: object
              additionalProperties: false
              required:
                - type
                - provider
                - symbol
                - contract_id
              properties:
                type:
                  const: prediction_market
                provider:
                  type: string
                  enum:
                    - kalshi
                    - polymarket_us
                symbol:
                  type: string
                contract_id:
                  type: string
                frequency:
                  type: string
                  enum:
                    - 1min
                    - 1h
                    - 1D
                history_phase:
                  type: string
                  enum:
                    - both
                    - pregame
                    - in_game
                end:
                  type: string
                  format: date-time
        execution:
          type: object
          additionalProperties: false
          properties:
            starting_capital:
              type: number
              minimum: 10
              maximum: 1000000
            position_fraction:
              type: number
              exclusiveMinimum: 0
              maximum: 1
            commission_bps:
              type: number
              minimum: 0
              maximum: 1000
            slippage_bps:
              type: number
              minimum: 0
              maximum: 1000
    BacktestStrategy:
      $schema: https://json-schema.org/draft/2020-12/schema
      title: Quantura quantile backtest strategy v2
      description: >-
        Research-only long strategy; exits are OR-combined. Stops take
        precedence over trailing stops, then take-profit when several signal on
        the same completed bar.
      type: object
      additionalProperties: false
      required:
        - schema_version
        - type
        - entry_logic
        - rules
      properties:
        schema_version:
          const: 2
        type:
          const: quantile_rules
        entry_logic:
          enum:
            - all
            - any
        rules:
          type: array
          minItems: 2
          maxItems: 10
          items:
            oneOf:
              - type: object
                additionalProperties: false
                required:
                  - id
                  - kind
                  - condition
                  - quantile
                properties:
                  id:
                    type: string
                    pattern: ^[a-z][a-z0-9_]{0,39}$
                  kind:
                    const: entry
                  condition:
                    enum:
                      - crosses_above
                      - crosses_below
                      - at_or_above
                      - at_or_below
                  quantile:
                    type: number
                    exclusiveMinimum: 0
                    exclusiveMaximum: 1
              - type: object
                additionalProperties: false
                required:
                  - id
                  - kind
                  - target_mode
                  - quantile
                properties:
                  id:
                    type: string
                    pattern: ^[a-z][a-z0-9_]{0,39}$
                  kind:
                    enum:
                      - take_profit
                      - stop_loss
                  target_mode:
                    const: quantile
                  quantile:
                    type: number
                    exclusiveMinimum: 0
                    exclusiveMaximum: 1
              - type: object
                additionalProperties: false
                required:
                  - id
                  - kind
                  - target_mode
                  - percent
                properties:
                  id:
                    type: string
                    pattern: ^[a-z][a-z0-9_]{0,39}$
                  kind:
                    enum:
                      - take_profit
                      - stop_loss
                  target_mode:
                    const: percent
                  percent:
                    type: number
                    minimum: 0.1
                    maximum: 100
              - type: object
                additionalProperties: false
                required:
                  - id
                  - kind
                  - percent
                properties:
                  id:
                    type: string
                    pattern: ^[a-z][a-z0-9_]{0,39}$
                  kind:
                    const: trailing_stop
                  percent:
                    type: number
                    minimum: 0.1
                    maximum: 90
    ModelSelection:
      type: object
      additionalProperties: false
      required:
        - enabled
        - weight
      properties:
        enabled:
          type: boolean
        weight:
          type: number
          minimum: 0
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Quantura API key

````

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