n3rgy Customer Service API V2

The consent-scoped smart-meter data API of the n3rgy platform. A business holding a valid n3rgy API key lists the properties (MPxNs) it has active consent for, discovers which utilities (electricity, gas) and reading types (consumption, production, tariff) are available for each, and retrieves the underlying half-hourly data. The same contract also covers meter update-frequency control, MPxN and address lookup, read-inventory / firmware and last-communications checks, on-demand "update now" fetches, push-notification configuration, and an upload/devices surface for non-DCC device data. Every operation is secured with the x-api-key header; consent-bearing operations additionally validate that an active consent exists for the HAN behind the given MPxN. A free sandbox with demonstration MPxNs mirrors the live contract on a separate host.

Documentation

Specifications

Other Resources

OpenAPI Specification

n3rgy-customer-service-api-v2-openapi.yaml Raw ↑
openapi: 3.0.1
info:
  title: Customer Service API V2
  description: Customer Service API V2.
  version: "1.0"
  contact:
    name: N3rgy Support
    email: support@n3rgy.com
servers:
  - url: "https://api-v2.data.n3rgy.com"
    description: Live API
  - url: "https://api-v2-sandbox.data.n3rgy.com"
    description: Sandbox API
paths:
  /:
    get:
      operationId: RetrieveConsentedMPxNs
      summary: "List consented mpxns"
      description: "returns the consented mpxns for a given customer"
      security:
        - ApiKeyAuth: []
      parameters:
        - in: query
          name: startat
          schema:
            type: integer
          description: "consented mpxns are returned from this number onwards"
        - in: query
          name: maxresults
          schema:
            type: integer
          description: "the maximum number of mpxns to be returned for that request"
      responses:
        "200":
          description: "success message for retrieving consented mpxns request."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RetrieveConsentedMPxNsSuccessResponse"
        "400":
          description: "Bad request. There was an error while validating the request parameters."
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/ParamStartAtErrorResponse"
                  - $ref: "#/components/schemas/ParamMaxResultsErrorResponse"
        "403":
          description: "Forbidden to access the endpoint."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ForbiddenResponse"
      x-amazon-apigateway-integration:
        type: "aws_proxy"
        httpMethod: "POST"
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${CustomerDataServiceApiV2Function.Arn}/invocations
  /mpxn/{mpxn}:
    get:
      operationId: RetrieveConsentedMPxNUtilities
      summary: List utilities for MPxN
      description: "Returns the utilities list for the consented MPxN"
      security:
        - ApiKeyAuth: []
      parameters:
        - in: path
          name: mpxn
          required: true
          schema:
            type: string
            pattern: "[0-9]{13}||[0-9]{9}"
            example: "1234567891002"
          description: "The MPxN, which can be either an MPAN or MPRN."
      responses:
        "200":
          description: "Success message for Retrieving Utilities request."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RetrieveUtilitiesSuccessResponse"
        "400":
          description: "Bad request. There was an error while validating the request parameters."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequestResponse"
        "403":
          description: "Forbidden to access the endpoint or no consent found for the customer"
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/ConsentNotFoundResponse"
                  - $ref: "#/components/schemas/ForbiddenResponse"
      x-amazon-apigateway-integration:
        type: "aws_proxy"
        httpMethod: "POST"
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${CustomerDataServiceApiV2Function.Arn}/invocations
  /mpxn/{mpxn}/utility/{utility}:
    get:
      operationId: RetrieveDataTypesForUtility
      summary: List types for utility in MPxN
      description: "Returns the data types of an utility in a consented MPxN"
      security:
        - ApiKeyAuth: []
      parameters:
        - in: path
          name: mpxn
          required: true
          schema:
            type: string
            pattern: "[0-9]{13}||[0-9]{9}"
            example: "1234567891002"
          description: "The MPxN, which can be either an MPAN or MPRN."
        - in: path
          name: utility
          required: true
          schema:
            type: string
            example: "electricity"
          description: "The utility type, which can be either electricity or gas."
        - in: query
          name: includeCheckMeter
          required: false
          schema:
            type: boolean
            default: false
          description: "Indicates whether to include check meter information in the response."
      responses:
        "200":
          description: "Success message for Retrieving Reading Types request."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RetrieveReadingTypesSuccessResponse"
        "400":
          description: "The MPxN is in an invalid format or the utility has an invalid value"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequestResponse"
        "403":
          description: "Forbidden to access the endpoint or consent not found for the given MPxN"
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/ConsentNotFoundResponse"
                  - $ref: "#/components/schemas/ForbiddenResponse"
        "404":
          description: "No available information for the specified utility in the HAN associated with the received MPxN"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MPxNNotAssociatedWithAHANError"
      x-amazon-apigateway-integration:
        type: "aws_proxy"
        httpMethod: "POST"
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${CustomerDataServiceApiV2Function.Arn}/invocations
  /set-meter-update-frequency:
    put:
      operationId: SetMeterUpdateFrequency
      summary: Set frequency
      description: Sets the update frequencies for a specific meter in one of the consented HANs
      security:
        - ApiKeyAuth: []
      parameters: []
      requestBody:
        description: Body parameters to specify the Device ID of the target meter and the values for import/export update frequency
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SetMeterUpdateFrequencyBody"
      responses:
        "200":
          description: "Success message for Set Meter Update Frequency request."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SetMeterUpdateFrequencySuccessResponse"
        "403":
          description: "Forbidden to access the endpoint."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SetMeterUpdateFrequencyForbiddenResponseList"
        "400":
          description: "Example of bad request response."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SetMeterUpdateFrequencyBadRequestResponseList"
        "404":
          description: "Example of not found response."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SetMeterUpdateFrequencyNotFoundResponseList"
      x-amazon-apigateway-integration:
        type: "aws_proxy"
        httpMethod: "POST"
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${CustomerServiceApiV2Function.Arn}/invocations
  /find-mpxn/{identifier}:
    get:
      operationId: RetrieveMPxNAvailability
      summary: Find MPxN
      description: "Returns the availability for consent of a device associated with the MPxN"
      security:
        - ApiKeyAuth: []
      parameters:
        - in: path
          name: identifier
          required: true
          schema:
            type: string
            pattern: "[0-9]{13}||[0-9]{9}"
            example: "1234567891002"
          description: "The MPxN, which can be either an MPAN or MPRN."
        - name: "checkAmr"
          in: "query"
          required: false
          schema:
            type: "boolean"
            example: true
      responses:
        "200":
          description: "Success message for Retrieving Availability request."
          content:
            application/json:
              schema:
                oneOf:
                  - description: "Response when checkAmr is false or not provided"
                    $ref: "#/components/schemas/RetrieveMPxNAvailabilitySuccessResponse"
                  - description: "Response when checkAmr is true (returns a list of objects)"
                    type: "array"
                    items:
                      $ref: "#/components/schemas/RetrieveMPxNAvailabilitySuccessResponse"
        "400":
          description: "Bad request. There was an error while validating the request parameters."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ParamMPxNErrorResponse"
        "403":
          description: "Forbidden to access the endpoint."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ForbiddenResponse"
        "404":
          description: "There is no available information of meters associated with the received MPxN, or MPxN not associated with a HAN"
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/NotFoundMpxnResponse"
                  - $ref: "#/components/schemas/MPxNNotAssociatedWithAHANError"
      x-amazon-apigateway-integration:
        type: "aws_proxy"
        httpMethod: "POST"
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${CustomerServiceApiV2Function.Arn}/invocations
  /find-mpxn/{identifier}/{address}:
    get:
      operationId: mpxnFromAddress
      summary: "Find MPxN by address"
      security:
        - ApiKeyAuth: []
      parameters:
        - name: "identifier"
          in: "path"
          required: true
          schema:
            type: "string"
            example: "C2A+2EE"
        - name: "address"
          in: "path"
          required: true
          schema:
            type: "string"
            example: "22A"
        - name: "checkAmr"
          in: "query"
          required: false
          schema:
            type: "boolean"
            example: true
      responses:
        "200":
          description: "Success message for Retrieving Availability request."
          content:
            application/json:
              schema:
                oneOf:
                  - description: "Response when checkAmr is false or not provided"
                    $ref: "#/components/schemas/RetrieveMPxNAvailabilitySuccessResponse"
                  - description: "Response when checkAmr is false or not provided"
                    type: "array"
                    $ref: "#/components/schemas/RetrieveMPxNAvailabilitySuccessResponse"
        "400":
          description: "Bad request. There was an error while validating the request parameters or more than a single HAN returned."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ParamMPxNErrorResponse"
        "403":
          description: "Forbidden to access the endpoint."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ForbiddenResponse"
        "404":
          description: "There is no available information of meters associated with the received address."
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/NotFoundMpxnResponse"
                  - $ref: "#/components/schemas/MPxNNotAssociatedWithAHANError"
      x-amazon-apigateway-integration:
        type: "aws_proxy"
        httpMethod: "POST"
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${CustomerServiceApiV2Function.Arn}/invocations
  /get-update-frequencies/{mpxn}:
    get:
      operationId: RetrieveDataUpdateFrequencies
      summary: Get frequency
      description: "Returns the values of the data update frequency for the utility types in one of the consented HANs"
      security:
        - ApiKeyAuth: []
      parameters:
        - in: path
          name: mpxn
          required: true
          schema:
            type: string
            pattern: "[0-9]{13}||[0-9]{9}"
            example: "1234567891002"
          description: "The MPxN, which can be either an MPAN or MPRN."
      responses:
        "200":
          description: "Success message for Retrieving update frequencies request."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RetrieveDataUpdateFrequenciesSuccessResponse"
        "400":
          description: "Bad request. The MPxN is absent or in invalid format."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequestResponse"
        "403":
          description: "Success message for Retrieving update frequencies request."
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/ConsentNotFoundResponse"
                  - $ref: "#/components/schemas/ForbiddenResponse"
      x-amazon-apigateway-integration:
        type: "aws_proxy"
        httpMethod: "POST"
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${CustomerServiceApiV2Function.Arn}/invocations
  /mpxn/{mpxn}/utility/{utility}/readingtype/{readingType}:
    get:
      operationId: RetrieveDataForReadingType
      summary: Retrieve consumption/ production data
      description: "Returns data for consumptions/productions for a specific MPxN, utility and reading type"
      security:
        - ApiKeyAuth: []
      parameters:
        - in: path
          name: mpxn
          required: true
          schema:
            type: string
            pattern: "[0-9]{13}||[0-9]{9}"
            example: "1234567891002"
          description: "The MPxN, which can be either an MPAN or MPRN."
        - in: path
          name: utility
          required: true
          schema:
            type: string
            enum: ["electricity", "gas"]
          description: "The utility type of the meter."
        - in: path
          name: readingType
          required: true
          schema:
            type: string
            enum: ["consumption", "production", "import", "export", "tariff", "READ_INSTANTANEOUS_IMPORT_REGISTERS", "READ_INSTANTANEOUS_EXPORT_REGISTERS", "RETRIEVE_IMPORT_DAILY_READ_LOG", "RETRIEVE_EXPORT_DAILY_READ_LOG", "RETRIEVE_DAILY_CONSUMPTION_LOG"]
          description: "The reading type."
        - in: query
          name: start
          schema:
            type: string
            example: "202205161100"
          description: "Start date to be considered."
        - in: query
          name: end
          schema:
            type: string
            example: "202205161100"
          description: "End date to be considered."
        - in: query
          name: granularity
          schema:
            type: string
            enum: ["halfhour", "day"]
          description: "Time granularity to be considered."
        - in: query
          name: outputFormat
          schema:
            type: string
            enum: ["json", "csv"]
          description: "Output format to be considered."
        - in: query
          name: includeCheckMeter
          required: false
          schema:
            type: boolean
            default: false
          description: "Indicates whether to include check meter information in the response."
      responses:
        "200":
          description: "Success message for Retrieving Reading data request."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RetrieveReadingDataSuccessResponse"
        "403":
          description: "Forbidden to access the endpoint or no consent found for the customer"
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/ConsentNotFoundResponse"
                  - $ref: "#/components/schemas/ForbiddenResponse"
        "400":
          description: "Bad request. There was an error while validating the request parameters."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequestResponse"
        "404":
          description: "No available information for the specified utility in the HAN associated with the received MPxN"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MPxNNotAssociatedWithAHANError"
      x-amazon-apigateway-integration:
        type: "aws_proxy"
        httpMethod: "POST"
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${CustomerDataServiceApiV2Function.Arn}/invocations
  /set-defaults:
    put:
      operationId: SetDefaults
      summary: Set defaults
      description: "Allows updating account default values for the update frequency of meter readings and if historic data should be recovered after a consent."
      security:
        - ApiKeyAuth: []
      parameters: []
      requestBody:
        description: Request body with information to change default values.
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SetDefaultsBodyRequest"
      responses:
        "200":
          description: "Success message for Set Defaults request."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SetDefaultsSuccessResponse"
        "400":
          description: "Bad request. The request body is invalid."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequestResponse"
        "403":
          description: "Forbidden. AWS authentication is invalid or customer doesn't have the right permissions to update frequencies values."
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/ForbiddenResponse"
      x-amazon-apigateway-integration:
        type: "aws_proxy"
        httpMethod: "POST"
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${CustomerServiceApiV2Function.Arn}/invocations
  /reset-all-update-frequencies:
    put:
      operationId: ResetAllUpdateFrequencies
      summary: Reset all
      description: "Sets new update frequencies for all consented HANs."
      security:
        - ApiKeyAuth: []
      parameters: []
      requestBody:
        description: Request body with the new values for values for electricity_import_update_frequency, electricity_export_update_frequency and gas_update_frequency.
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: "#/components/schemas/ResetAllUpdateFrequenciesRequestRequiredElectricityImport"
                - $ref: "#/components/schemas/ResetAllUpdateFrequenciesRequestRequiredElectricityExport"
                - $ref: "#/components/schemas/ResetAllUpdateFrequenciesRequestRequiredGasImport"
      responses:
        "200":
          description: "Success message for reset all update frequencies."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResetAllUpdateFrequenciesSuccessResponse"
        "400":
          description: "Bad request. There was an error while validating request body."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequestBodyResponse"
        "403":
          description: "Forbidden to access the endpoint."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ForbiddenResponse"
      x-amazon-apigateway-integration:
        type: "aws_proxy"
        httpMethod: "POST"
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${CustomerServiceApiV2Function.Arn}/invocations
  /read-inventory:
    post:
      operationId: ReadInventory
      summary: Read smart meter inventory
      description: "Allows the user to request to DCC the list of Devices and WAN Matrix for a MPxN, UPRN or Device ID"
      security:
        - ApiKeyAuth: []
      parameters:
        - in: query
          name: last-communications
          schema:
            type: boolean
          description: "Triggers a last communications request. The asynchronous data received by the json file will contain the information about the last communications date."
        - in: query
          name: check-firmware
          schema:
            type: boolean
          description: "Triggers a check firmware version request."
        - in: query
          name: deviceType
          schema:
            type: string
            example: "ESME"
          description: "Specifies a device type for the check firmware request. Admissible values ['ESME','GSME']"
      requestBody:
        description: Request body with information to Read Inventory values.
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ReadInventoryBodyRequest"
      responses:
        "200":
          description: "Success message for Read Inventory request."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReadInventorySuccessResponseNoQueryParams"
        "400":
          description: "Bad request. The request body is invalid."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequestResponse"
        "403":
          description: "Forbidden. AWS authentication is invalid or customer doesn't have the right permissions to update frequencies values."
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/ForbiddenResponse"
      x-amazon-apigateway-integration:
        type: "aws_proxy"
        httpMethod: "POST"
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${CustomerServiceApiV2Function.Arn}/invocations
  /create-export-profiles:
    post:
      operationId: CreateExportProfiles
      summary: Creates export profiles on the V1 solution.
      description: "Allows the user to request the creation of Export Profiles on the V1 solution"
      security:
        - ApiKeyAuth: []
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: "#/components/schemas/CreateExportProfilesRequest"
      responses:
        "200":
          description: "Success message for Create Export Profiles."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateExportProfilesSuccessResponse"
        "202":
          description: "Success message for Create Export Profiles."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateExportProfilesAcceptedResponse"
        "429":
          description: "Bad request. The request body is invalid."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TooManyRequestsResponse"
        "403":
          description: "Forbidden. AWS authentication is invalid or customer doesn't have the right permissions to update frequencies values."
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/ForbiddenResponse"
      x-amazon-apigateway-integration:
        type: "aws_proxy"
        httpMethod: "POST"
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${CustomerServiceApiV2Function.Arn}/invocations
  /upload/data/deviceid/{deviceId}/readingtype/{readingType}:
    post:
      summary: Upload data to device.
      description: Uploads data into a device identified by its deviceId.
      operationId: uploadData
      security:
        - ApiKeyAuth: []
      parameters:
        - name: deviceId
          description: Device Identifier
          in: path
          required: true
          schema:
            type: string
            example: 0CA2F400005CDFA3
        - name: readingType
          description: Type of the reading being imported.
            Tariffs not supported.
            Consumption and import are alias, same for production and export.
          in: path
          required: true
          schema:
            type: string
            enum: ["consumption", "production", "import", "export", "READ_INSTANTANEOUS_IMPORT_REGISTERS", "READ_INSTANTANEOUS_EXPORT_REGISTERS", "RETRIEVE_IMPORT_DAILY_READ_LOG", "RETRIEVE_EXPORT_DAILY_READ_LOG", "RETRIEVE_DAILY_CONSUMPTION_LOG"]
            example: import
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: "#/components/schemas/MeteredValues"
        required: true
      responses:
        200:
          description: "Indicates that the request has succeeded. Data stored for a device identified by the deviceId."
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "success"
        400:
          description: "Bad request. The request has incorrect syntax and should not repeat without modifications. Check parameter settings or values. Notice that the values are numeric."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequestResponse"
        403:
          description: "Unauthorized request. The client does not have access rights to the content."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ForbiddenResponse"
        404:
          description: "Not Found. The provided deviceId does not match a device."
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: "Device not found"
      x-amazon-apigateway-integration:
        type: aws_proxy
        httpMethod: POST
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${CustomerServiceApiV2Function.Arn}/invocations
  /upload/data/deviceid/{deviceId}/readingtype/{readingType}/starttime/{startTime}/endtime/{endTime}:
    delete:
      summary: Deletes data from a device.
      description: Deletes data from a device identified by its deviceId.
        Data to be purged are type and time bounded.
      operationId: deleteData
      security:
        - ApiKeyAuth: []
      parameters:
        - name: deviceId
          description: Device Identifier
          in: path
          required: true
          schema:
            type: string
            example: 0CA2F400005CDFA3
        - name: readingType
          description: Type of the reading being imported.
            Tariffs not supported.
            Consumption and import are alias, same for production and export.
          in: path
          required: true
          schema:
            type: string
            enum: ["consumption", "production", "import", "export"]
            example: import
        - name: startTime
          description: Date/time from which the values will be deleted (in the ISO8601 format).
          in: path
          required: true
          schema:
            type: string
            format: date
            example: 2023-01-24T05:29:36Z
        - name: endTime
          description: Date/time till which the values will be deleted (in the ISO8601 format).
          in: path
          required: true
          schema:
            type: string
            format: date
            example: 2023-01-25T05:29:36Z
      responses:
        200:
          description: "Indicates that the request has succeeded. Data deleted for a device identified by the deviceId."
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "success"
        400:
          description: "Bad request. The request has incorrect syntax and should not repeat without modifications. Check parameter settings."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequestResponse"
        403:
          description: "Unauthorized request. The client does not have access rights to the content."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ForbiddenResponse"
        404:
          description: "Not Found. The provided deviceId does not match a device."
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: "Device not found"
      x-amazon-apigateway-integration:
        type: aws_proxy
        httpMethod: POST
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${CustomerServiceApiV2Function.Arn}/invocations
  /upload/devices/:
    post:
      summary: Adds a new non-SMETS device to the inventory.
      description: |
        Adds a new non-SMETS device to the inventory.
        The given device shall not specify the hanId, as it will be generated by the service.
        The device fields will be verified for match with the customer permission specified in customer-extended-permissions.uploadsAccessFilter.
        If it doesn't match then operation will be forbidden.
      operationId: addDevice
      security:
        - ApiKeyAuth: []

      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UploadDevice"
        required: true
      responses:
        200:
          description: "Indicates that the request has succeeded. The inventory data was updated accordingly."
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "success"
                  deviceId:
                    type: string
                    example: "0CA2F400005CDFA3"
        400:
          description: "Bad request. The request has incorrect syntax and should not repeat without modifications. Check the schema for the request."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequestResponse"
        403:
          description: "Unauthorized request. The client does not have access rights to the content."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ForbiddenResponse"
        409:
          description: "Conflict. The request could not be completed due to a conflict with the current state of the resource. The device already exists in the inventory. To update it use PUT method instead."
          content:
            appli

# --- truncated at 32 KB (83 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/n3rgy/refs/heads/main/openapi/n3rgy-customer-service-api-v2-openapi.yaml