> ## 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 counterparty import workbook.

> Examines one counterparty workbook before any counterparty changes are applied. Review the returned
parsed rows, warnings, errors, and table messages before choosing to import. Workbook validity is reported
by `ParsedFileData.Valid`; a validation finding can be returned in a successful outer envelope.
This synchronous operation does not create, amend, or delete counterparties.



## OpenAPI

````yaml /risk-and-pricing/atoti-risk-services/apis-endpoints/openapi/openapi.mintlify.json post /api/Counterparties/ValidateImport
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/Counterparties/ValidateImport:
    post:
      tags:
        - Counterparties
      summary: Validate a counterparty import workbook.
      description: >-
        Examines one counterparty workbook before any counterparty changes are
        applied. Review the returned

        parsed rows, warnings, errors, and table messages before choosing to
        import. Workbook validity is reported

        by `ParsedFileData.Valid`; a validation finding can be returned in a
        successful outer envelope.

        This synchronous operation does not create, amend, or delete
        counterparties.
      operationId: ValidateImport
      requestBody:
        description: >-
          JSON request with `FileName` and required `FileData` as a data URL in
          the form `data:<media-type>[;base64],<payload>`. Base64 and
          URL-encoded payloads are accepted, and the workbook media type is
          `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`.
          No file-size limit is declared.
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/CounterpartyUploadValidationRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/CounterpartyUploadValidationRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/CounterpartyUploadValidationRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/CounterpartyUploadValidationRequest'
      responses:
        '200':
          description: >-
            Returns parsed workbook rows, validation messages, and the
            file-validity result; malformed file data can be returned in an
            unsuccessful envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CounterpartyUploadValidationResponse'
        '400':
          description: BadRequest
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
      security:
        - oauth2: []
        - apikey: []
