Skip to content

Hydrobit API (2.0.0)

Comprehensive API documentation for the Hydrobit platform.

This API enables management of forms, records, workers, projects, and related data within Hydrobit.

Authentication

  • User endpoints: Require a JWT in the Authorization header (Bearer token).

Features

  • Form management and record submission
  • Project and sector data retrieval
  • Worker management and operations
  • Production session and record management

Note: API access is available for Corporate accounts. For access or support, contact support@hydrobit.ag.

Download OpenAPI description
Overview
Languages
Servers
Mock server
https://docs.hydrobit.ag/_mock/spec/openapi/
Production server
https://api.hydrobit.ag/
IoT server
https://iot.hydrobit.ag/
MQTT over WebSocket endpoint
wss://iot.hydrobit.ag/

Forms

Endpoints for form management and record submission

Operations

Projects

Endpoints for project and sector data retrieval

Operations

Workers

Endpoints for worker management and operations

Operations

Production Sessions

Endpoints for managing production sessions (open, close, update)

Operations

Create a new production session

Request

Opens a new production session for a specific project, sector, and day.

Requires JWT token authentication in the Authorization header.

Key features:

  • Automatically resolves company context from authenticated user
  • Resolves project timezone for day normalization
  • Ensures uniqueness: only one open session per (company, project, day, sector)
  • Supports custom pricing, bonuses, and duration settings
  • Defaults are inherited from project configuration if not provided
Security
bearerAuth
Bodyapplication/jsonrequired
auth0Idstringrequired

User identifier (internal use, derived from JWT token)

Example: "user_123456789"
projectIdstringrequired

Project identifier

Example: "proj_123"
openedAtstring(date-time)required

Session opening timestamp in ISO 8601 UTC format (will be normalized to project timezone for day calculation)

Example: "2025-10-19T08:00:00.000Z"
sectorIdstringrequired

Sector identifier

Example: "sector_001"
sector_namestringrequired

Sector name

Example: "Lote A-1"
samplingUnitstring

Unit of measurement (defaults to project setting)

Example: "box"
pricePerUnitnumber>= 0

Price per unit (defaults to project setting)

Example: 5.5
bonusobject(Bonus)
maxDurationHoursinteger[ 1 .. 24 ]

Maximum session duration in hours (defaults to 12)

Example: 12
notesstring<= 500 characters

Optional notes

Example: "Good weather today"
curl -i -X POST \
  https://docs.hydrobit.ag/_mock/spec/openapi/api/control/production/sessions \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "auth0Id": "user_123456789",
    "projectId": "proj_123",
    "openedAt": "2025-10-19T08:00:00.000Z",
    "sectorId": "sector_001",
    "sector_name": "Lote A-1"
  }'

Responses

Session created successfully

Bodyapplication/json
statusstring
Example: "success"
dataobject(ProductionSession)
Response
application/json
{ "status": "success", "data": { "sessionId": "6507f1e3c9d8e2a4b1f9c3d5", "companyId": "comp_12345", "projectId": "proj_123", "auth0Id": "user_123456789", "sectorId": "sector_001", "sector_name": "Lote A-1", "timezone": "America/Mexico_City", "day": "2025-10-19T00:00:00.000Z", "status": "open", "openedAt": "2025-10-19T08:00:00.000Z", "closedAt": null, "maxDurationHours": 12, "samplingUnit": "box", "pricePerUnit": 5.5, "bonus": { … }, "totals": { … }, "notes": "Good weather conditions" } }

Get a production session

Request

Retrieves detailed information about a specific production session.

Requires JWT token authentication in the Authorization header.

Only the session owner (user who opened it) can view the session.

Security
bearerAuth
Path
sessionIdstringrequired

Session identifier (unique identifier)

Example: 6507f1e3c9d8e2a4b1f9c3d5
curl -i -X GET \
  https://docs.hydrobit.ag/_mock/spec/openapi/api/control/production/sessions/6507f1e3c9d8e2a4b1f9c3d5 \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Session retrieved successfully

