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

# Store commodity-futures observations.

> Use this operation to publish commodity-futures prices to a writable provider. Each row identifies a
futures contract, using a Bloomberg, RIC, or recognised unspecified namespace, and a date; it can supply
close, settlement, bid, ask, high, low, volume, and currency values. The contract code and market date
determine the expiry used for the accepted row.
Unsupported or ambiguous contracts and duplicate rows for the same identifier/date are reported and skipped;
other valid rows can be stored, and processing completes before return.



## OpenAPI

````yaml /risk-and-pricing/atoti-risk-services/apis-endpoints/openapi/openapi.mintlify.json post /api/MarketData/UploadCmdtyFuturesData
openapi: 3.0.4
info:
  title: Derivitec Api 1.0
  version: '1.0'
servers:
  - url: https://api.riskportal.activeviam.com
security:
  - oauth2: []
  - apikey: []
tags:
  - name: AdminUser
  - name: AtotiReport
  - name: AtotiSession
  - name: BloombergOAuth
  - name: Bond
  - name: BondYieldCurvePage
  - name: BookAccess
  - name: Books
  - name: Commodity
  - name: Counterparties
  - name: Currencies
  - name: Equity
  - name: EquityDividend
  - name: EquityPage
  - name: FeatureFlag
  - name: Fx
  - name: FxPage
  - name: GroupAccess
  - name: Home
  - name: LegacyPosition
  - name: MarketData
  - name: MarketDataProvider
  - name: MarketDataProviderAccess
  - name: Meta
  - name: Notification
  - name: Organisation
  - name: PnLReport
  - name: PortfolioAccess
  - name: Portfolios
  - name: Position
  - name: PositionFilter
  - name: PricingEnvironment
  - name: PricingEnvironmentAccess
  - name: RateAsset
  - name: RateAssetPage
  - name: Report
  - name: ReportDefinition
  - name: ReportHistoryLauncherQuery
  - name: ReportLauncher
  - name: ReportQuery
  - name: ReportQueryViewUser
  - name: ReportRestriction
  - name: ReportView
  - name: RiskReport
  - name: Tradable
  - name: TradeBooking
  - name: User
  - name: VarReport
  - name: VarReportQuery
  - name: YieldCurvePage
paths:
  /api/MarketData/UploadCmdtyFuturesData:
    post:
      tags:
        - MarketData
      summary: Store commodity-futures observations.
      description: >-
        Use this operation to publish commodity-futures prices to a writable
        provider. Each row identifies a

        futures contract, using a Bloomberg, RIC, or recognised unspecified
        namespace, and a date; it can supply

        close, settlement, bid, ask, high, low, volume, and currency values. The
        contract code and market date

        determine the expiry used for the accepted row.

        Unsupported or ambiguous contracts and duplicate rows for the same
        identifier/date are reported and skipped;

        other valid rows can be stored, and processing completes before return.
      operationId: UploadCmdtyFuturesData
      requestBody:
        description: >-
          The upload payload. Provide either `ProviderId` or
          `MarketDataEnvironmentName`, not both; omitting both selects the
          caller's organisation scope. `CmdtyFuturesData` must be non-empty and
          each row supplies a contract identifier, date-only market date,
          prices, currency, and optional volume; a supplied `ExpirationDate` is
          replaced by the date implied by the contract.
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/ApiUploadCmdtyFuturesDataRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/ApiUploadCmdtyFuturesDataRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/ApiUploadCmdtyFuturesDataRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/ApiUploadCmdtyFuturesDataRequest'
      responses:
        '200':
          description: >-
            Returns whether any rows were stored and errors for invalid
            providers, unsupported or ambiguous contracts, duplicate dates, or
            write failures.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiBaseResponseEnvelope'
        '400':
          description: BadRequest
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
      security:
        - oauth2: []
        - apikey: []
