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

# Get Emnify consumption data

> Get data consumption from Emnify API for multiple phone numbers.

    This endpoint acts as a secure backend proxy to the Emnify API,
    keeping API tokens safe and allowing for rate limiting and caching.

    **Notes:**
    - Only processes Emnify phone numbers (starting with "42")
    - Maximum 1000 phone numbers per request
    - Implements rate limiting and batch processing



## OpenAPI

````yaml /generated/specs/diagnostics.json post /api/v1/consumption/emnify
openapi: 3.0.0
info:
  title: Raul API - Diagnostico
  description: Health, consumo, conectividad, SIMs, webhooks fallidos y estados tecnicos.
  version: 2.0.0
  contact: {}
servers:
  - url: https://api.raul.ugps.io
    description: Production
security: []
tags: []
paths:
  /api/v1/consumption/emnify:
    post:
      tags:
        - Consumption
      summary: Get Emnify consumption data
      description: |-
        Get data consumption from Emnify API for multiple phone numbers.

            This endpoint acts as a secure backend proxy to the Emnify API,
            keeping API tokens safe and allowing for rate limiting and caching.

            **Notes:**
            - Only processes Emnify phone numbers (starting with "42")
            - Maximum 1000 phone numbers per request
            - Implements rate limiting and batch processing
      operationId: ConsumptionController_getConsumptionData
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConsumptionRequestDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsumptionResponseDto'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmnifyErrorDto'
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmnifyErrorDto'
      security:
        - bearerAuth: []
components:
  schemas:
    ConsumptionRequestDto:
      type: object
      properties:
        phone_numbers:
          description: List of phone numbers (MSISDN) to query
          example:
            - '423663922670587'
            - '423663922670588'
          type: array
          items:
            type: string
        start_date:
          type: string
          description: Start date in ISO 8601 format
          example: '2025-01-01T00:00:00Z'
        end_date:
          type: string
          description: End date in ISO 8601 format
          example: '2025-01-31T23:59:59Z'
      required:
        - phone_numbers
        - start_date
        - end_date
    ConsumptionResponseDto:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ConsumptionItemDto'
        total_count:
          type: number
        successful_count:
          type: number
        failed_count:
          type: number
      required:
        - data
        - total_count
        - successful_count
        - failed_count
    EmnifyErrorDto:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        details:
          type: string
      required:
        - error
        - message
    ConsumptionItemDto:
      type: object
      properties:
        phone_number:
          type: string
        endpoint_id:
          type: object
        sim_id:
          type: object
        consumption_mb:
          type: number
        period:
          $ref: '#/components/schemas/ConsumptionPeriodDto'
        not_found:
          type: boolean
      required:
        - phone_number
        - consumption_mb
        - period
    ConsumptionPeriodDto:
      type: object
      properties:
        start:
          type: string
        end:
          type: string
      required:
        - start
        - end
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token authentication

````