> ## 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.

# Validate a position-import workbook.

> Begins the workbook workflow by examining one submitted position file without applying its position changes. The result includes validity, workbook messages, books that would need creation, and a validation-context identifier for the row-inspection and import actions. Validation finishes before the response; no background job is created.



## OpenAPI

````yaml /risk-and-pricing/atoti-risk-services/apis-endpoints/openapi/openapi.mintlify.json post /api/Position/ValidatePositionImport
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/Position/ValidatePositionImport:
    post:
      tags:
        - Position
      summary: Validate a position-import workbook.
      description: >-
        Begins the workbook workflow by examining one submitted position file
        without applying its position changes. The result includes validity,
        workbook messages, books that would need creation, and a
        validation-context identifier for the row-inspection and import actions.
        Validation finishes before the response; no background job is created.
      operationId: ValidatePositionImport
      requestBody:
        description: >-
          JSON request with `FileName` identifying the workbook and `FileData`
          as a data URL in the form `data:<media-type>[;base64],<payload>`.
          Base64 and URL-encoded payloads are accepted; no size or media-type
          limit is stated here.
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PositionUploadValidationRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/PositionUploadValidationRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/PositionUploadValidationRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/PositionUploadValidationRequest'
      responses:
        '200':
          description: Returns the parsed-file summary and its `ParseFileDataContextId`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PositionUploadValidationResponse'
        '400':
          description: BadRequest
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
      security:
        - oauth2: []
        - apikey: []