components:
  schemas:
    ApiUploadCmdtyFuturesDataRequest:
      required:
        - $type
      type: object
      properties:
        market_data_environment_name:
          type: string
          description: >-
            Name of the market-data environment to use. Supply either this name
            or `provider_id`, not both.
          nullable: true
          example: Example market data
        provider_id:
          type: string
          description: >-
            Opaque identifier of the market-data provider to use. Supply either
            this identifier or `market_data_environment_name`, not both.
          nullable: true
        cmdty_futures_data:
          type: array
          items:
            $ref: '#/components/schemas/CmdtyFuturesData'
          description: Dated commodity-futures observations to upload.
          nullable: true
        $type:
          type: string
          enum:
            - >-
              Derivitec.Web.Core.MarketData.ApiUploadCmdtyFuturesDataRequest,
              Derivitec.Web.Core
      additionalProperties: false
      description: Submits dated commodity-futures observations.
    ApiBaseResponseEnvelope:
      required:
        - $type
      type: object
      properties:
        is_success:
          type: boolean
          description: >-
            Whether the operation completed successfully. The default is `true`;
            error outcomes set it to `false`.
          example: true
        error_messages:
          type: array
          items:
            type: string
          description: >-
            Messages explaining operation-level failures. The collection is
            empty by default.
          nullable: true
        $type:
          type: string
          enum:
            - Derivitec.Web.Core.ApiBaseResponse, Derivitec.Web.Core
      additionalProperties: false
      description: >-
        Common operation outcome containing a success indicator and any error
        messages.
      example:
        $type: Derivitec.Web.Core.ApiBaseResponse, Derivitec.Web.Core
        is_success: true
        error_messages: []
    CmdtyFuturesData:
      required:
        - $type
      type: object
      additionalProperties: false
      description: Commodity-futures market observation.
      properties:
        provider_id:
          type: string
          description: >-
            Market-data provider code recorded as the source of the
            contribution. Defaults to Derivitec.
          nullable: true
        derivitec_created:
          type: string
          description: Timestamp at which the market-data record was created.
        derivitec_modified:
          type: string
          description: Optional timestamp of the record's latest modification.
          nullable: true
        uploaded_date_time:
          type: string
          description: >-
            Optional timestamp at which the contribution was uploaded.
            UploadRateAssets ignores the supplied value on each rate asset and
            stores the current UTC time.
          nullable: true
        derivitec_modified_by:
          type: string
          description: >-
            Principal recorded as the latest modifier. UploadRateAssets ignores
            the supplied value on each rate asset and stores the authenticated
            user identifier.
          nullable: true
        uploaded_by:
          type: string
          description: >-
            Principal recorded as the uploader. UploadRateAssets ignores the
            supplied value on each rate asset and stores the authenticated user
            identifier.
          nullable: true
        rolled:
          type: boolean
          description: Whether the contribution has been rolled.
          example: false
        ask:
          type: number
          description: Optional ask quote for the futures observation.
          format: double
          nullable: true
        bid:
          type: number
          description: Optional bid quote for the futures observation.
          format: double
          nullable: true
        close:
          type: number
          description: Close value for the futures observation.
          format: double
        currency:
          type: string
          description: Currency code carried for the futures observation.
          nullable: true
        date:
          type: string
          description: Market date of the futures observation.
          format: date-time
        expiration_date:
          type: string
          description: Optional expiration date of the futures contract.
          format: date-time
          nullable: true
        high:
          type: number
          description: Optional high value for the futures observation.
          format: double
          nullable: true
        low:
          type: number
          description: Optional low value for the futures observation.
          format: double
          nullable: true
        identifier:
          $ref: '#/components/schemas/InstrumentIdentifier'
        settle:
          type: number
          description: Settlement value for the futures observation.
          format: double
        volume:
          type: number
          description: Optional traded volume for the futures observation.
          format: double
          nullable: true
        futures_market_id:
          type: string
          description: Code of the futures market for the observation.
          nullable: true
        $type:
          type: string
          enum:
            - Derivitec.Web.Core.MarketData.CmdtyFuturesData, Derivitec.Web.Core
    InstrumentIdentifier:
      description: >-
        Instrument code qualified by an identifier namespace and optional market
        code.
      discriminator:
        propertyName: $type
        mapping:
          Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core: '#/components/schemas/InstrumentIdentifierMintlifyShape'
          Derivitec.Web.Core.MarketData.InstrumentInfo, Derivitec.Web.Core: '#/components/schemas/InstrumentInfo'
      oneOf:
        - $ref: '#/components/schemas/InstrumentIdentifierMintlifyShape'
        - $ref: '#/components/schemas/InstrumentInfo'
    InstrumentIdentifierMintlifyShape:
      required:
        - $type
      type: object
      properties:
        code:
          type: string
          description: Instrument code interpreted in the selected identifier namespace.
          nullable: true
        identifier_type:
          enum:
            - Derivitec
            - Ric
            - Bloomberg
            - Isin
            - Figi
            - Sedol
            - RedCode
            - RedPairCode
            - BloombergYellow
            - XIgniteCode
            - CBondsId
            - EdiSecId
            - EdiSymbol
            - Cusip
            - NotSet
          type: string
          description: Namespace that determines how the instrument code is interpreted.
        market_identification_code:
          type: string
          description: >-
            Optional market identification code that further qualifies the
            instrument code.
          nullable: true
        $type:
          type: string
          enum:
            - >-
              Derivitec.Web.Core.MarketData.InstrumentIdentifier,
              Derivitec.Web.Core
      additionalProperties: false
      description: >-
        Instrument code qualified by an identifier namespace and optional market
        code.
    InstrumentInfo:
      required:
        - $type
      type: object
      properties:
        code:
          type: string
          description: Instrument code interpreted in the selected identifier namespace.
          nullable: true
        identifier_type:
          enum:
            - Derivitec
            - Ric
            - Bloomberg
            - Isin
            - Figi
            - Sedol
            - RedCode
            - RedPairCode
            - BloombergYellow
            - XIgniteCode
            - CBondsId
            - EdiSecId
            - EdiSymbol
            - Cusip
            - NotSet
          type: string
          description: Namespace that determines how the instrument code is interpreted.
        market_identification_code:
          type: string
          description: >-
            Optional market identification code that further qualifies the
            instrument code.
          nullable: true
        name:
          type: string
          description: Human-readable name of the identified instrument.
          nullable: true
        $type:
          type: string
          enum:
            - Derivitec.Web.Core.MarketData.InstrumentInfo, Derivitec.Web.Core
      additionalProperties: false
      description: Instrument identifier with a human-readable instrument name.
  securitySchemes:
    oauth2:
      type: oauth2
      description: >-
        OAuth2 access-token requested from AWS Cognito and provided as a Auth
        Bearer header
      flows:
        implicit:
          authorizationUrl: https://auth.riskportal.derivitec.com/oauth2/authorize
          scopes: {}
    apikey:
      type: apiKey
      description: API-Key requested via the site and provided as a header
      name: x-api-key
      in: header

````