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

# Store a Netafim irrigation-head reading

> Requires a token linked to this head with the exclusive
`write:irrigation-head-readings` scope. Send one snapshot per request.
Reuse the same idempotency key when retrying that snapshot. The server
resolves the company and project from the head linked to the token.




## OpenAPI

````yaml /openapi.yaml post /api/control/irrigation/external-heads/{did}/readings
openapi: 3.0.3
info:
  title: Hydrobit B2B API
  version: 2.0.0
  description: |
    Public B2B API documentation for Harvest and Phytosanitary data.

    All endpoints require a scoped API token sent in the `Authorization` header:
    `Bearer <keyId>.<token>`.

    API access is available for Corporate accounts. For access or support,
    contact support@hydrobit.ag.
  contact:
    name: Hydrobit Support
    url: https://hydrobit.ag
    email: support@hydrobit.ag
  license:
    name: Proprietary
    url: https://www.hydrobit.ag/terms-conditions
servers:
  - url: https://api.hydrobit.ag
    description: Production server
security:
  - apiTokenAuth: []
tags:
  - name: Irrigation
    description: External irrigation-head readings.
  - name: Harvest
    description: >-
      External B2B endpoints for harvest production sessions and per-worker
      breakdowns.
  - name: Phytosanitary
    description: External B2B endpoints for phytosanitary monitoring and analysis.
paths:
  /api/control/irrigation/external-heads/{did}/readings:
    post:
      tags:
        - Irrigation
      summary: Store a Netafim irrigation-head reading
      description: |
        Requires a token linked to this head with the exclusive
        `write:irrigation-head-readings` scope. Send one snapshot per request.
        Reuse the same idempotency key when retrying that snapshot. The server
        resolves the company and project from the head linked to the token.
      operationId: storeNetafimReading
      parameters:
        - name: did
          in: path
          required: true
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          required: true
          description: UUID assigned to one capture and preserved across retries.
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - reading
              additionalProperties: false
              properties:
                reading:
                  type: object
                  minProperties: 1
                  additionalProperties: true
                  description: >-
                    Complete Netafim report. Metric fields accept null for
                    missing values.
                recordedAt:
                  type: string
                  format: date-time
                  description: >-
                    Measured time with Z or a confirmed offset. Omit when the
                    offset is unknown.
            example:
              reading:
                controllerTime: '2026-11-15 09:30:00'
                Flow: 0
                Ec_Act: null
                Ph_Act: 6.4
                Water_Act_Qty: 0
                waterUnit: m3
                alarmOn: false
                valves: []
                dosingChannels: []
              recordedAt: '2026-11-15T09:30:00-06:00'
      responses:
        '200':
          description: Identical retry. Returns the original snapshot id.
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                properties:
                  id:
                    type: string
        '201':
          description: Snapshot stored.
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                properties:
                  id:
                    type: string
        '400':
          description: Invalid idempotency key, reading or recordedAt.
        '401':
          description: Invalid, expired or revoked token.
        '403':
          description: Token is not allowed to write to this head in this environment.
        '409':
          description: The idempotency key was already used for different data.
        '413':
          description: Reading exceeds 256 KiB.
        '415':
          description: Unsupported content type or encoding.
        '429':
          description: Configured token rate limit exceeded.
        '503':
          description: Receiver unavailable. Retry using the same idempotency key.
      security:
        - apiTokenAuth: []
components:
  securitySchemes:
    apiTokenAuth:
      type: http
      scheme: bearer
      bearerFormat: keyId.token
      description: |
        Scoped API token for external B2B endpoints. Send it in the
        `Authorization` header as `Bearer <keyId>.<token>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.