> ## 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.

# Receive Realtime Data

> Endpoint ini digunakan untuk simulasi webhook di playground. Dalam produksi, Mertani akan mengirim data ke endpoint Anda.



## OpenAPI

````yaml POST /webhook/sensor-data
openapi: 3.0.3
info:
  title: Mertani Webhook API
  version: 3.0.0
  description: Webhook untuk menerima data dari sistem Mertani
servers:
  - url: https://yourdomain.co.id/external/v1
security: []
tags:
  - name: Webhook
    description: Webhook endpoints
paths:
  /webhook/sensor-data:
    post:
      tags:
        - Webhook
      summary: Receive sensor webhook
      description: >-
        Endpoint ini digunakan untuk simulasi webhook di playground. Dalam
        produksi, Mertani akan mengirim data ke endpoint Anda.
      operationId: receiveSensorWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookEnvelope'
            examples:
              minimal:
                summary: Payload minimal
                value:
                  event: sensor.data
                  device_id: MTI-001
                  timestamp: '2026-05-05T10:00:00Z'
                  data:
                    temperature: 28.5
              multi-sensor:
                summary: Payload multi sensor
                value:
                  event: sensor.data
                  device_id: MTI-002
                  timestamp: '2026-05-05T10:00:00Z'
                  data:
                    sensors:
                      - id: temp
                        value: 28.5
                      - id: humidity
                        value: 80
              full:
                summary: Payload lengkap
                value:
                  event: sensor.data
                  device_id: MTI-003
                  timestamp: '2026-05-05T10:00:00Z'
                  data:
                    sensors:
                      - id: temp
                        value: 29.1
                        unit: C
                      - id: rain
                        value: 12.5
                        unit: mm
                  metadata:
                    source: iot-device
                    firmware: v1.2.3
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookResponse'
              example:
                message: Data received successfully
        '401':
          description: Unauthorized
        '429':
          description: Too Many Requests
      security:
        - webhookApiKey: []
components:
  schemas:
    WebhookEnvelope:
      type: object
      required:
        - event
        - device_id
        - timestamp
        - data
      properties:
        event:
          type: string
          example: sensor.data
        device_id:
          type: string
          example: MTI-001
        timestamp:
          type: string
          format: date-time
        data:
          type: object
          description: Payload fleksibel sesuai jenis device
        metadata:
          type: object
          description: Optional metadata
          nullable: true
    WebhookResponse:
      type: object
      properties:
        message:
          type: string
          example: Data received successfully
  securitySchemes:
    webhookApiKey:
      type: apiKey
      in: header
      name: X-API-KEY

````