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

# Compare

> Use to compare several reports (or configurations) to each other. This endpoint will accept a list
of `report_id` which can also be mixed in with `configuration_id` values and return a data structure
that provides summary results and additional aggregate/change calculations to allow you to see data for
the items in a comparison.

If only one ID is provided, then the endpoint will try to make the comparison against the designated
industry_configuration. If this fails, then data is returned for the single item only with no comparison.

The schema and structure returned by this endpoint varies based on querystring parameters given.



## OpenAPI

````yaml api-reference/openapi.yaml post /api/v1/reports/compare/
openapi: 3.0.3
info:
  title: API v1 Public
  version: 1.4.2
  description: >+


    Apex API functions and available endpoints.


    To authenticate, use the `Token` value from the `auth/login` endpoint in the
    Authorize dialog.

  license:
    name: Proprietary to Emotive Technologies Inc.
servers:
  - url: https://api.main.apexscore.ai
security: []
paths:
  /api/v1/reports/compare/:
    post:
      tags:
        - Reports
      summary: Compare
      description: >-
        Use to compare several reports (or configurations) to each other. This
        endpoint will accept a list

        of `report_id` which can also be mixed in with `configuration_id` values
        and return a data structure

        that provides summary results and additional aggregate/change
        calculations to allow you to see data for

        the items in a comparison.


        If only one ID is provided, then the endpoint will try to make the
        comparison against the designated

        industry_configuration. If this fails, then data is returned for the
        single item only with no comparison.


        The schema and structure returned by this endpoint varies based on
        querystring parameters given.
      operationId: reports_compare_create
      parameters:
        - in: query
          name: group_configurations_by
          schema:
            type: string
            enum:
              - issued_at
              - portfolio
          description: >-
            Group lists of comparison items by one of their fields. This
            grouping is secondary to the `separate_portfolios` setting.
        - in: query
          name: only_latest
          schema:
            type: boolean
            default: false
          description: >-
            Set to true to only return the latest configuration in the resulting
            data, for when you only care about the most recent
            results/comparison.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportCompareRequest'
            examples:
              SimpleRequest:
                value:
                  comparison_ids:
                    - d561a959-7ee2-44c1-87ad-a497d5b51ee1
                    - a9853aca-542d-4126-bb08-757da33a6b96
                summary: Simple Request
                description: >-
                  A simple request to compare a report ID value and two
                  configuration ID values.
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportCompareResponse'
          description: ''
      security:
        - tokenAuth: []
components:
  schemas:
    ReportCompareRequest:
      type: object
      description: >-
        The REQUEST serializer that takes a list of either Report IDs or
        Configuration IDs to compare.


        The serializer preps all the objects to be compared and stores them in
        the `configurations` field.
      properties:
        comparison_ids:
          type: array
          items:
            type: string
            format: uuid
          description: >-
            Specify either Report IDs or Configuration IDs that should be used
            in the comparison. If an ID passed does not exist or the user does
            not have access, it will be ignored from the comparison.
        save_name:
          type: string
      required:
        - comparison_ids
    ReportCompareResponse:
      type: object
      description: >-
        This serializer represents the parent container and information for all
        configurations that are being

        compared.


        It will contain some over-arching data about the comparison and then a
        list of `ReportCompareConfigurationResponseSerializer`
      properties:
        portfolio:
          $ref: '#/components/schemas/Portfolio'
        configurations:
          type: array
          items:
            $ref: '#/components/schemas/ReportCompareConfigurationResponse'
          readOnly: true
          description: >-
            If a group_by is requested, this field will be returned as a
            dictionary of `groupby_key:
            [ReportCompareConfigurationResponseSerializer]` instead of a flat
            list.
        largest_apex_reached:
          type: string
          readOnly: true
        avg_attitude_importance:
          type: string
          readOnly: true
        avg_attitude_performance:
          type: string
          readOnly: true
      required:
        - avg_attitude_importance
        - avg_attitude_performance
        - configurations
        - largest_apex_reached
    Portfolio:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
      required:
        - id
    ReportCompareConfigurationResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          description: Choose a name for this set to refer to
          maxLength: 250
        is_primary:
          type: boolean
        portfolio:
          $ref: '#/components/schemas/Portfolio'
        report:
          $ref: '#/components/schemas/Report'
        mona_version:
          $ref: '#/components/schemas/Version'
        compared_with_configuration:
          allOf:
            - $ref: '#/components/schemas/DatasetConfiguration'
          readOnly: true
        result:
          allOf:
            - $ref: '#/components/schemas/ReportCompareConfigurationResultResponse'
          readOnly: true
      required:
        - compared_with_configuration
        - id
        - mona_version
        - portfolio
        - report
        - result
    Report:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
        issued_at:
          type: string
          format: date-time
        survey_start_date:
          type: string
          format: date
        survey_end_date:
          type: string
          format: date
      required:
        - id
        - name
    Version:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          readOnly: true
        audience:
          type: string
        audience_type:
          allOf:
            - $ref: '#/components/schemas/AudienceTypeEnum'
          default: 1
          minimum: -2147483648
          maximum: 2147483647
        sequence:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
      required:
        - audience
        - id
        - name
        - sequence
    DatasetConfiguration:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        report_name:
          type: string
          readOnly: true
        report_issued_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - id
        - report_issued_at
        - report_name
    ReportCompareConfigurationResultResponse:
      type: object
      properties:
        apex_score:
          type: number
          format: double
          maximum: 1000000
          minimum: -1000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        potential_apex_score:
          type: number
          format: double
          maximum: 1000000
          minimum: -1000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        population_size:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          nullable: true
          description: >-
            The total number of respondents. Will be auto-populated or
            overwritten.
        rank:
          $ref: '#/components/schemas/Rank'
        opportunity_driver_categories:
          type: string
          readOnly: true
        fba:
          type: string
          readOnly: true
        ppp:
          type: string
          readOnly: true
        benchmark:
          type: object
          additionalProperties: {}
        attitudes:
          type: object
          additionalProperties: {}
          readOnly: true
      required:
        - apex_score
        - attitudes
        - benchmark
        - fba
        - opportunity_driver_categories
        - potential_apex_score
        - ppp
        - rank
    AudienceTypeEnum:
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
      type: integer
      description: |-
        * `0` - None
        * `1` - Customers
        * `2` - Employees
        * `3` - Donors
        * `4` - Media
        * `5` - Gathering 2024 Lecturees
    Rank:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 25
        description:
          type: string
        minimum_differential:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          description: >-
            The minimum difference (%) between a segment's score and potential
            score needed to qualify for this rank, expressed as percentage
        audience_type:
          type: integer
        mona_version:
          type: integer
      required:
        - audience_type
        - description
        - id
        - minimum_differential
        - mona_version
        - name
  securitySchemes:
    tokenAuth:
      type: http
      scheme: bearer

````