> ## 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 Public Devices

> Mengambil daftar perangkat beserta metadata sensor yang tersedia menggunakan APIKey ID tanpa autentikasi.



## OpenAPI

````yaml GET /{api-key}/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:
  /{api-key}/devices:
    get:
      tags:
        - Devices
      summary: Get list devices (Public Access)
      description: >-
        Mengambil daftar perangkat beserta metadata sensor yang tersedia
        menggunakan APIKey ID tanpa autentikasi.
      operationId: getDevicesByAPIKey
      parameters:
        - name: api-key
          in: path
          required: true
          schema:
            type: string
          description: API Key untuk akses publik
          example: mertani-abc123
      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
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '429':
          $ref: '#/components/responses/TooManyRequests'
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
    Forbidden:
      description: Forbidden
      content:
        application/json:
          example:
            message: Forbidden
            data: null
    NotFound:
      description: Device not found
      content:
        application/json:
          example:
            message: Device not found
            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

````