components:
  schemas:
    PositionUploadValidationRequest:
      required:
        - $type
      type: object
      properties:
        file_name:
          type: string
          description: Name supplied for the uploaded position import file.
          nullable: true
        file_data:
          type: string
          description: Data URL containing the uploaded position import file contents.
          nullable: true
        $type:
          type: string
          enum:
            - >-
              Derivitec.Core.Mediators.Upload.Positions.PositionUploadValidationRequest,
              Derivitec.Core.Mediators
      additionalProperties: false
      description: Request to validate an uploaded position import file.
    PositionUploadValidationResponse:
      required:
        - $type
      type: object
      properties:
        parsed_file_data:
          $ref: '#/components/schemas/PositionParsedFileData'
        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.Core.Mediators.Upload.Positions.PositionUploadValidationResponse,
              Derivitec.Core.Mediators
      additionalProperties: false
      description: >-
        Response containing the validated position-import summary and its
        validation-context identifier.
    PositionParsedFileData:
      description: Parsed position-import result, including proposed position effects.
      discriminator:
        propertyName: $type
        mapping:
          Derivitec.Web.Models.PositionUpload.PositionParsedFileData, Derivitec.Web.Models: '#/components/schemas/PositionParsedFileDataMintlifyShape'
          Derivitec.Web.Models.PositionUpload.PositionParsedFileDataLite, Derivitec.Web.Models: '#/components/schemas/PositionParsedFileDataLite'
      oneOf:
        - $ref: '#/components/schemas/PositionParsedFileDataMintlifyShape'
        - $ref: '#/components/schemas/PositionParsedFileDataLite'
    PositionParsedFileDataMintlifyShape:
      required:
        - $type
      type: object
      properties:
        file_name:
          type: string
          description: Name of the parsed input file.
          nullable: true
        id:
          type: string
          description: Identifier associated with the parsed-file result.
          nullable: true
        message:
          type: string
          description: Overall message for the parsed-file result.
          nullable: true
        parse_errors:
          type: array
          items:
            $ref: '#/components/schemas/ParseError'
          description: Parsing errors reported for the file.
          nullable: true
        parse_warnings:
          type: array
          items:
            $ref: '#/components/schemas/ParseError'
          description: Parsing warnings reported for the file.
          nullable: true
        table_messages:
          type: object
          additionalProperties:
            type: string
          description: Messages keyed by source table.
        valid:
          type: boolean
          description: Whether the parsed-file result is valid.
        amended_position_effects:
          type: array
          items:
            $ref: '#/components/schemas/PositionEffectViewModel'
          description: Proposed effects for amended positions.
          nullable: true
        books_to_be_created:
          type: array
          items:
            $ref: '#/components/schemas/BookCreateViewModel'
          description: Books that the validated import indicates would be created.
          nullable: true
        closed_position_effects:
          type: array
          items:
            $ref: '#/components/schemas/PositionEffectViewModel'
          description: Proposed effects for closed positions.
          nullable: true
        deleted_position_effects:
          type: array
          items:
            $ref: '#/components/schemas/PositionEffectViewModel'
          description: Proposed effects for deleted positions.
          nullable: true
        position_effects:
          type: array
          items:
            $ref: '#/components/schemas/PositionEffectViewModel'
          description: Proposed position effects from the parsed import.
          nullable: true
        restored_position_effects:
          type: array
          items:
            $ref: '#/components/schemas/PositionEffectViewModel'
          description: Proposed effects for restored positions.
          nullable: true
        tradable_view_models:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/TradableViewModel'
          description: Tradable view models indexed by string key.
          nullable: true
        custom_column_mappings:
          type: array
          items:
            $ref: '#/components/schemas/StringStringKeyValuePair'
          description: >-
            Custom source-column association pairs included with the parsed
            import.
          nullable: true
        parse_file_data_context_id:
          type: string
          description: >-
            Validation-context identifier returned for this parsed position
            import.
          format: uuid
        $type:
          type: string
          enum:
            - >-
              Derivitec.Web.Models.PositionUpload.PositionParsedFileData,
              Derivitec.Web.Models
      additionalProperties: false
      description: Parsed position-import result, including proposed position effects.
    PositionParsedFileDataLite:
      required:
        - $type
      type: object
      properties:
        file_name:
          type: string
          description: Name of the parsed input file.
          nullable: true
        id:
          type: string
          description: Identifier associated with the parsed-file result.
          nullable: true
        message:
          type: string
          description: Overall message for the parsed-file result.
          nullable: true
        parse_errors:
          type: array
          items:
            $ref: '#/components/schemas/ParseError'
          description: Parsing errors reported for the file.
          nullable: true
        parse_warnings:
          type: array
          items:
            $ref: '#/components/schemas/ParseError'
          description: Parsing warnings reported for the file.
          nullable: true
        table_messages:
          type: object
          additionalProperties:
            type: string
          description: Messages keyed by source table.
        valid:
          type: boolean
          description: Whether the parsed-file result is valid.
        amended_position_effects:
          type: array
          items:
            $ref: '#/components/schemas/PositionEffectViewModel'
          description: Proposed effects for amended positions.
          nullable: true
        books_to_be_created:
          type: array
          items:
            $ref: '#/components/schemas/BookCreateViewModel'
          description: Books that the validated import indicates would be created.
          nullable: true
        closed_position_effects:
          type: array
          items:
            $ref: '#/components/schemas/PositionEffectViewModel'
          description: Proposed effects for closed positions.
          nullable: true
        deleted_position_effects:
          type: array
          items:
            $ref: '#/components/schemas/PositionEffectViewModel'
          description: Proposed effects for deleted positions.
          nullable: true
        position_effects:
          type: array
          items:
            $ref: '#/components/schemas/PositionEffectViewModel'
          description: Proposed position effects from the parsed import.
          nullable: true
        restored_position_effects:
          type: array
          items:
            $ref: '#/components/schemas/PositionEffectViewModel'
          description: Proposed effects for restored positions.
          nullable: true
        tradable_view_models:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/TradableViewModel'
          description: Tradable view models indexed by string key.
          nullable: true
        custom_column_mappings:
          type: array
          items:
            $ref: '#/components/schemas/StringStringKeyValuePair'
          description: >-
            Custom source-column association pairs included with the parsed
            import.
          nullable: true
        parse_file_data_context_id:
          type: string
          description: >-
            Validation-context identifier returned for this parsed position
            import.
          format: uuid
        parse_warnings_lite:
          type: array
          items:
            $ref: '#/components/schemas/ParseErrorLite'
          nullable: true
        parse_errors_lite:
          type: array
          items:
            $ref: '#/components/schemas/ParseErrorLite'
          nullable: true
        $type:
          type: string
          enum:
            - >-
              Derivitec.Web.Models.PositionUpload.PositionParsedFileDataLite,
              Derivitec.Web.Models
      additionalProperties: false
      description: The parsed file data.
    ParseError:
      required:
        - $type
      type: object
      properties:
        error_column:
          type: string
          description: >-
            First source-column name associated with the finding, or an empty
            string when there are no error columns.
          nullable: true
          readOnly: true
        error_columns:
          type: array
          items:
            type: string
          description: >-
            Source-column names associated with the finding. The collection is
            empty by default.
          nullable: true
        message:
          type: string
          description: Message explaining the parsing or validation finding.
          nullable: true
        row:
          $ref: '#/components/schemas/DataRow'
        tab:
          type: string
          description: Name of the source worksheet or tab associated with the finding.
          nullable: true
        error_level:
          enum:
            - error
            - warning
          type: string
          description: Severity assigned to the parsing finding.
        $type:
          type: string
          enum:
            - Derivitec.Web.Core.ParseError, Derivitec.Web.Core
      additionalProperties: false
      description: Parsing finding retaining the raw source row and its worksheet context.
    PositionEffectViewModel:
      required:
        - $type
      type: object
      properties:
        book_id:
          type: integer
          description: Numeric Risk Portal book key assigned to the position change.
          format: int32
        book_name:
          type: string
          description: Name of the book receiving the position change.
          nullable: true
        client_transaction_id:
          type: string
          description: >-
            Caller-supplied transaction reference carried through validation and
            import.
          nullable: true
        contract_size:
          type: number
          description: >-
            Optional contract-size value supplied for this position change; no
            universal unit is defined.
          format: double
          nullable: true
        counterparty:
          type: string
          description: Counterparty label carried with the position change.
          nullable: true
        deleted:
          type: boolean
          description: Whether this view represents a deleted position effect.
        display_name:
          type: string
          description: User-facing label for the proposed position change.
          nullable: true
        id:
          type: integer
          description: Numeric position-effect key used to relate labels to this change.
          format: int32
        is_checked:
          type: boolean
          description: Client selection state for this proposed position change.
        leg:
          type: string
          description: Caller-provided leg label within a multi-leg trade structure.
          nullable: true
        position_effects_label_values:
          type: array
          items:
            $ref: '#/components/schemas/PositionEffectsLabelValueViewModel'
          description: >-
            Additional typed position metadata represented as label identifiers
            and text values.
          nullable: true
        quantity:
          type: number
          description: >-
            Position quantity produced or changed by this effect; this contract
            defines no universal unit.
          format: double
        structure:
          type: string
          description: Caller-provided grouping label for a multi-leg trade structure.
          nullable: true
        tool_tip:
          type: string
          description: >-
            Supplementary user-facing explanation for this proposed position
            change.
          nullable: true
        tradable_identifier:
          type: string
          description: Risk Portal tradable reference resolved for the position change.
          nullable: true
        tradable_type:
          type: string
          description: Product classification displayed for the resolved tradable.
          nullable: true
        trade_action:
          type: string
          description: >-
            Requested lifecycle action for the position, such as an amendment,
            deletion, close, or restoration.
          nullable: true
        upload_tradable_id_to_enfusion:
          type: boolean
          description: >-
            Whether the resolved Risk Portal tradable reference should be
            written back to the Enfusion position.
        $type:
          type: string
          enum:
            - >-
              Derivitec.Web.Core.Positions.PositionEffectViewModel,
              Derivitec.Web.Core
      additionalProperties: false
      description: >-
        One proposed or imported position change with book, tradable, quantity,
        action, and display metadata.
    BookCreateViewModel:
      required:
        - $type
        - description
        - name
      type: object
      properties:
        description:
          maxLength: 100
          minLength: 2
          type: string
          description: Required book description containing between 2 and 100 characters.
        name:
          maxLength: 100
          minLength: 2
          type: string
          description: Required book name containing between 2 and 100 characters.
          example: Example book
        parent_portfolio_ids:
          type: array
          items:
            type: integer
            format: int32
          description: >-
            Numeric Risk Portal portfolio identifiers to link as initial
            parents; the collection is initialised empty.
          nullable: true
        $type:
          type: string
          enum:
            - Derivitec.Web.Core.Book.BookCreateViewModel, Derivitec.Web.Core
      additionalProperties: false
      description: >-
        Validated book details and initial parent-portfolio links used during
        book creation.
    TradableViewModel:
      required:
        - $type
      type: object
      properties:
        contract_type:
          type: string
          description: Display classification of the tradable's contract.
          nullable: true
        currency:
          type: string
          description: >-
            Currency displayed for the tradable; code standard is not defined
            here.
          nullable: true
        display_name:
          type: string
          description: Human-readable name displayed for the tradable.
          nullable: true
        error_message:
          type: string
          description: >-
            Diagnostic displayed when the tradable's calculation or retrieval is
            unsuccessful.
          nullable: true
        id:
          type: integer
          description: Integer row identity assigned to the displayed tradable.
          format: int32
        identifier:
          type: string
          description: >-
            Tradable reference displayed to the user; namespace is not defined
            here.
          default: ''
          nullable: true
        market_date:
          type: string
          description: Market-data date used for the displayed valuation.
          format: date-time
        pricing_details_model:
          $ref: '#/components/schemas/PricingDetailsModel'
        quantity:
          type: number
          description: Position quantity represented by the displayed tradable.
          format: double
        quantity_round_to_nearest:
          type: number
          description: Increment used when rounding the displayed tradable quantity.
          format: double
        results:
          description: Tabular calculation results displayed for the tradable.
          type: array
          items:
            type: object
            additionalProperties: true
          nullable: true
        tradable_risk_data:
          $ref: '#/components/schemas/TradableRiskDataModel'
        client_security_id:
          type: string
          description: >-
            Client-supplied security reference displayed for the tradable;
            namespace is not defined here.
          nullable: true
        show_live_data_refresh:
          type: boolean
          description: >-
            Whether the presentation should offer a live-data refresh for the
            tradable.
        live_data_snapshot_time:
          type: string
          description: >-
            Timestamp of the live-data snapshot shown with the tradable;
            timezone semantics are not defined here.
          format: date-time
        $type:
          type: string
          enum:
            - Derivitec.Web.Core.Tradables.TradableViewModel, Derivitec.Web.Core
      additionalProperties: false
      description: >-
        Abstract presentation shape combining a tradable's identity, quantity,
        valuation dates, pricing details, results, and risk data.
    StringStringKeyValuePair:
      type: object
      properties:
        key:
          type: string
          nullable: true
        value:
          type: string
          nullable: true
      additionalProperties: false
    ParseErrorLite:
      required:
        - $type
      type: object
      properties:
        item_array:
          type: array
          items: {}
          description: Source row values associated with the diagnostic.
          nullable: true
        message:
          type: string
          description: Human-readable parse diagnostic message.
          nullable: true
          example: Input value is invalid.
        error_column:
          type: string
          description: Source column associated with the diagnostic.
          nullable: true
        tab:
          type: string
          description: Source worksheet associated with the diagnostic.
          nullable: true
        table_headers:
          type: array
          items:
            type: string
          description: Source table header values associated with the diagnostic.
          nullable: true
        $type:
          type: string
          enum:
            - Derivitec.Web.Models.ParseErrorLite, Derivitec.Web.Models
      additionalProperties: false
      description: Compact parse diagnostic for an input-table cell or row.
    DataRow:
      type: object
      properties:
        row_error:
          type: string
          nullable: true
        row_state:
          enum:
            - detached
            - unchanged
            - added
            - deleted
            - modified
          type: string
          readOnly: true
        table:
          nullable: true
          readOnly: true
        item_array:
          type: array
          items: {}
          nullable: true
        has_errors:
          type: boolean
          readOnly: true
      additionalProperties: false
    PositionEffectsLabelValueViewModel:
      required:
        - $type
      type: object
      properties:
        field:
          type: string
          description: Lower-case field key derived from the position-effect label.
          nullable: true
          readOnly: true
        label_id:
          type: integer
          description: >-
            Numeric discriminator identifying which position metadata label the
            value represents.
          format: int32
        position_effect_id:
          type: integer
          description: Numeric position-effect key to which this metadata value belongs.
          format: int32
        value:
          type: string
          description: Text representation of the metadata value.
          nullable: true
        $type:
          type: string
          enum:
            - >-
              Derivitec.Web.Core.Positions.PositionEffectsLabelValueViewModel,
              Derivitec.Web.Core
      additionalProperties: false
      description: >-
        One additional metadata value linked to a position effect by a typed
        label.
    PricingDetailsModel:
      required:
        - $type
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/KeyValuePairViewModel'
          description: >-
            Named pricing-detail values returned for display. The collection is
            empty by default.
          nullable: true
        error_message:
          type: string
          description: >-
            Message explaining why pricing details could not be produced. The
            default is an empty string.
          nullable: true
        $type:
          type: string
          enum:
            - Derivitec.Web.Core.PricingDetailsModel, Derivitec.Web.Core
      additionalProperties: false
      description: >-
        Collection of display-ready pricing details with an optional overall
        error message.
    TradableRiskDataModel:
      required:
        - $type
      type: object
      properties:
        error_message:
          type: string
          description: >-
            Diagnostic explaining why unit-risk data could not be produced, when
            applicable.
          nullable: true
        unit_risks:
          type: array
          items:
            $ref: '#/components/schemas/KeyValuePairViewModel'
          description: Named unit-risk values calculated for the tradable.
          nullable: true
        $type:
          type: string
          enum:
            - >-
              Derivitec.Web.Core.Tradables.TradableRiskDataModel,
              Derivitec.Web.Core
      additionalProperties: false
      description: Unit-risk values and an optional diagnostic for one tradable.
    KeyValuePairViewModel:
      required:
        - $type
      type: object
      properties:
        error_message:
          type: string
          description: >-
            Message explaining why the named value could not be produced. The
            default is an empty string.
          nullable: true
        format_string:
          type: string
          description: >-
            Client display-format pattern for the returned value, or null when
            no pattern is supplied.
          nullable: true
        key:
          type: string
          description: Label identifying the returned value.
          nullable: true
        scales_by_qty:
          type: boolean
          description: >-
            Whether the returned value is intended to scale with position
            quantity. The default is `false`.
          example: false
        value:
          description: >-
            Returned value associated with the label. Interpret its presentation
            using the accompanying format, currency, and scaling fields when
            populated.
          oneOf:
            - type: string
              nullable: true
            - type: number
            - type: boolean
            - type: array
              items: {}
            - type: object
              additionalProperties: true
        currency:
          type: string
          description: >-
            Currency associated with the returned value, or an empty string when
            no currency is supplied.
          nullable: true
        $type:
          type: string
          enum:
            - Derivitec.Web.Core.KeyValuePairViewModel, Derivitec.Web.Core
      additionalProperties: false
      description: >-
        Display-ready named value with optional formatting, currency,
        quantity-scaling, and error context.
  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

````