---
openapi: 3.0.3
info:
  title: Device API
  description: |
    #### Copyright
      © Aeris Communications, Inc. 2026. All rights reserved. No part of this document
      may be reproduced in any form without the written permission of
      the copyright owner.

    #### Disclaimer

      The contents of this document are subject to revision without notice
      due to continued progress in methodology, design and manufacturing.
      Aeris shall have no liability for any error or damage of any kind
      resulting from the use of this document.

    #### Trademark List

    All trademarks mentioned herein are the property of their respective owners.
    These are shown in the document Trademark Information.

      # Introduction

      This document describes the IoT Accelerator Device API that provides
      resources to retrieve device inventory and details.
      The Device API is based on the Representational State Transfer (REST)
      interface.
      From this point on, the Device API is referred to as API in this
      document.

      ## Scope

      This document covers the following topics:

      — An overview of the API

      — A detailed description of all operations offered by the API

      ## Prerequisites
      In this document, it is assumed that the user is familiar with
      the following:

      — Java Script Object Notation (JSON)

      — Basic understanding of REST web services

      — The [OpenAPI Initiative](https://www.openapis.org/) for the
        standardized format used in this document.

      ## Related Information
      The definition and explanation of acronyms and terminology and
      typographic conventions can be found in the following documents:

      — IoTA Glossary of Terms and Acronyms

      — Typographic Conventions

      # General API Guidelines

      ## Compatibility

      API audience must be prepared for compatible API extensions:

      - Be tolerant with unknown fields in the payload (see also Fowler’s
        "TolerantReader" post), i.e. ignore new fields but do not eliminate
        them from payload if needed for subsequent PUT requests.
      - Be prepared that "x-extensible-enum" return parameter may deliver
        new values. Either be agnostic or provide default behavior for
        unknown values.
      - Be prepared to handle HTTP status codes not explicitly specified in
        endpoint definitions.
      - Follow the redirect when the server returns HTTP status 301 Moved
        Permanently.

      ## Security

      This section describes the security measures in the API. Security
      measures include authentication, authorization, and encryption.

      ### Authentication and Authorization

      The API uses OAuth2 and OpenID Connect (OIDC) for authentication and
      authorization.

      All API endpoints require authentication, which is performed by passing
      a token in the Authorization header in each request, preceded by
      the word Bearer and a space. See the following example:
      ```
      curl -i -X GET "http://<baseURL>/iot/api/subscriptions/devices"
      -H "Content-Type: application/json"
      -H "Authorization: Bearer <TOKEN_GOES_HERE>"
      ```
      To fetch the token using e.g. curl, submit the following:
      ```
      curl -X POST "https://<baseURL>/iot/api/auth/token"
      -H "Accept: application/vnd.dcp-v1+json"
      -H "Content-Type: application/x-www-form-urlencoded"
      -d "grant_type=password&client_id=<client_id>
      &username=<username>&password=<password>"
      ```
      ### Encryption

      All API requests are encrypted using the HTTPS protocol to grant secure
      data transfer.

      ### Permission

      API endpoints permissions are authorized by authorization server based
      on the account roles. Required permissions for this API are documented
      in 'securitySchemes' section. You can view available permissions for
      your account through permission library in Service Portal by navigating
      Administration > Users & roles > Permission library or
      Role administration > Actions > View permission library. Make sure
      permission is available to your account before you start utilizing this
      API.

      ## Deprecation

      API deprecation will be reflected in the OpenAPI definition. If a method
      on a path, a whole path or even a whole API endpoint (multiple paths)
      should be deprecated, they will be marked as deprecated.
      During deprecation phase, a Deprecation header and a Sunset header fields
      will be added in the response.

      Example:
      ```
      Deprecation: Tue, 31 Dec 2024 23:59:59 GMT
      Sunset: Wed, 31 Dec 2025 23:59:59 GMT
      ```

      API audience should not start using a deprecated API.

      API audience is encouraged to monitor for Deprecation and Sunset header.


  version: 1.0.4
  x-api-id: f9fccdac-8c1f-43bc-90a7-99edee52fe2f
  x-audience: external-public
servers:
  - url: https://iot-api.aeris.com/iot/api/subscriptions
    description: API server
tags:
  - name: Device
    description: 'The Device API'
paths:
  /devices:
    get:
      tags:
        - Device
      operationId: listdevices
      summary: List Devices
      description: The API provides the list of devices mapped to a specific
        organization. By default, the ESIM devices is sorted by EID in an
        ascending order. By default, the SIM devices is sorted by ICCID in an
        ascending order.
      parameters:
        - $ref: '#/components/parameters/Header-Authorization'
        - $ref: '#/components/parameters/Ericsson-IOT-Platform'
        - in: query
          name: orgId
          required: true
          schema:
            type: string
            example: 2.73.4
          description: |
            The devices mapped to the specific Organization ID
        - in: query
          name: q
          schema:
            type: string
            example: filterType == basic; deviceType == ESIM
          description: |

            RSQL query string parameter. Retrieves subscriptions which are
            filtered by a RSQL compliant query string.

            _Available logical operator:_

            - Logical AND : ; is supported

            Comparison operators are in FIQL notation.

            _Available comparison operator:_

            - Equal to : ==

            _Advanced Filtering:_

            - Operator: *
            - Example string: 12345678
            - Operations available:
              - Starts with
                  - example: 1234*
              - Ends with
                  - example: *5678
              - Contains
                  - example: \*3456*

            Note! Only one of type 'q' is allowed per request.

            _Available filterType values:_ basic or extended

            _Available deviceType values:_ ESIM or SIM

            _Default filterType:_ extended

            _Default deviceType:_ ESIM

        - $ref: '#/components/parameters/sortParam'
        - $ref: '#/components/parameters/pageSizeParam'
        - $ref: '#/components/parameters/cursorParam'
      responses:
        '200':
          description: OK
          allOf:
            - $ref: '#/components/responses/RateLimitedResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/devices'
              examples:
                basic-esim-iota:
                  value:
                    devices:
                      - type: ESIM
                        idType: EID
                        value: "0090923122299992358129036544309"
                        euiccType: "M2M"
                    next: "/devices?orgId=2.73.4\
                      &q=filterType==basic;deviceType==ESIM\
                      &pageSize=10&cursor=ODk0NTA0MjExNzEyMDYwMjIyMjI="

                basic-sim-iota:
                  value:
                    devices:
                      - type: SIM
                        idType: ICCID
                        value: "8991101200003204004"
                    next: "/devices?orgId=2.73.4\
                      &q=filterType==basic;deviceType==SIM\
                      &pageSize=10&cursor=ODk0NTA0MjExNzEyMDYwMjIyMjI="

                extended-esim-iota:
                  value:
                    devices:
                      - type: ESIM
                        idType: EID
                        value: "0090923122299992358129036544309"
                        euiccType: "M2M"
                        subscriptions:
                          - iccId: "8991101200003204002"
                            imsi: "460001357924680"
                            msisdn: "883130200003333"
                            status: "PROVISIONED"
                            subscriptionState: "ACTIVE"
                          - iccId: "8991101200003204003"
                            imsi: "460001357924681"
                            msisdn: "883130200003334"
                            status: "PROVISIONED"
                            subscriptionState: "ACTIVE"
                    next: "/devices?orgId=2.73.4\
                      &q=filterType==extended;deviceType==ESIM\
                      &pageSize=10&cursor=ODk0NTA0MjExNzEyMDYwMjIyMjI="

                extended-sim-iota:
                  value:
                    devices:
                      - type: SIM
                        idType: ICCID
                        value: "8991101200003204004"
                        subscriptions:
                          - imsi: "460001357924682"
                            msisdn: "883130200003335"
                            status: "ACTIVE"
                            subscriptionState: "ACTIVE"
                    next: "/devices?orgId=2.73.4\
                      &q=filterType==extended;deviceType==SIM\
                      &pageSize=10&cursor=ODk0NTA0MjExNzEyMDYwMjIyMjI="
        default:
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              examples:
                response:
                  value:
                    type: 'https://www.iana.org/assignments/http-status-codes/'
                    title: 'Internal Server Error'
                    status: 500
                    detail: 'Internal Server Error'
                    instance: "123e4567-e89b-12d3-a456-426614174000"
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      security:
        - OAuth2:
            - 'cnx_euicc_inventory'
  /devices/{idType}/{value}:
    get:
      tags:
        - Device
      operationId: deviceDetails
      summary: Get Device Details
      description: |
        The API provides the SIM, subscription, network session details of a
        device.
        * Returns up to 10 most recent sessions during the last 72 hours.
        * Need the following permissions to access.
          - eUICC inventory
          - Any of subscriptions permissions (Subscriptions view, Subscription
            inventory, Change subscription owner, Subscription traffic search,
            Traffic analytics view).

      parameters:
        - in: path
          name: idType
          required: true
          schema:
            type: string
            enum: [EID, ICCID, IMSI, MSISDN]
          description: |
            SIM profile key type. EID is only valid for type
            of ESIM.

        - in: path
          name: value
          required: true
          schema:
            type: string
          description: |
            SIM profile key value of specified key.
        - $ref: '#/components/parameters/Header-Authorization'
        - $ref: '#/components/parameters/Ericsson-IOT-Platform'

        - in: query
          name: extensions
          required: false
          schema:
            type: array
            items:
              type: string
              enum:
                - NETWORK
                - ESIM
            example: [NETWORK, ESIM]
          description: |
            This option specifies what kinds of extended information to be
            returned:
              - NETWORK: The extended network information will be returned.
              - ESIM: All subscription profiles of the device will be returned.
              It is only applicable to ESIM type.

      responses:

        '200':
          description: OK
          allOf:
            - $ref: '#/components/responses/RateLimitedResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/individualDeviceDetail'
              examples:
                sim-default:
                  value:
                    device:
                      type: SIM
                      idType: ICCID
                      value: "8991101200003204002"
                      subscriptions:
                        - iccId: "8991101200003204002"
                          imsi: "460001357924680"
                          msisdn: "33123456789"
                          subscriptionPackageName: "86000001_002_SP_12"
                          subscriptionPackageDescription: "SP for roaming 1"
                          status: "ACTIVE"
                          subscriptionState: "ACTIVE"
                          organizationId: "3.97.3"
                          operatorId: "86000001"
                          operatorName: "Operator A"
                          assignedImei: "49015420323652"
                          networkDetails:
                            detectedImei: "49015420323652"
                            lastEventReceivedAt: "2022-02-13T22:20:23.922Z"
                            firstEventReceivedAt: "2022-02-13T22:20:23.922Z"
                sim-extended-network:
                  value:
                    device:
                      type: SIM
                      idType: ICCID
                      value: "8991101200003204002"
                      subscriptions:
                        - iccId: "8991101200003204002"
                          imsi: "460001357924680"
                          msisdn: "33123456789"
                          subscriptionPackageName: "86000001_002_SP_12"
                          subscriptionPackageDescription: "SP for roaming 1"
                          status: "ACTIVE"
                          subscriptionState: "ACTIVE"
                          organizationId: "3.97.3"
                          operatorId: "86000001"
                          operatorName: "Operator A"
                          assignedImei: "49015420323652"
                          networkDetails:
                            detectedImei: "49015420323652"
                            lastEventReceivedAt: "2022-02-13T22:20:23.922Z"
                            firstEventReceivedAt: "2022-02-13T22:20:23.922Z"
                            lastLocationUpdates:
                              - type: VOICE_CONNECTION_2G3G
                                status: "0_SUCCESS"
                                updatedAt: "2022-02-13T22:10:23.922Z"
                                vlrGt: "35385nnnnnnn"
                                countryCode: "SE"
                                countryName: "Sweden"
                                operatorName: "op1"
                                roamingOperatorName: "op2"
                            data:
                              dataActive: true
                              dataActivatedAt: "2013-09-30T06:51:34.000Z"
                              ipv4: "192.168.10.73"
                              ipv6: "2001:0db8:5b96:0000:0000:426f:8e17:642a"
                              apn: "internet.opa.xx"
                              uploadedBytes: 1.048576E8
                              lastUploadedAt: "2013-09-30T06:51:34.000Z"
                              downloadedBytes: 2.097152E8
                              lastdownloadedAt: "2013-09-30T06:51:34.000Z"
                              giDestAddress: "10.11.2.1"
                              sessionDetails:
                                - apn: "B.STG.CXN"
                                  ipv4: "192.168.10.73"
                                  ipv6: "2001:0db8:5b96:0000:0000:426f:8e17:
                                   642a"
                                  startedAt: "2022-02-13T22:10:23.922Z"
                                  endedAt: "2022-02-13T22:20:23.922Z"
                            sms:
                              sent:
                                count: 31
                                lastDestAddress: "1234567891234"
                                lastSmsSentAt: "2013-09-30T06:51:34.000Z"
                                errorCount: 2
                              received:
                                count: 4
                                lastSmsReceivedAt: "2013-09-30T06:51:34.000Z"
                                errorCount: 0
                              error:
                                lastErrorAt: "2013-09-30T06:51:34.000Z"
                                lastError: "Error description."
                esim-extended-esim:
                  value:
                    device:
                      type: ESIM
                      idType: EID
                      value: "0090923122299992358129036544309"
                      euiccType: "M2M"
                      enabledIcc: "8991101200003204001"
                      subscriptions:
                        - iccId: "8991101200003204001"
                          imsi: "460001357924680"
                          msisdn: "33123456789"
                          subscriptionPackageName: "86000001_002_SP_12"
                          subscriptionPackageDescription: "SP for roaming 1"
                          status: "ACTIVE"
                          subscriptionState: "ACTIVE"
                          organizationId: "3.97.3"
                          operatorId: "86000001"
                          operatorName: "Operator A"
                          assignedImei: "49015420323651"
                          networkDetails:
                            detectedImei: "49015420323651"
                            lastEventReceivedAt: "2022-02-13T22:20:23.922Z"
                            firstEventReceivedAt: "2022-02-13T22:20:23.922Z"
                        - iccId: "8991101200003204002"
                          imsi: "460001357924681"
                          msisdn: "33123456790"
                          subscriptionPackageName: "86000001_002_SP_13"
                          subscriptionPackageDescription: "SP for roaming 2"
                          status: "SUSPENDED"
                          subscriptionState: "PAUSE"
                          organizationId: "3.97.4"
                          operatorId: "86000002"
                          operatorName: "Operator B"
                          assignedImei: "49015420323652"
                          networkDetails:
                            detectedImei: "49015420323652"
                            lastEventReceivedAt: "2022-02-13T22:20:23.922Z"
                            firstEventReceivedAt: "2022-02-13T22:20:23.922Z"
                esim-extended-esim-network:
                  value:
                    device:
                      type: ESIM
                      idType: EID
                      value: "0090923122299992358129036544309"
                      euiccType: "M2M"
                      enabledIcc: "8991101200003204001"
                      subscriptions:
                        - iccId: "8991101200003204001"
                          imsi: "460001357924680"
                          msisdn: "33123456789"
                          subscriptionPackageName: "86000001_002_SP_12"
                          subscriptionPackageDescription: "SP for roaming 1"
                          status: "ACTIVE"
                          subscriptionState: "ACTIVE"
                          organizationId: "3.97.3"
                          operatorId: "86000001"
                          operatorName: "Operator A"
                          assignedImei: "49015420323651"
                          networkDetails:
                            detectedImei: "49015420323651"
                            lastEventReceivedAt: "2022-02-13T22:20:23.922Z"
                            firstEventReceivedAt: "2022-02-13T22:20:23.922Z"
                            lastLocationUpdates:
                              - type: VOICE_CONNECTION_2G3G
                                status: "0_SUCCESS"
                                updatedAt: "2022-02-13T22:10:23.922Z"
                                vlrGt: "35385nnnnnnn"
                                countryCode: "SE"
                                countryName: "Sweden"
                                operatorName: "op1"
                                roamingOperatorName: "op2"
                            data:
                              dataActive: true
                              dataActivatedAt: "2013-09-30T06:51:34.000Z"
                              ipv4: "192.168.10.73"
                              ipv6: "2001:0db8:5b96:0000:0000:426f:8e17:642a"
                              apn: "internet.opa.xx"
                              uploadedBytes: 1.048576E8
                              lastUploadedAt: "2013-09-30T06:51:34.000Z"
                              downloadedBytes: 2.097152E8
                              lastdownloadedAt: "2013-09-30T06:51:34.000Z"
                              giDestAddress: "10.11.2.1"
                              sessionDetails:
                                - apn: "B.STG.CXN"
                                  ipv4: "192.168.10.73"
                                  ipv6: "2001:0db8:5b96:0000:0000:426f:8e17:
                                   642a"
                                  startedAt: "2022-02-13T22:10:23.922Z"
                                  endedAt: "2022-02-13T22:20:23.922Z"
                            sms:
                              sent:
                                count: 31
                                lastDestAddress: "1234567891234"
                                lastSmsSentAt: "2013-09-30T06:51:34.000Z"
                                errorCount: 2
                              received:
                                count: 4
                                lastSmsReceivedAt: "2013-09-30T06:51:34.000Z"
                                errorCount: 0
                              error:
                                lastErrorAt: "2013-09-30T06:51:34.000Z"
                                lastError: "Error description."
                        - iccId: "8991101200003204002"
                          imsi: "460001357924681"
                          msisdn: "33123456790"
                          subscriptionPackageName: "86000001_002_SP_13"
                          subscriptionPackageDescription: "SP for roaming 2"
                          status: "SUSPENDED"
                          subscriptionState: "TERMINATED"
                          organizationId: "3.97.4"
                          operatorId: "86000002"
                          operatorName: "Operator B"
                          assignedImei: "49015420323652"
                          networkDetails:
                            detectedImei: "49015420323652"
                            lastEventReceivedAt: "2022-02-13T22:20:23.922Z"
                            firstEventReceivedAt: "2022-02-13T22:20:23.922Z"
                            lastLocationUpdates:
                              - type: DATA_CONNECTION_4G5G
                                status: "0_SUCCESS"
                                updatedAt: "2022-02-13T22:10:23.922Z"
                                countryCode: "SE"
                                countryName: "Sweden"
                                operatorName: "op1"
                                roamingOperatorName: "op2"
                            data:
                              dataActive: true
                              dataActivatedAt: "2013-09-30T06:51:34.000Z"
                              ipv4: "192.168.10.73"
                              ipv6: "2001:0db8:5b96:0000:0000:426f:8e17:642a"
                              apn: "internet.opa.xx"
                              uploadedBytes: 1.048576E8
                              lastUploadedAt: "2013-09-30T06:51:34.000Z"
                              downloadedBytes: 2.097152E8
                              lastdownloadedAt: "2013-09-30T06:51:34.000Z"
                              giDestAddress: "10.11.2.1"
                              sessionDetails:
                                - apn: "B.STG.CXN"
                                  ipv4: "192.168.10.73"
                                  ipv6: "2001:0db8:5b96:0000:0000:426f:8e17:
                                   642a"
                                  startedAt: "2022-02-13T22:10:23.922Z"
                                  endedAt: "2022-02-13T22:20:23.922Z"
                            sms:
                              sent:
                                count: 31
                                lastDestAddress: "1234567891234"
                                lastSmsSentAt: "2013-09-30T06:51:34.000Z"
                                errorCount: 2
                              received:
                                count: 4
                                lastSmsReceivedAt: "2013-09-30T06:51:34.000Z"
                                errorCount: 0
                              error:
                                lastErrorAt: "2013-09-30T06:51:34.000Z"
                                lastError: "Error description."
        default:
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              examples:
                response:
                  value:
                    type: 'https://www.iana.org/assignments/http-status-codes/'
                    title: 'Internal Server Error'
                    status: 500
                    detail: 'Internal Server Error'
                    instance: "123e4567-e89b-12d3-a456-426614174000"
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      security:
        - OAuth2:
            - 'cnx_euicc_inventory'
components:
  schemas:

    individualDeviceDetail:
      type: object
      description: |
        Individual device detail.
      properties:
        device:
          $ref: '#/components/schemas/device'

    device:
      type: object
      description: |
        Device detail.
      properties:
        type:
          type: string
          description: |
            SIM type.
          example: ESIM, SIM
        idType:
          type: string
          description: SIM profile key type.
          example: EID, ICCID
        value:
          type: string
          description: SIM profile key value of specified key type.
          example: '0090923122299992358129036544309'
        euiccType:
          type: string
          description: Type of eUICC.
          example: M2M
        enabledIcc:
          type: string
          description: |
            ICCID of enabled subscription in the SIM card.
          example: '8991101200003204001'
        subscriptions:
          type: array
          items:
            $ref: '#/components/schemas/subscription'

    subscription:
      type: object
      properties:
        iccId:
          type: string
          description: |
            Global unique serial number of one UICC.
          example: '8991101200003204003'
        imsi:
          type: string
          description: |
            The International mobile subscriber identity. It is a number that
            uniquely identifies every user of a cellular network.
          example: '460001357924680'
        msisdn:
          type: string
          description: |
            A number uniquely identifying a subscription in a Global System
            for Mobile communications or a Universal Mobile Telecommunications
            System mobile network.
          example: '33123456789'
        subscriptionPackageName:
          type: string
          description: |
            Subscription package name
          example: 86000001_002_SP_12
        subscriptionPackageDescription:
          type: string
          description: |
            Subscription package description
          example: SP for roaming
        status:
          type: string
          description: Subscription state.
          example: ACTIVE
        subscriptionState:
          type: string
          description: Subscription state.
          example: ACTIVE
        organizationId:
          type: string
          description: |
            Dot seperated hierarchical list of IDs of Enterprise,Operator and
            Reseller
          example: 3.97.3
        operatorId:
          type: string
          description: The ID of the operator.
          example: '86000001'
        operatorName:
          type: string
          description: |
            The name of the operator.
          example: Operator A
        assignedImei:
          type: string
          description: |
            IMEI number assigned by the user.
          example: '49015420323652'
        networkDetails:
          $ref: '#/components/schemas/networkDetails'

    networkDetails:
      type: object
      properties:
        detectedImei:
          type: string
          description: IMEI number detected by the network event.
          example: '49015420323652'
        lastEventReceivedAt:
          type: string
          description: |
            Timestamp for the last event received for the session.
          example: 2022-02-13T22:20:23.922Z
        firstEventReceivedAt:
          type: string
          description: |
            Timestamp for the first event in the specified time window
            (60 days).
          example: 2022-02-13T22:20:23.922Z
        lastLocationUpdates:
          $ref: '#/components/schemas/lastLocationUpdates'
        data:
          $ref: '#/components/schemas/data'
        sms:
          $ref: '#/components/schemas/sms'

    lastLocationUpdates:
      type: array
      description: Last Location Update.
      items:
        $ref: '#/components/schemas/locationUpdateItem'

    locationUpdateItem:
      type: object
      description: Location update item.
      properties:
        type:
          type: string
          x-extensible-enum:
            - VOICE_CONNECTION_2G3G
            - DATA_CONNECTION_2G3G
            - DATA_CONNECTION_4G5G
          description: |
            The network connection types for the location update:
              VOICE_CONNECTION_2G3G: GSM connection
              DATA_CONNECTION_2G3G: GPRS connection
              DATA_CONNECTION_4G5G: LTE connection
        status:
          type: string
          x-extensible-enum:
            - 0_SUCCESS
            - 1_FAILURE
          description: |
            The status of the overall location update is as follows:
              0: Success
              1: Failure
        updatedAt:
          type: string
          description: The time of the last location update.
        vlrGt:
          type: string
          description: The Visitor Location Register (VLR) global title
            according to E.164.
        countryCode:
          type: string
          description: ISO3166 two-letter Country Code.
        countryName:
          type: string
          description: Country name.
        operatorName:
          type: string
          description: The operator name.
        roamingOperatorName:
          type: string
          description: The roaming operator name.

    data:
      type: object
      properties:
        dataActive:
          type: boolean
          description: |
            Optional. Indicates if the PDP is active. The possible values are:
            - true
            - false
        dataActivatedAt:
          type: string
          description: The start time of last PDP session of the day.
          example: 2013-09-30T06:51:34.000Z
        ipv4:
          type: string
          format: ipv4
          description: Last IPv4 address of the SIM in the mobile network for
            the specified time window (60 days).
        ipv6:
          type: string
          format: ipv6
          description: Last IPv6 address of the SIM in the mobile network for
            the specified time window (60 days).
        apn:
          type: string
          description: Last fully qualified domain name for the specified time
            window (60 days)
        uploadedBytes:
          type: number
          format: double
          description: |
            Accumulated transmitted bytes for the day (reset daily) in
            double-precision floating-point format.
        lastUploadedAt:
          type: string
          description: The timestamp of the last transmitted data. It is reset
            daily.
        downloadedBytes:
          type: number
          format: double
          description: |
            Accumulated received bytes for the day (reset daily) in
            double-precision floating-point format.
        lastDownloadedAt:
          type: string
          description: The timestamp of the last received data. It is reset
            daily.
        giDestAddress:
          type: string
          format: ipv4
          description: IPv4 address of the SIM on the Internet.
        sessionDetails:
          type: array
          description: |
            GPRS, 3G, 4G or 5G sessions for the last 72 hours. Sessions are
            sorted by startedAt ascendlingly, i.g. from oldest to newest.
          maxItems: 10
          items:
            $ref: '#/components/schemas/session'
    sms:
      type: object
      description: |
        Sms recieved and sent detail.
      properties:
        sent:
          $ref: '#/components/schemas/smsSent'
        received:
          $ref: '#/components/schemas/smsReceived'
        error:
          $ref: '#/components/schemas/smsError'

    smsSent:
      type: object
      description: SMS origination information. It is reset daily.
      properties:
        count:
          type: integer
          format: int32
          minimum: 0
          description: Reset daily. The number of mobile originated SMSes.
        lastDestAddress:
          type: string
          description: Reset daily. The MSISDN the last SMS was sent to.
        lastSmsSentAt:
          type: string
          description: Reset daily. The timestamp of the last mobile
            originated SMS.
        errorCount:
          type: integer
          format: int32
          minimum: 0
          description: Reset daily. Error count.

    smsReceived:
      type: object
      description: SMS termination information. It is reset daily.
      properties:
        count:
          type: integer
          format: int32
          minimum: 0
          description: Reset daily. The number of mobile terminated SMSes.
        lastSmsReceivedAt:
          type: string
          description: Reset daily. The timestamp of the last mobile
            terminated SMS.
        errorCount:
          type: integer
          format: int32
          minimum: 0
          description: Optional. Reset daily. Error count.

    smsError:
      type: object
      description: SMS error infomation.
      properties:
        lastErrorAt:
          type: string
          description: Timestamp of last SMS error
        lastError:
          type: string
          description: Last error description.

    session:
      type: object
      description: Session information.
      properties:
        apn:
          type: string
          description: Access Point Name of the session.
          example: B.MAG.CXN
        ipv4:
          type: string
          description: IPv4 address of the session in the mobile network.
          example: 198.51.100.42
        ipv6:
          type: string
          description: IPv6 address of the session in the mobile network.
          example: 2001:0db8:5b96:0000:0000:426f:8e17:642a
        startedAt:
          type: string
          description: Timestamp for the start of the session.
          example: 2022-02-13T22:10:23.922Z
        endedAt:
          type: string
          description: Timestamp for the end of the session.
          example: 2022-02-13T22:20:23.922Z

    devices:
      type: object
      properties:
        devices:
          type: array
          items:
            $ref: '#/components/schemas/deviceDetail'
        next:
          type: string

    deviceDetail:
      type: object
      properties:
        type:
          type: string
          description: |
            SIM type.
          example: ESIM, SIM
        idType:
          type: string
          description: |
            SIM profile key type.
          example: EID, ICCID
        value:
          type: string
          description: |
            SIM profile key value of specified key type.
          example: '0090923122299992358129036544309'
        euiccType:
          type: string
          description: Type of eUICC.
          example: M2M
        subscriptions:
          type: array
          items:
            $ref: '#/components/schemas/subscriptions'

    subscriptions:
      type: object
      properties:
        iccId:
          type: string
        imsi:
          type: string
        status:
          type: string
        subscriptionState:
          type: string
          description: |
            Subscription state.
        msisdn:
          type: string

    euiccOrderParam:
      enum:
        - EID
        - ICCID
        - IMSI
        - STATUS
        - SUBSCRIPTIONSTATE
        - MSISDN
        - EUICCTYPE
      type: string

    Problem:
      type: object
      properties:
        type:
          type: string
          format: uri
          description: |
            An absolute URI that identifies the problem type.
            When dereferenced, it SHOULD provide human-readable
            documentation for the problem type (e.g., using HTML).
          default: about:blank
          example: https://your.api.documentation.url
        title:
          type: string
          description: |
            A short, summary of the problem type. Written in english and
            readable for engineers (usually not suited for non technical
            stakeholders and not localized); example: Service Unavailable
        status:
          type: integer
          format: int32
          description: |
            The HTTP status code generated by the origin server for
            this occurrence of the problem.
          minimum: 100
          maximum: 600
          exclusiveMaximum: true
          example: 503
        detail:
          type: string
          description: |
            A human readable explanation specific to this occurrence of the
            problem.
          example: Connection to database timed out
        instance:
          type: string
          format: uuid
          description: |
            An UUID, taking the 'X-Flow-ID' header value coming from upstream
            service, referencing this specific request. Empty if the header is
            absent.
  responses:
    RateLimitedResponse:
      headers:
        X-RateLimit-Limit-Second:
          $ref: '#/components/headers/X-RateLimit-Limit-Second'
        X-RateLimit-Limit-Minute:
          $ref: '#/components/headers/X-RateLimit-Limit-Minute'
        X-RateLimit-Remaining-Second:
          $ref: '#/components/headers/X-RateLimit-Remaining-Second'
        X-RateLimit-Remaining-Minute:
          $ref: '#/components/headers/X-RateLimit-Remaining-Minute'
        Content-Type:
          $ref: '#/components/headers/Content-Type'
    '400':
      description: Bad Request
      headers:
        Content-Type:
          $ref: '#/components/headers/Content-Type'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            response:
              value:
                type: 'https://www.iana.org/assignments/http-status-codes/'
                title: 'Bad Request'
                status: 400
                detail: 'orgId can not be null'
                instance: "123e4567-e89b-12d3-a456-426614174000"
    '401':
      description: Unauthorized
      headers:
        Content-Type:
          $ref: '#/components/headers/Content-Type'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            response:
              value:
                type: 'https://www.iana.org/assignments/http-status-codes/'
                title: 'Unauthorized'
                status: 401
                detail: "Token expired"
                instance: "123e4567-e89b-12d3-a456-426614174000"

    '403':
      description: Forbidden
      headers:
        Content-Type:
          $ref: '#/components/headers/Content-Type'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            response:
              value:
                type: 'https://www.iana.org/assignments/http-status-codes/'
                title: 'Forbidden'
                status: 403
                detail: "You do not have access to the resource"
                instance: "123e4567-e89b-12d3-a456-426614174000"

    '405':
      description: Method Not Allowed
      headers:
        Content-Type:
          $ref: '#/components/headers/Content-Type'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    '404':
      description: Not Found
      headers:
        Content-Type:
          $ref: '#/components/headers/Content-Type'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            response:
              value:
                type: 'https://www.iana.org/assignments/http-status-codes/'
                title: 'Not Found'
                status: 404
                detail: "Not Found"
                instance: "123e4567-e89b-12d3-a456-426614174000"
    '429':
      description: Too Many Requests
      allOf:
        - $ref: '#/components/responses/RateLimitedResponse'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            response:
              value:
                type: 'https://www.iana.org/assignments/http-status-codes/'
                title: 'Too Many Requests'
                status: 429
                detail: "API rate limit exceeded"
                instance: "123e4567-e89b-12d3-a456-426614174000"
    '500':
      description: Internal Server Error
      headers:
        Content-Type:
          $ref: '#/components/headers/Content-Type'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            response:
              value:
                type: 'https://www.iana.org/assignments/http-status-codes/'
                title: 'Internal Server Error'
                status: 500
                detail: 'Internal Server Error'
                instance: "123e4567-e89b-12d3-a456-426614174000"
  headers:
    Content-Type:
      description: Handle Content-Type
      schema:
        type: string
    X-RateLimit-Limit-Second:
      description: The maximum number of requests allowed in a second.
      schema:
        type: integer
        format: int32
    X-RateLimit-Limit-Minute:
      description: The maximum number of requests allowed in a minute.
      schema:
        type: integer
        format: int32
    X-RateLimit-Remaining-Second:
      description: The number of requests remaining in a second.
      schema:
        type: integer
        format: int32
    X-RateLimit-Remaining-Minute:
      description: The number of requests remaining in a minute.
      schema:
        type: integer
        format: int32

  parameters:
    Ericsson-IOT-Platform:
      name: Ericsson-IOT-Platform
      in: header
      description: Connectivity Management Platform value to be specified.
        By default, "IOTA" will be considered as the platform type.
      schema:
        type: string
        x-extensible-enum: [IOTA]
        example: IOTA
    Header-Authorization:
      name: Authorization
      in: header
      required: true
      description: A valid token string in the form Bearer <token string>
      schema:
        type: string
    sortParam:
      in: query
      name: order
      schema:
        type: string
        x-extensible-enum:
          - EID_ASC
          - EID_DESC
          - EUICCTYPE_ASC
          - EUICCTYPE_DESC
          - ICCID_ASC
          - ICCID_DESC
          - IMSI_ASC
          - IMSI_DESC
          - MSISDN_ASC
          - MSISDN_DESC
          - STATUS_ASC
          - STATUS_DESC
          - SUBSCRIPTIONSTATE_ASC
          - SUBSCRIPTIONSTATE_DESC
      description: |
        Parameter containing sort field and sort mode. First part selects
        field to sort on, the second part the order.

        _Available values:_

        - EID_ASC
        - EID_DESC
        - EUICCTYPE_ASC
        - EUICCTYPE_DESC
        - ICCID_ASC
        - ICCID_DESC
        - IMSI_ASC
        - IMSI_DESC
        - MSISDN_ASC
        - MSISDN_DESC
        - STATUS_ASC
        - STATUS_DESC
        - SUBSCRIPTIONSTATE_ASC
        - SUBSCRIPTIONSTATE_DESC
    pageSizeParam:
      in: query
      name: pageSize
      schema:
        type: integer
        default: 100
      description: |
        Specifies the maximum number of results to be returned.
        Allowed interval is 1-10000.
    cursorParam:
      in: query
      name: cursor
      schema:
        type: string
      example: 'DFVSDB3434%DFB%EYY445'
      description: |
        Encoded string parameter used for pagination. This field is
        automatically populated in the response field "next" if there
        are more results in the system than delivered in the response.
  securitySchemes:
    OAuth2:
      type: oauth2
      description: The resources in the API are protected using the
        OAuth 2.0 protocol with the password grant flow.
      flows:
        password:
          tokenUrl: https://iot-api.aeris.com/iot/api/auth/token
          scopes:
            cnx_euicc_inventory: Grant user read access to device inventory
              resource
            cnx_subscriptions_view: Grant user access to subscriptions
              inventory resource
            cnx_subscription_view2: Grant user access to subscription
              inventory resource
            cnx_show_movesim_action: Grant user access to change
              subscription owner
            cnx_search_traffic: Grant user access to subscription traffic
              search resource
            cnx_traffic_analytics: Grant user read access to traffic analytics
              view