Bodyapplication/json
statusstring
Example: "success"
dataobject(ProductionSession)
Response
application/json
{ "status": "success", "data": { "sessionId": "6507f1e3c9d8e2a4b1f9c3d5", "companyId": "comp_12345", "projectId": "proj_123", "auth0Id": "user_123456789", "sectorId": "sector_001", "sector_name": "Lote A-1", "timezone": "America/Mexico_City", "day": "2025-10-19T00:00:00.000Z", "status": "open", "openedAt": "2025-10-19T08:00:00.000Z", "closedAt": null, "maxDurationHours": 12, "samplingUnit": "box", "pricePerUnit": 5.5, "bonus": { … }, "totals": { … }, "notes": "Good weather conditions" } }

Update session metadata

Request

Updates metadata of an open production session.

Requires JWT token authentication in the Authorization header.

Only the session owner can update. Session must be open.

Updatable fields: samplingUnit, pricePerUnit, bonus, notes

Security
bearerAuth
Path
sessionIdstringrequired

Session identifier (unique identifier)

Example: 6507f1e3c9d8e2a4b1f9c3d5
Bodyapplication/jsonrequired
auth0Idstringrequired

User identifier (internal use, derived from JWT token)

Example: "user_123456789"
samplingUnitstring
Example: "kg"
pricePerUnitnumber>= 0
Example: 6
bonusobject(Bonus)
notesstring<= 500 characters
Example: "Updated notes"
curl -i -X PATCH \
  https://docs.hydrobit.ag/_mock/spec/openapi/api/control/production/sessions/6507f1e3c9d8e2a4b1f9c3d5 \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "auth0Id": "user_123456789",
    "samplingUnit": "kg",
    "pricePerUnit": 6,
    "bonus": {
      "type": "percent",
      "value": 10,
      "note": "High quality bonus"
    },
    "notes": "Updated notes"
  }'

Responses

Session updated successfully

Bodyapplication/json
statusstring
Example: "success"
dataobject
Response
application/json
{ "status": "success", "data": { "updated": true } }

Close a production session

Request

Closes an open production session.

Requires JWT token authentication in the Authorization header.

Only the session owner can close it. Session must be open.

Security
bearerAuth
Path
sessionIdstringrequired

Session identifier (unique identifier)

Example: 6507f1e3c9d8e2a4b1f9c3d5
Bodyapplication/jsonrequired
auth0Idstringrequired

User identifier (internal use, derived from JWT token)

Example: "user_123456789"
curl -i -X POST \
  https://docs.hydrobit.ag/_mock/spec/openapi/api/control/production/sessions/6507f1e3c9d8e2a4b1f9c3d5/close \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "auth0Id": "user_123456789"
  }'

Responses

Session closed successfully

Bodyapplication/json
statusstring
Example: "success"
dataobject
Response
application/json
{ "status": "success", "data": { "sessionId": "6507f1e3c9d8e2a4b1f9c3d5", "status": "closed", "closedAt": "2025-10-19T18:00:00.000Z" } }

Extend session duration

Request

Extends the maximum duration of an open production session.

Requires JWT token authentication in the Authorization header.

Only the session owner can extend it. Session must be open.

Security
bearerAuth
Path
sessionIdstringrequired

Session identifier (unique identifier)

Example: 6507f1e3c9d8e2a4b1f9c3d5
Bodyapplication/jsonrequired
auth0Idstringrequired

User identifier (internal use, derived from JWT token)

Example: "user_123456789"
maxDurationHoursinteger[ 1 .. 24 ]required

New maximum duration in hours

Example: 18
curl -i -X POST \
  https://docs.hydrobit.ag/_mock/spec/openapi/api/control/production/sessions/6507f1e3c9d8e2a4b1f9c3d5/extend \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "auth0Id": "user_123456789",
    "maxDurationHours": 18
  }'

Responses

Session extended successfully

Bodyapplication/json
statusstring
Example: "success"
dataobject
Response
application/json
{ "status": "success", "data": { "maxDurationHours": 18 } }

Production Records

Endpoints for creating and managing production records

Operations

Phytosanitary

Endpoints for phytosanitary monitoring and analysis (pest/disease tracking)

Operations

Weather

Endpoints for weather and climate data retrieval

Operations

Plant

Endpoints for plant monitoring, growth, and health data

Operations

Irrigation

Endpoints for irrigation control, logs, and automation

Operations

IoT Endpoint

Endpoints for IoT devices, telemetry, and field data integration

Operations