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

# Get removed consumptions (depending on the provided site and filters)

> This API returns :
- a filtered list of removed consumptions
- a list of removals aggregations by type of challenge




## OpenAPI

````yaml /api-reference/green-actions.yaml get /sites/{site-id}/removed-consumptions
openapi: 3.0.1
info:
  title: Challenges lifecycle
  description: >
    This API manages the lifecycles of the challenges, the actions and the user
    engagements.
  termsOfService: ''
  version: 1.0.x
servers:
  - url: https://api.home.datanumia.com/api/v1
security: []
paths:
  /sites/{site-id}/removed-consumptions:
    get:
      tags:
        - RemovedConsumptions
      summary: Get removed consumptions (depending on the provided site and filters)
      description: |
        This API returns :
        - a filtered list of removed consumptions
        - a list of removals aggregations by type of challenge
      operationId: getRemovedConsumptions
      parameters:
        - name: site-id
          in: path
          description: The site identifier
          required: true
          schema:
            type: string
        - name: minBeginTs
          in: query
          description: The minimal begin date, format ISO8601 (YYYY-MM-DDThh:mm:ssZ)
          schema:
            type: string
        - name: maxBeginTs
          in: query
          description: The maximal begin date, format ISO8601 (YYYY-MM-DDThh:mm:ssZ)
          schema:
            type: string
        - name: minEndTs
          in: query
          description: The minimal end date, format ISO8601 (YYYY-MM-DDThh:mm:ssZ)
          schema:
            type: string
        - name: maxEndTs
          in: query
          description: The maximal end date, format ISO8601 (YYYY-MM-DDThh:mm:ssZ)
          schema:
            type: string
        - name: challengeType
          in: query
          description: The challenge type
          schema:
            $ref: '#/components/schemas/ChallengeType'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetRemovedConsumptionsResponse'
        '400':
          description: Functional Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
        '500':
          description: Technical Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
components:
  schemas:
    ChallengeType:
      type: string
      enum:
        - PEAK_DAY
        - REWARD_DAY
        - SHIFT_DAY
        - PERIOD
        - MARATHON
        - SPRINT
        - VARIATION_CONSUMPTION_DAY
        - REDUCE_CONSUMPTION_DAY
        - OVER_CONSUMPTION_DAY
    GetRemovedConsumptionsResponse:
      required:
        - units
        - removedConsumptions
        - aggregations
      properties:
        units:
          allOf:
            - $ref: '#/components/schemas/ConsumptionUnits'
            - type: object
              properties:
                reward:
                  type: string
                  default: EUR
        removedConsumptions:
          minItems: 0
          type: array
          description: The list of removed consumptions
          items:
            $ref: '#/components/schemas/RemovedConsumption'
        aggregations:
          minItems: 0
          type: array
          description: The list of removals aggregated by challenge type
          items:
            $ref: '#/components/schemas/Aggregation'
    ProblemDetail:
      required:
        - type
        - status
      properties:
        type:
          type: object
        title:
          type: string
          description: The problem title
        status:
          type: integer
          description: The problem status
        detail:
          type: string
          description: The problem detail
        instance:
          type: object
          description: The problem instance. By default, the request path
        properties:
          type: object
          description: A generic map of properties
      description: Representation for an RFC 7807 problem detail
    ConsumptionUnits:
      description: Units by type of consumption
      required:
        - energyMeter
        - cost
      properties:
        energyMeter:
          type: string
          default: KWH
        cost:
          type: string
          default: EUR
    RemovedConsumption:
      required:
        - beginTs
        - challengeId
        - challengeType
        - endTs
        - forecastConsumption
        - generationTs
        - realConsumption
        - removedConsumption
        - status
      properties:
        beginTs:
          type: string
          format: date-time
          description: The first consumptions date, format ISO8601 (YYYY-MM-DDThh:mm:ssZ)
          example: '2023-01-01T00:00:00Z'
        endTs:
          type: string
          format: date-time
          description: The last consumptions date, format ISO8601 (YYYY-MM-DDThh:mm:ssZ)
          example: '2023-01-01T00:00:00Z'
        generationTs:
          type: string
          format: date-time
          description: The generation date, format ISO8601 (YYYY-MM-DDThh:mm:ssZ)
          example: '2023-01-01T00:00:00Z'
        challengeId:
          type: string
          description: The challenge identifier
          example: CHALLENGE_2023_01
        challengeType:
          $ref: '#/components/schemas/ChallengeType'
        realConsumption:
          $ref: '#/components/schemas/Consumption'
        forecastConsumption:
          $ref: '#/components/schemas/Consumption'
        removedConsumption:
          $ref: '#/components/schemas/Removal'
        status:
          type: string
          description: The removed consumptions status
          example: OK
          enum:
            - OK
            - KO
        reason:
          type: string
          description: The removed consumptions status reason
          example: REAL_DATA_NOT_RECEIVED
          enum:
            - REAL_DATA_NOT_RECEIVED
            - FORECAST_NOT_COMPUTABLE
            - THRESHOLD_EXCEEDED
            - REWARD_FACTOR_NOT_FOUND
            - ABERRANT_CONSUMPTION
            - BAD_INDEX_INFORMATION_OR_CONTRACT_CHANGE_MISSING
            - POOR_REGRESSION_QUALITY
    Aggregation:
      properties:
        challengeType:
          $ref: '#/components/schemas/ChallengeType'
        removedConsumption:
          $ref: '#/components/schemas/Removal'
    Consumption:
      required:
        - energyMeter
        - cost
      properties:
        energyMeter:
          $ref: '#/components/schemas/ConsumptionEnergyMeter'
        cost:
          $ref: '#/components/schemas/ConsumptionCost'
    Removal:
      properties:
        energyMeter:
          $ref: '#/components/schemas/ConsumptionEnergyMeter'
        cost:
          $ref: '#/components/schemas/ConsumptionCost'
        reward:
          $ref: '#/components/schemas/ConsumptionCost'
    ConsumptionEnergyMeter:
      required:
        - total
      properties:
        total:
          type: number
          description: The value of energy consumption
          example: 10.38
    ConsumptionCost:
      required:
        - total
      properties:
        total:
          type: number
          description: The value of consumption cost
          example: 20.23

````