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

# CORS support for proxy paths

> Enables CORS by returning correct headers for pre-flight requests.



## OpenAPI

````yaml /openapi-v1.yaml options /{proxy+}
openapi: 3.0.3
info:
  title: Ion Electricity HAN API
  description: >-
    Provides access to a user's electricity data from their Home Area Network
    (HAN) smart meters. It can list a user's registered devices and retrieve
    detailed, device-specific data including real-time power usage (instant),
    historical  consumption, cost analysis, tariff information, and meter
    specifications.  Ideal for answering questions like "List my devices", "What
    is the real-time  power usage for HB0375D3?", or "Get the consumption data
    for my most recently updated device."
  version: 1.0.0
servers:
  - url: https://api.ionelectricity.com/v1
security:
  - CognitoAuthorizer: []
paths:
  /{proxy+}:
    parameters:
      - name: proxy+
        in: path
        required: true
        description: >-
          The sub-path for specific data models and device IDs, e.g., 'han',
          'han/HB0375D3', or 'consumption'.
        schema:
          type: string
    options:
      summary: CORS support for proxy paths
      description: Enables CORS by returning correct headers for pre-flight requests.
      responses:
        '200':
          description: Default response for CORS method
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
components:
  securitySchemes:
    CognitoAuthorizer:
      type: apiKey
      name: Authorization
      in: header
      x-amazon-apigateway-authtype: cognito_user_pools
      x-amazon-apigateway-authorizer:
        type: cognito_user_pools
        providerARNs:
          - >-
            arn:aws:cognito-idp:eu-central-1:571358996859:userpool/eu-central-1_Fzbfyp34o

````