components:
  schemas:
    CounterpartyUploadValidationRequest:
      required:
        - $type
      type: object
      properties:
        file_name:
          type: string
          description: Name supplied for the uploaded counterparty import file.
          nullable: true
        file_data:
          type: string
          description: Data URL containing the uploaded counterparty import file contents.
          nullable: true
        $type:
          type: string
          enum:
            - >-
              Derivitec.Core.Mediators.Upload.Counterparties.CounterpartyUploadValidationRequest,
              Derivitec.Core.Mediators
      additionalProperties: false
      description: Request to validate an uploaded counterparty import file.
    CounterpartyUploadValidationResponse:
      required:
        - $type
      type: object
      properties:
        parsed_file_data:
          $ref: '#/components/schemas/CounterpartyParsedFileDataLite'
        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.Counterparties.CounterpartyUploadValidationResponse,
              Derivitec.Core.Mediators
      additionalProperties: false
      description: >-
        Response containing parsed counterparty import data and validation
        findings.
    CounterpartyParsedFileDataLite:
      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.
        counterparty_infos:
          type: array
          items:
            $ref: '#/components/schemas/CounterpartyInfoImportViewModel'
          description: Counterparty import entries obtained from the parsed file.
          nullable: true
        parse_warnings_lite:
          type: array
          items:
            $ref: '#/components/schemas/ParseErrorLite'
          description: Compact parsing warnings for the counterparty file.
          nullable: true
        parse_errors_lite:
          type: array
          items:
            $ref: '#/components/schemas/ParseErrorLite'
          description: Compact parsing errors for the counterparty file.
          nullable: true
        $type:
          type: string
          enum:
            - >-
              Derivitec.Web.Models.CounterpartyParsedFileDataLite,
              Derivitec.Web.Models
      additionalProperties: false
      description: Parsed counterparty-file result with compact errors and warnings.
    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.
    CounterpartyInfoImportViewModel:
      required:
        - $type
      type: object
      properties:
        cash:
          type: number
          description: Cash held or received for the counterparty record.
          format: double
        classification:
          type: string
          description: Classification assigned to the counterparty record.
          nullable: true
        country:
          type: string
          description: Country associated with the counterparty record.
          nullable: true
        credit:
          type: number
          description: Credit line extended or received for the counterparty record.
          format: double
        currency:
          type: string
          description: Currency associated with the counterparty record.
          nullable: true
        date:
          type: string
          description: Date associated with the counterparty record.
          format: date-time
        desk:
          type: string
          description: Desk associated with the counterparty record.
          nullable: true
        identifier:
          type: string
          description: Counterparty identifier.
          nullable: true
        initial_margin:
          type: number
          description: Initial-margin value for the counterparty record.
          format: double
        initial_margin_requested:
          type: number
          description: Requested initial-margin value for the counterparty record.
          format: double
        is_checked:
          type: boolean
          description: Whether this counterparty is marked as checked in the current view.
        legal_entity_identifier:
          type: string
          description: Legal-entity identifier associated with the counterparty.
          nullable: true
        limit:
          type: number
          description: Limit value for the counterparty record.
          format: double
        margin_call_level:
          type: number
          description: Margin-call-level value for the counterparty record.
          format: double
        margin_step:
          type: number
          description: Margin-step value for the counterparty record.
          format: double
        margin_type:
          enum:
            - absolute
            - relative
            - not_set
          type: string
          description: Interpretation used for margin values.
        name:
          type: string
          description: Counterparty display name.
          nullable: true
        notional:
          type: number
          description: Notional value for the counterparty record.
          format: double
        notional_options:
          type: number
          description: Notional value recorded for options.
          format: double
        organisation_id:
          type: string
          description: Identifier of the organisation associated with the counterparty.
          nullable: true
        parent_entity:
          type: string
          description: Parent entity associated with the counterparty.
          nullable: true
        type:
          enum:
            - bank
            - customer
            - adjustment
          type: string
          description: Counterparty classification type.
        max_credit:
          type: number
          description: Maximum-credit value for the counterparty record.
          format: double
        credit_pct:
          type: number
          description: Credit percentage for the counterparty record.
          format: double
        initial_margin_pct:
          type: number
          description: Initial-margin percentage for the counterparty record.
          format: double
        limit_pct:
          type: number
          description: Limit percentage for the counterparty record.
          format: double
        variation_margin:
          type: number
          description: Variation-margin value for the counterparty record.
          format: double
        variation_margin_pct:
          type: number
          description: Variation-margin percentage for the counterparty record.
          format: double
        string_label1:
          type: string
          description: First supplementary text label for the counterparty record.
          nullable: true
        string_label2:
          type: string
          description: Second supplementary text label for the counterparty record.
          nullable: true
        string_label3:
          type: string
          description: Third supplementary text label for the counterparty record.
          nullable: true
        action:
          type: string
          description: 'Import action: NEW or AMEND.'
          nullable: true
        amend_cash:
          type: boolean
          description: Whether the import amends the cash value.
        amend_classification:
          type: boolean
          description: Whether the import amends the classification.
        amend_country:
          type: boolean
          description: Whether the import amends the country.
        amend_credit:
          type: boolean
          description: Whether the import amends the credit value.
        amend_currency:
          type: boolean
          description: Whether the import amends the currency.
        amend_date:
          type: boolean
          description: Whether the import amends the date.
        amend_desk:
          type: boolean
          description: Whether the import amends the desk.
        amend_initial_margin:
          type: boolean
          description: Whether the import amends the initial-margin value.
        amend_initial_margin_requested:
          type: boolean
          description: Whether the import amends the requested initial-margin value.
        amend_legal_entity_identifier:
          type: boolean
          description: Whether the import amends the legal-entity identifier.
        amend_limit:
          type: boolean
          description: Whether the import amends the limit value.
        amend_margin_call_level:
          type: boolean
          description: Whether the import amends the margin-call-level value.
        amend_margin_step:
          type: boolean
          description: Whether the import amends the margin-step value.
        amend_margin_type:
          type: boolean
          description: Whether the import amends the margin interpretation.
        amend_name:
          type: boolean
          description: Whether the import amends the counterparty name.
        amend_notional:
          type: boolean
          description: Whether the import amends the notional value.
        amend_notional_options:
          type: boolean
          description: Whether the import amends the options notional value.
        amend_parent_entity:
          type: boolean
          description: Whether the import amends the parent entity.
        amend_max_credit:
          type: boolean
          description: Whether the import amends the maximum-credit value.
        amend_credit_pct:
          type: boolean
          description: Whether the import amends the credit percentage.
        amend_initial_margin_pct:
          type: boolean
          description: Whether the import amends the initial-margin percentage.
        amend_limit_pct:
          type: boolean
          description: Whether the import amends the limit percentage.
        amend_variation_margin:
          type: boolean
          description: Whether the import amends the variation-margin value.
        amend_variation_margin_pct:
          type: boolean
          description: Whether the import amends the variation-margin percentage.
        amend_string_label1:
          type: boolean
          description: Whether the import amends the first supplementary text label.
        amend_string_label2:
          type: boolean
          description: Whether the import amends the second supplementary text label.
        amend_string_label3:
          type: boolean
          description: Whether the import amends the third supplementary text label.
        $type:
          type: string
          enum:
            - >-
              Derivitec.Web.Models.CounterpartyInfoImportViewModel,
              Derivitec.Web.Models
      additionalProperties: false
      description: Counterparty information together with requested import amendments.
    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
  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

````