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

# Get Devices

> Mengambil daftar perangkat beserta metadata sensor yang tersedia.



## OpenAPI

````yaml GET /devices
openapi: 3.0.3
info:
  title: Mertani External API
  version: 3.0.0
  description: API untuk akses data perangkat IoT Mertani
servers:
  - url: https://app.mertani.co.id/external/v1
security: []
tags:
  - name: Devices
    description: Device management
  - name: Sensor Data
    description: Sensor readings
paths:
  /devices:
    get:
      tags:
        - Devices
      summary: Get list devices
      description: Mengambil daftar perangkat beserta metadata sensor yang tersedia.
      operationId: getDevices
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDevicesResponse'
              examples:
                success:
                  summary: Contoh response sukses
                  value:
                    message: Success
                    data:
                      - device_id: DEV-001-ABC123
                        name: AWLR SUNGAI CONTOH 1
                        type: AWLR
                        lat: -7.7956
                        long: 110.3695
                        interval_seconds: 1800
                        last_update_at: '2026-05-05T10:00:00Z'
                        sensors:
                          - sensor_id: ABC1-batt
                            name: Battery Level
                            type: BATTERY
                            unit: '%'
                          - sensor_id: ABC1-water
                            name: Water Level
                            type: FLUID_LEVEL
                            unit: cm
                          - sensor_id: ABC1-signal
                            name: Signal Strength
                            type: CELLULAR_SIGNAL
                            unit: dBm
                      - device_id: DEV-002-XYZ789
                        name: AWS CUACA CONTOH 2
                        type: AWS
                        lat: -7.8012
                        long: 110.3649
                        interval_seconds: 3600
                        last_update_at: '2026-05-05T09:30:00Z'
                        sensors:
                          - sensor_id: XYZ7-temp
                            name: Air Temperature
                            type: AIR_TEMPERATURE
                            unit: °C
                          - sensor_id: XYZ7-hum
                            name: Air Humidity
                            type: AIR_HUMIDITY
                            unit: '%RH'
                          - sensor_id: XYZ7-rain
                            name: Rainfall
                            type: RAIN_FALL
                            unit: mm
                          - sensor_id: XYZ7-wind
                            name: Wind Speed
                            type: WIND_SPEED
                            unit: m/s
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - basicAuth: []
components:
  schemas:
    GetDevicesResponse:
      type: object
      properties:
        message:
          type: string
          example: Success
        data:
          type: array
          items:
            $ref: '#/components/schemas/DeviceDetail'
    DeviceDetail:
      type: object
      properties:
        device_id:
          type: string
        name:
          type: string
        type:
          type: string
        lat:
          type: number
        long:
          type: number
        interval_seconds:
          type: integer
        last_update_at:
          type: string
          format: date-time
        sensors:
          type: array
          items:
            $ref: '#/components/schemas/DeviceSensorMeta'
    DeviceSensorMeta:
      type: object
      properties:
        sensor_id:
          type: string
        name:
          type: string
        type:
          type: string
        unit:
          type: string
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          example:
            message: Bad Request
            data: null
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          example:
            message: Unauthorized
            data: null
    Forbidden:
      description: Forbidden
      content:
        application/json:
          example:
            message: Forbidden
            data: null
    MethodNotAllowed:
      description: Method Not Allowed
      content:
        application/json:
          example:
            message: Method Not Allowed
            data: null
    TooManyRequests:
      description: Too Many Requests
      content:
        application/json:
          example:
            message: To Many Request
            data: null
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````