{
  "openapi": "3.0.3",
  "info": {
    "title": "IRIS Cloud Connect API",
    "version": "1.0.0",
    "description": "Read machine and production data for your organization. Create and manage your API tokens in the IRIS Cloud account interface."
  },
  "tags": [
    {
      "name": "Machines",
      "description": "Machines, sensors, measurements, alarms and alerts."
    },
    {
      "name": "Batches",
      "description": "Production batches and batch details."
    }
  ],
  "paths": {
    "/api/v1/batches": {
      "get": {
        "description": "Lists production batches for the organization that owns the API key token.",
        "parameters": [
          {
            "description": "Page number. Default: 1.",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Page size. Default: 10. Maximum: 1000.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "maximum": 1000,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Sort field. Allowed values: start_time, end_time, batch_id, recipe.",
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Sort direction. Allowed values: ASC or DESC. Default: DESC.",
            "in": "query",
            "name": "order",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional exact batch status filter.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "COMPLETED",
                "CONCLUDED",
                "CANCELLED",
                "IN_OPERATION",
                "STOPPED",
                "LOADING",
                "COMPLETED_BEFORE_TARGET",
                "COMPLETED_WITH_TARGET_UPDATES"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchListResponse"
                }
              }
            },
            "description": "Paginated batch list."
          },
          "400": {
            "content": {
              "application/json": {
                "examples": {
                  "invalidLimit": {
                    "summary": "Invalid limit",
                    "value": {
                      "code": "validation_error",
                      "message": "limit must be a positive integer",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidOrder": {
                    "summary": "Invalid sort direction",
                    "value": {
                      "code": "validation_error",
                      "message": "order must be ASC or DESC",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidPage": {
                    "summary": "Invalid page",
                    "value": {
                      "code": "validation_error",
                      "message": "page must be a positive integer",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidSort": {
                    "summary": "Invalid sort field",
                    "value": {
                      "code": "validation_error",
                      "message": "sort must be one of start_time, end_time, batch_id or recipe",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidStatus": {
                    "summary": "Invalid batch status",
                    "value": {
                      "code": "validation_error",
                      "message": "status must be one of COMPLETED, CONCLUDED, CANCELLED, IN_OPERATION, STOPPED, LOADING, COMPLETED_BEFORE_TARGET, COMPLETED_WITH_TARGET_UPDATES",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "limitTooLarge": {
                    "summary": "Limit exceeds maximum",
                    "value": {
                      "code": "validation_error",
                      "message": "limit must be less than or equal to 1000",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid page, limit, sort, order or status filter."
          },
          "401": {
            "content": {
              "application/json": {
                "examples": {
                  "expiredToken": {
                    "summary": "Token has expired",
                    "value": {
                      "code": "token_expired",
                      "message": "Token has expired.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidToken": {
                    "summary": "Token is invalid",
                    "value": {
                      "code": "invalid_token",
                      "message": "Invalid public API token.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "missingToken": {
                    "summary": "Bearer token is missing",
                    "value": {
                      "code": "missing_token",
                      "message": "Missing bearer token.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "revokedToken": {
                    "summary": "Token has been revoked",
                    "value": {
                      "code": "token_revoked",
                      "message": "Token has been revoked.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing or invalid public API token."
          },
          "502": {
            "content": {
              "application/json": {
                "examples": {
                  "dependencyFailure": {
                    "summary": "Dependency request failed",
                    "value": {
                      "code": "batches_failed",
                      "message": "Unable to retrieve batches.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Batch service request failed."
          },
          "503": {
            "content": {
              "application/json": {
                "examples": {
                  "dependencyFailure": {
                    "summary": "Dependency request failed",
                    "value": {
                      "code": "batches_failed",
                      "message": "Unable to retrieve batches.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Batch service is unavailable."
          },
          "504": {
            "content": {
              "application/json": {
                "examples": {
                  "dependencyFailure": {
                    "summary": "Dependency request failed",
                    "value": {
                      "code": "batches_failed",
                      "message": "Unable to retrieve batches.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Batch service timed out."
          }
        },
        "security": [
          {
            "APIKeyToken": []
          }
        ],
        "summary": "List batches",
        "tags": [
          "Batches"
        ],
        "operationId": "get__api_v1_batches"
      }
    },
    "/api/v1/batches/{id}": {
      "get": {
        "description": "Returns the detailed view of one batch that belongs to the token organization.",
        "parameters": [
          {
            "description": "Batch identifier returned by GET /api/v1/batches.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchDetailsResponse"
                }
              }
            },
            "description": "Detailed batch payload."
          },
          "401": {
            "content": {
              "application/json": {
                "examples": {
                  "expiredToken": {
                    "summary": "Token has expired",
                    "value": {
                      "code": "token_expired",
                      "message": "Token has expired.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidToken": {
                    "summary": "Token is invalid",
                    "value": {
                      "code": "invalid_token",
                      "message": "Invalid public API token.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "missingToken": {
                    "summary": "Bearer token is missing",
                    "value": {
                      "code": "missing_token",
                      "message": "Missing bearer token.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "revokedToken": {
                    "summary": "Token has been revoked",
                    "value": {
                      "code": "token_revoked",
                      "message": "Token has been revoked.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing or invalid public API token."
          },
          "404": {
            "content": {
              "application/json": {
                "examples": {
                  "batchNotFound": {
                    "summary": "Batch not found",
                    "value": {
                      "code": "batch_not_found",
                      "message": "Batch not found.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Batch not found for the token organization."
          },
          "502": {
            "content": {
              "application/json": {
                "examples": {
                  "dependencyFailure": {
                    "summary": "Dependency request failed",
                    "value": {
                      "code": "batch_details_failed",
                      "message": "Unable to retrieve batch details.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Batch service request failed."
          },
          "503": {
            "content": {
              "application/json": {
                "examples": {
                  "dependencyFailure": {
                    "summary": "Dependency request failed",
                    "value": {
                      "code": "batch_details_failed",
                      "message": "Unable to retrieve batch details.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Batch service is unavailable."
          },
          "504": {
            "content": {
              "application/json": {
                "examples": {
                  "dependencyFailure": {
                    "summary": "Dependency request failed",
                    "value": {
                      "code": "batch_details_failed",
                      "message": "Unable to retrieve batch details.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Batch service timed out."
          }
        },
        "security": [
          {
            "APIKeyToken": []
          }
        ],
        "summary": "Get batch details",
        "tags": [
          "Batches"
        ],
        "operationId": "get__api_v1_batches_id_"
      }
    },
    "/api/v1/machines": {
      "get": {
        "description": "Lists the machines visible to the organization that owns the public API token.",
        "parameters": [
          {
            "description": "Optional search by machine name, commission number, ID number or production line.",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional machine status filter.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MachineListResponse"
                }
              }
            },
            "description": "Machines visible to the token organization."
          },
          "401": {
            "content": {
              "application/json": {
                "examples": {
                  "expiredToken": {
                    "summary": "Token has expired",
                    "value": {
                      "code": "token_expired",
                      "message": "Token has expired.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidToken": {
                    "summary": "Token is invalid",
                    "value": {
                      "code": "invalid_token",
                      "message": "Invalid public API token.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "missingToken": {
                    "summary": "Bearer token is missing",
                    "value": {
                      "code": "missing_token",
                      "message": "Missing bearer token.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "revokedToken": {
                    "summary": "Token has been revoked",
                    "value": {
                      "code": "token_revoked",
                      "message": "Token has been revoked.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing or invalid public API token."
          },
          "502": {
            "content": {
              "application/json": {
                "examples": {
                  "dependencyFailure": {
                    "summary": "Dependency request failed",
                    "value": {
                      "code": "machines_list_failed",
                      "message": "Unable to list machines.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Machine service request failed."
          },
          "503": {
            "content": {
              "application/json": {
                "examples": {
                  "dependencyFailure": {
                    "summary": "Dependency request failed",
                    "value": {
                      "code": "machines_list_failed",
                      "message": "Unable to list machines.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Machine service is unavailable."
          },
          "504": {
            "content": {
              "application/json": {
                "examples": {
                  "dependencyFailure": {
                    "summary": "Dependency request failed",
                    "value": {
                      "code": "machines_list_failed",
                      "message": "Unable to list machines.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Machine service timed out."
          }
        },
        "security": [
          {
            "APIKeyToken": []
          }
        ],
        "summary": "List machines",
        "tags": [
          "Machines"
        ],
        "operationId": "get__api_v1_machines"
      }
    },
    "/api/v1/machines/{id}": {
      "get": {
        "description": "Returns one machine from the organization bound to the public API token.",
        "parameters": [
          {
            "description": "Machine identifier returned by GET /api/v1/machines.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MachineDetailsResponse"
                }
              }
            },
            "description": "Machine details and current status."
          },
          "401": {
            "content": {
              "application/json": {
                "examples": {
                  "expiredToken": {
                    "summary": "Token has expired",
                    "value": {
                      "code": "token_expired",
                      "message": "Token has expired.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidToken": {
                    "summary": "Token is invalid",
                    "value": {
                      "code": "invalid_token",
                      "message": "Invalid public API token.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "missingToken": {
                    "summary": "Bearer token is missing",
                    "value": {
                      "code": "missing_token",
                      "message": "Missing bearer token.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "revokedToken": {
                    "summary": "Token has been revoked",
                    "value": {
                      "code": "token_revoked",
                      "message": "Token has been revoked.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing or invalid public API token."
          },
          "404": {
            "content": {
              "application/json": {
                "examples": {
                  "machineNotFound": {
                    "summary": "Machine not found",
                    "value": {
                      "code": "machine_not_found",
                      "message": "Machine not found.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Machine not found for the token organization."
          },
          "502": {
            "content": {
              "application/json": {
                "examples": {
                  "dependencyFailure": {
                    "summary": "Dependency request failed",
                    "value": {
                      "code": "machine_lookup_failed",
                      "message": "Unable to retrieve machine data.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Machine service request failed."
          },
          "503": {
            "content": {
              "application/json": {
                "examples": {
                  "dependencyFailure": {
                    "summary": "Dependency request failed",
                    "value": {
                      "code": "machine_lookup_failed",
                      "message": "Unable to retrieve machine data.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Machine service is unavailable."
          },
          "504": {
            "content": {
              "application/json": {
                "examples": {
                  "dependencyFailure": {
                    "summary": "Dependency request failed",
                    "value": {
                      "code": "machine_lookup_failed",
                      "message": "Unable to retrieve machine data.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Machine service timed out."
          }
        },
        "security": [
          {
            "APIKeyToken": []
          }
        ],
        "summary": "Get machine",
        "tags": [
          "Machines"
        ],
        "operationId": "get__api_v1_machines_id_"
      }
    },
    "/api/v1/machines/{id}/action-logs": {
      "get": {
        "description": "Reserved endpoint for machine operator action logs. The integration is not implemented yet.",
        "parameters": [
          {
            "description": "Machine identifier returned by GET /api/v1/machines.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "401": {
            "content": {
              "application/json": {
                "examples": {
                  "expiredToken": {
                    "summary": "Token has expired",
                    "value": {
                      "code": "token_expired",
                      "message": "Token has expired.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidToken": {
                    "summary": "Token is invalid",
                    "value": {
                      "code": "invalid_token",
                      "message": "Invalid public API token.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "missingToken": {
                    "summary": "Bearer token is missing",
                    "value": {
                      "code": "missing_token",
                      "message": "Missing bearer token.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "revokedToken": {
                    "summary": "Token has been revoked",
                    "value": {
                      "code": "token_revoked",
                      "message": "Token has been revoked.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing or invalid public API token."
          },
          "501": {
            "content": {
              "application/json": {
                "examples": {
                  "notImplemented": {
                    "summary": "Integration not implemented",
                    "value": {
                      "code": "not_implemented",
                      "message": "This integration is not implemented yet.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Action log integration is not implemented yet."
          }
        },
        "security": [
          {
            "APIKeyToken": []
          }
        ],
        "summary": "Get machine action logs",
        "tags": [
          "Machines"
        ],
        "operationId": "get__api_v1_machines_id_action_logs"
      }
    },
    "/api/v1/machines/{id}/alarms": {
      "get": {
        "description": "Returns PLC-generated alarms for the requested machine.",
        "parameters": [
          {
            "description": "Machine identifier returned by GET /api/v1/machines.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "UTC start timestamp. If omitted, the last 7 days are used. The maximum range is 30 days.",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "UTC end timestamp. If omitted, the current time is used.",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MachineAlarmsResponse"
                }
              }
            },
            "description": "PLC-generated alarm history."
          },
          "400": {
            "content": {
              "application/json": {
                "examples": {
                  "invalidFrom": {
                    "summary": "Invalid start timestamp",
                    "value": {
                      "code": "invalid_range",
                      "message": "The from parameter must be a valid RFC3339 timestamp.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidRange": {
                    "summary": "Invalid date range",
                    "value": {
                      "code": "invalid_range",
                      "message": "The from parameter must be before or equal to to.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidTo": {
                    "summary": "Invalid end timestamp",
                    "value": {
                      "code": "invalid_range",
                      "message": "The to parameter must be a valid RFC3339 timestamp.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "rangeTooLarge": {
                    "summary": "Date range exceeds 30 days",
                    "value": {
                      "code": "range_too_large",
                      "message": "Maximum alarms range is 30 days.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid date range."
          },
          "401": {
            "content": {
              "application/json": {
                "examples": {
                  "expiredToken": {
                    "summary": "Token has expired",
                    "value": {
                      "code": "token_expired",
                      "message": "Token has expired.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidToken": {
                    "summary": "Token is invalid",
                    "value": {
                      "code": "invalid_token",
                      "message": "Invalid public API token.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "missingToken": {
                    "summary": "Bearer token is missing",
                    "value": {
                      "code": "missing_token",
                      "message": "Missing bearer token.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "revokedToken": {
                    "summary": "Token has been revoked",
                    "value": {
                      "code": "token_revoked",
                      "message": "Token has been revoked.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing or invalid public API token."
          },
          "404": {
            "content": {
              "application/json": {
                "examples": {
                  "machineNotFound": {
                    "summary": "Machine not found",
                    "value": {
                      "code": "machine_not_found",
                      "message": "Machine not found.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Machine not found for the token organization."
          },
          "502": {
            "content": {
              "application/json": {
                "examples": {
                  "machineLookupFailed": {
                    "summary": "Machine lookup failed",
                    "value": {
                      "code": "machine_lookup_failed",
                      "message": "Unable to retrieve machine data.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "operationFailed": {
                    "summary": "Machine data lookup failed",
                    "value": {
                      "code": "alarms_failed",
                      "message": "Unable to retrieve machine alarms.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Machine service request failed."
          },
          "503": {
            "content": {
              "application/json": {
                "examples": {
                  "machineLookupFailed": {
                    "summary": "Machine lookup failed",
                    "value": {
                      "code": "machine_lookup_failed",
                      "message": "Unable to retrieve machine data.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "operationFailed": {
                    "summary": "Machine data lookup failed",
                    "value": {
                      "code": "alarms_failed",
                      "message": "Unable to retrieve machine alarms.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Machine service is unavailable."
          },
          "504": {
            "content": {
              "application/json": {
                "examples": {
                  "machineLookupFailed": {
                    "summary": "Machine lookup failed",
                    "value": {
                      "code": "machine_lookup_failed",
                      "message": "Unable to retrieve machine data.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "operationFailed": {
                    "summary": "Machine data lookup failed",
                    "value": {
                      "code": "alarms_failed",
                      "message": "Unable to retrieve machine alarms.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Machine service timed out."
          }
        },
        "security": [
          {
            "APIKeyToken": []
          }
        ],
        "summary": "Get machine alarms",
        "tags": [
          "Machines"
        ],
        "operationId": "get__api_v1_machines_id_alarms"
      }
    },
    "/api/v1/machines/{id}/alerts": {
      "get": {
        "description": "Returns platform-generated machine and sensor alerts for the requested machine.",
        "parameters": [
          {
            "description": "Machine identifier returned by GET /api/v1/machines.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "UTC start timestamp. If omitted, the last 7 days are used. The maximum range is 30 days.",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "UTC end timestamp. If omitted, the current time is used.",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MachineAlertsResponse"
                }
              }
            },
            "description": "Platform-generated alert history."
          },
          "400": {
            "content": {
              "application/json": {
                "examples": {
                  "invalidFrom": {
                    "summary": "Invalid start timestamp",
                    "value": {
                      "code": "invalid_range",
                      "message": "The from parameter must be a valid RFC3339 timestamp.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidRange": {
                    "summary": "Invalid date range",
                    "value": {
                      "code": "invalid_range",
                      "message": "The from parameter must be before or equal to to.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidTo": {
                    "summary": "Invalid end timestamp",
                    "value": {
                      "code": "invalid_range",
                      "message": "The to parameter must be a valid RFC3339 timestamp.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "rangeTooLarge": {
                    "summary": "Date range exceeds 30 days",
                    "value": {
                      "code": "range_too_large",
                      "message": "Maximum alerts range is 30 days.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid date range."
          },
          "401": {
            "content": {
              "application/json": {
                "examples": {
                  "expiredToken": {
                    "summary": "Token has expired",
                    "value": {
                      "code": "token_expired",
                      "message": "Token has expired.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidToken": {
                    "summary": "Token is invalid",
                    "value": {
                      "code": "invalid_token",
                      "message": "Invalid public API token.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "missingToken": {
                    "summary": "Bearer token is missing",
                    "value": {
                      "code": "missing_token",
                      "message": "Missing bearer token.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "revokedToken": {
                    "summary": "Token has been revoked",
                    "value": {
                      "code": "token_revoked",
                      "message": "Token has been revoked.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing or invalid public API token."
          },
          "404": {
            "content": {
              "application/json": {
                "examples": {
                  "machineNotFound": {
                    "summary": "Machine not found",
                    "value": {
                      "code": "machine_not_found",
                      "message": "Machine not found.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Machine not found for the token organization."
          },
          "502": {
            "content": {
              "application/json": {
                "examples": {
                  "machineLookupFailed": {
                    "summary": "Machine lookup failed",
                    "value": {
                      "code": "machine_lookup_failed",
                      "message": "Unable to retrieve machine data.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "operationFailed": {
                    "summary": "Machine data lookup failed",
                    "value": {
                      "code": "alerts_failed",
                      "message": "Unable to retrieve machine alerts.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Machine service request failed."
          },
          "503": {
            "content": {
              "application/json": {
                "examples": {
                  "machineLookupFailed": {
                    "summary": "Machine lookup failed",
                    "value": {
                      "code": "machine_lookup_failed",
                      "message": "Unable to retrieve machine data.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "operationFailed": {
                    "summary": "Machine data lookup failed",
                    "value": {
                      "code": "alerts_failed",
                      "message": "Unable to retrieve machine alerts.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Machine service is unavailable."
          },
          "504": {
            "content": {
              "application/json": {
                "examples": {
                  "machineLookupFailed": {
                    "summary": "Machine lookup failed",
                    "value": {
                      "code": "machine_lookup_failed",
                      "message": "Unable to retrieve machine data.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "operationFailed": {
                    "summary": "Machine data lookup failed",
                    "value": {
                      "code": "alerts_failed",
                      "message": "Unable to retrieve machine alerts.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Machine service timed out."
          }
        },
        "security": [
          {
            "APIKeyToken": []
          }
        ],
        "summary": "Get machine alerts",
        "tags": [
          "Machines"
        ],
        "operationId": "get__api_v1_machines_id_alerts"
      }
    },
    "/api/v1/machines/{id}/sensors": {
      "get": {
        "description": "Lists the sensors available for a machine that belongs to the token organization.",
        "parameters": [
          {
            "description": "Machine identifier returned by GET /api/v1/machines.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SensorListResponse"
                }
              }
            },
            "description": "Sensors available for the machine."
          },
          "401": {
            "content": {
              "application/json": {
                "examples": {
                  "expiredToken": {
                    "summary": "Token has expired",
                    "value": {
                      "code": "token_expired",
                      "message": "Token has expired.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidToken": {
                    "summary": "Token is invalid",
                    "value": {
                      "code": "invalid_token",
                      "message": "Invalid public API token.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "missingToken": {
                    "summary": "Bearer token is missing",
                    "value": {
                      "code": "missing_token",
                      "message": "Missing bearer token.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "revokedToken": {
                    "summary": "Token has been revoked",
                    "value": {
                      "code": "token_revoked",
                      "message": "Token has been revoked.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing or invalid public API token."
          },
          "404": {
            "content": {
              "application/json": {
                "examples": {
                  "machineNotFound": {
                    "summary": "Machine not found",
                    "value": {
                      "code": "machine_not_found",
                      "message": "Machine not found.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "missingConfiguration": {
                    "summary": "Machine configuration not found",
                    "value": {
                      "code": "machine_configuration_not_found",
                      "message": "Machine configuration not found.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Machine or machine configuration not found."
          },
          "502": {
            "content": {
              "application/json": {
                "examples": {
                  "configurationLookupFailed": {
                    "summary": "Machine configuration lookup failed",
                    "value": {
                      "code": "machine_configuration_failed",
                      "message": "Unable to retrieve machine configuration.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "machineLookupFailed": {
                    "summary": "Machine lookup failed",
                    "value": {
                      "code": "machine_lookup_failed",
                      "message": "Unable to retrieve machine data.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Machine service request failed."
          },
          "503": {
            "content": {
              "application/json": {
                "examples": {
                  "configurationLookupFailed": {
                    "summary": "Machine configuration lookup failed",
                    "value": {
                      "code": "machine_configuration_failed",
                      "message": "Unable to retrieve machine configuration.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "machineLookupFailed": {
                    "summary": "Machine lookup failed",
                    "value": {
                      "code": "machine_lookup_failed",
                      "message": "Unable to retrieve machine data.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Machine service is unavailable."
          },
          "504": {
            "content": {
              "application/json": {
                "examples": {
                  "configurationLookupFailed": {
                    "summary": "Machine configuration lookup failed",
                    "value": {
                      "code": "machine_configuration_failed",
                      "message": "Unable to retrieve machine configuration.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "machineLookupFailed": {
                    "summary": "Machine lookup failed",
                    "value": {
                      "code": "machine_lookup_failed",
                      "message": "Unable to retrieve machine data.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Machine service timed out."
          }
        },
        "security": [
          {
            "APIKeyToken": []
          }
        ],
        "summary": "List machine sensors",
        "tags": [
          "Machines"
        ],
        "operationId": "get__api_v1_machines_id_sensors"
      }
    },
    "/api/v1/machines/{id}/snapshot": {
      "get": {
        "description": "Returns the current snapshot view for the requested machine.",
        "parameters": [
          {
            "description": "Machine identifier returned by GET /api/v1/machines.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional UTC timestamp. If provided, the snapshot is resolved around that instant.",
            "in": "query",
            "name": "at",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnapshotResponse"
                }
              }
            },
            "description": "Latest available value for each machine sensor."
          },
          "400": {
            "content": {
              "application/json": {
                "examples": {
                  "invalidTimestamp": {
                    "summary": "Invalid timestamp",
                    "value": {
                      "code": "invalid_at",
                      "message": "The at parameter must be a valid RFC3339 timestamp.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid timestamp."
          },
          "401": {
            "content": {
              "application/json": {
                "examples": {
                  "expiredToken": {
                    "summary": "Token has expired",
                    "value": {
                      "code": "token_expired",
                      "message": "Token has expired.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidToken": {
                    "summary": "Token is invalid",
                    "value": {
                      "code": "invalid_token",
                      "message": "Invalid public API token.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "missingToken": {
                    "summary": "Bearer token is missing",
                    "value": {
                      "code": "missing_token",
                      "message": "Missing bearer token.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "revokedToken": {
                    "summary": "Token has been revoked",
                    "value": {
                      "code": "token_revoked",
                      "message": "Token has been revoked.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing or invalid public API token."
          },
          "404": {
            "content": {
              "application/json": {
                "examples": {
                  "machineNotFound": {
                    "summary": "Machine not found",
                    "value": {
                      "code": "machine_not_found",
                      "message": "Machine not found.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "missingConfiguration": {
                    "summary": "Machine configuration not found",
                    "value": {
                      "code": "machine_configuration_not_found",
                      "message": "Machine configuration not found.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Machine or machine configuration not found."
          },
          "502": {
            "content": {
              "application/json": {
                "examples": {
                  "machineLookupFailed": {
                    "summary": "Machine lookup failed",
                    "value": {
                      "code": "machine_lookup_failed",
                      "message": "Unable to retrieve machine data.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "snapshotFailed": {
                    "summary": "Snapshot lookup failed",
                    "value": {
                      "code": "snapshot_failed",
                      "message": "Unable to retrieve machine snapshot.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Dependency request failed."
          },
          "503": {
            "content": {
              "application/json": {
                "examples": {
                  "machineLookupFailed": {
                    "summary": "Machine lookup failed",
                    "value": {
                      "code": "machine_lookup_failed",
                      "message": "Unable to retrieve machine data.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "snapshotFailed": {
                    "summary": "Snapshot lookup failed",
                    "value": {
                      "code": "snapshot_failed",
                      "message": "Unable to retrieve machine snapshot.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Dependency is unavailable."
          },
          "504": {
            "content": {
              "application/json": {
                "examples": {
                  "machineLookupFailed": {
                    "summary": "Machine lookup failed",
                    "value": {
                      "code": "machine_lookup_failed",
                      "message": "Unable to retrieve machine data.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "snapshotFailed": {
                    "summary": "Snapshot lookup failed",
                    "value": {
                      "code": "snapshot_failed",
                      "message": "Unable to retrieve machine snapshot.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Dependency request timed out."
          }
        },
        "security": [
          {
            "APIKeyToken": []
          }
        ],
        "summary": "Get machine snapshot",
        "tags": [
          "Machines"
        ],
        "operationId": "get__api_v1_machines_id_snapshot"
      }
    },
    "/api/v1/machines/{id}/timeseries": {
      "get": {
        "description": "Returns historical machine measurements for the organization bound to the public token.",
        "parameters": [
          {
            "description": "Machine identifier returned by GET /api/v1/machines.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "One to eight sensor identifiers. Repeat the parameter to request multiple sensors.",
            "explode": true,
            "in": "query",
            "name": "sensor_id",
            "required": true,
            "schema": {
              "items": {
                "type": "string"
              },
              "maxItems": 8,
              "minItems": 1,
              "type": "array"
            },
            "style": "form"
          },
          {
            "description": "UTC start timestamp. If omitted, the last 7 days are used. The maximum range is 30 days.",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "UTC end timestamp. If omitted, the current time is used.",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Aggregation bucket size in milliseconds.",
            "in": "query",
            "name": "interval",
            "required": false,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Aggregation applied to each interval bucket. Requires interval. When omitted, each bucket returns min, max and avg.",
            "in": "query",
            "name": "aggregation",
            "required": false,
            "schema": {
              "enum": [
                "avg",
                "min",
                "max",
                "first",
                "last"
              ],
              "type": "string"
            }
          },
          {
            "description": "Page number. Defaults to 1.",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Records per page. Defaults to 10 and cannot exceed 1000.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 1000,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimeseriesResponse"
                }
              }
            },
            "description": "Paginated historical sensor values."
          },
          "400": {
            "content": {
              "application/json": {
                "examples": {
                  "invalidAggregation": {
                    "summary": "Invalid aggregation",
                    "value": {
                      "code": "validation_error",
                      "message": "aggregation must be one of avg, min, max, first or last",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidFrom": {
                    "summary": "Invalid start timestamp",
                    "value": {
                      "code": "invalid_range",
                      "message": "The from parameter must be a valid RFC3339 timestamp.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidInterval": {
                    "summary": "Invalid interval",
                    "value": {
                      "code": "validation_error",
                      "message": "interval must be a positive number of milliseconds",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidLimit": {
                    "summary": "Invalid limit",
                    "value": {
                      "code": "validation_error",
                      "message": "limit must be a positive integer",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidPage": {
                    "summary": "Invalid page",
                    "value": {
                      "code": "validation_error",
                      "message": "page must be a positive integer",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidRange": {
                    "summary": "Invalid date range",
                    "value": {
                      "code": "invalid_range",
                      "message": "The from parameter must be before or equal to to.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidSensorCount": {
                    "summary": "Invalid sensor count",
                    "value": {
                      "code": "validation_error",
                      "message": "sensor_id must contain between 1 and 8 items",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidTo": {
                    "summary": "Invalid end timestamp",
                    "value": {
                      "code": "invalid_range",
                      "message": "The to parameter must be a valid RFC3339 timestamp.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "limitTooLarge": {
                    "summary": "Limit exceeds maximum",
                    "value": {
                      "code": "validation_error",
                      "message": "limit must be less than or equal to 1000",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "missingInterval": {
                    "summary": "Aggregation requires an interval",
                    "value": {
                      "code": "validation_error",
                      "message": "aggregation requires interval",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "nonNumericAggregation": {
                    "summary": "Aggregation is incompatible with sensor values",
                    "value": {
                      "code": "validation_error",
                      "message": "The selected aggregation requires numeric sensor values.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "pageTooLarge": {
                    "summary": "Page exceeds supported range",
                    "value": {
                      "code": "validation_error",
                      "message": "page is too large",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "rangeTooLarge": {
                    "summary": "Date range exceeds 30 days",
                    "value": {
                      "code": "range_too_large",
                      "message": "Maximum timeseries range is 30 days.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "unknownSensor": {
                    "summary": "Sensor is not available",
                    "value": {
                      "code": "validation_error",
                      "message": "One or more sensor_id values are not available for this machine.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid range, sensor selection, aggregation or pagination."
          },
          "401": {
            "content": {
              "application/json": {
                "examples": {
                  "expiredToken": {
                    "summary": "Token has expired",
                    "value": {
                      "code": "token_expired",
                      "message": "Token has expired.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "invalidToken": {
                    "summary": "Token is invalid",
                    "value": {
                      "code": "invalid_token",
                      "message": "Invalid public API token.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "missingToken": {
                    "summary": "Bearer token is missing",
                    "value": {
                      "code": "missing_token",
                      "message": "Missing bearer token.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "revokedToken": {
                    "summary": "Token has been revoked",
                    "value": {
                      "code": "token_revoked",
                      "message": "Token has been revoked.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing or invalid public API token."
          },
          "404": {
            "content": {
              "application/json": {
                "examples": {
                  "machineNotFound": {
                    "summary": "Machine not found",
                    "value": {
                      "code": "machine_not_found",
                      "message": "Machine not found.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "missingConfiguration": {
                    "summary": "Machine configuration not found",
                    "value": {
                      "code": "machine_configuration_not_found",
                      "message": "Machine configuration not found.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Machine or machine configuration not found."
          },
          "502": {
            "content": {
              "application/json": {
                "examples": {
                  "machineLookupFailed": {
                    "summary": "Machine lookup failed",
                    "value": {
                      "code": "machine_lookup_failed",
                      "message": "Unable to retrieve machine data.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "timeseriesFailed": {
                    "summary": "Timeseries lookup failed",
                    "value": {
                      "code": "timeseries_failed",
                      "message": "Unable to retrieve machine timeseries.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Dependency request failed."
          },
          "503": {
            "content": {
              "application/json": {
                "examples": {
                  "machineLookupFailed": {
                    "summary": "Machine lookup failed",
                    "value": {
                      "code": "machine_lookup_failed",
                      "message": "Unable to retrieve machine data.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "timeseriesFailed": {
                    "summary": "Timeseries lookup failed",
                    "value": {
                      "code": "timeseries_failed",
                      "message": "Unable to retrieve machine timeseries.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Dependency is unavailable."
          },
          "504": {
            "content": {
              "application/json": {
                "examples": {
                  "machineLookupFailed": {
                    "summary": "Machine lookup failed",
                    "value": {
                      "code": "machine_lookup_failed",
                      "message": "Unable to retrieve machine data.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  },
                  "timeseriesFailed": {
                    "summary": "Timeseries lookup failed",
                    "value": {
                      "code": "timeseries_failed",
                      "message": "Unable to retrieve machine timeseries.",
                      "request_id": "1d4bf67d-2db0-46ab-916e-d45ed8c24f65"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Dependency request timed out."
          }
        },
        "security": [
          {
            "APIKeyToken": []
          }
        ],
        "summary": "Get machine timeseries",
        "tags": [
          "Machines"
        ],
        "operationId": "get__api_v1_machines_id_timeseries"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "APIKeyToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Token",
        "description": "Create a token in IRIS Cloud → User Account → IRIS Cloud API Tokens. Paste only the token; Swagger adds the Bearer prefix."
      }
    },
    "schemas": {
      "BatchListResponse": {
        "description": "Paginated list of batches.",
        "example": {
          "data": [
            {
              "batch_id": "BATCH-2026-001",
              "end_time": "2026-08-16T10:00:00Z",
              "id": "7226a5d0-f7e7-477c-98f3-9081d3be5f6f",
              "machine_id": "35147e9e-2918-41e5-bd3b-a9c59a05edb4",
              "machine_name": "Labstar V3",
              "progress": 100,
              "recipe": "Blue",
              "start_time": "2026-08-16T08:00:00Z",
              "status": "COMPLETED"
            }
          ],
          "limit": 10,
          "order": "DESC",
          "page": 1,
          "sort": "start_time",
          "total": 1,
          "total_pages": 1
        },
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/BatchListItem"
            },
            "type": "array"
          },
          "limit": {
            "type": "integer"
          },
          "order": {
            "type": "string"
          },
          "page": {
            "type": "integer"
          },
          "sort": {
            "type": "string"
          },
          "total": {
            "type": "integer"
          },
          "total_pages": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "BatchListItem": {
        "description": "Summary row for a batch list result.",
        "properties": {
          "batch_id": {
            "nullable": true,
            "type": "string"
          },
          "end_time": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "machine_id": {
            "type": "string"
          },
          "machine_name": {
            "type": "string"
          },
          "progress": {
            "nullable": true,
            "type": "number"
          },
          "recipe": {
            "nullable": true,
            "type": "string"
          },
          "start_time": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ErrorResponse": {
        "description": "Error returned directly by connect-api.",
        "properties": {
          "code": {
            "description": "Stable machine-readable error code.",
            "type": "string"
          },
          "message": {
            "description": "Stable public error message. Internal dependency details are recorded only in service logs.",
            "type": "string"
          },
          "request_id": {
            "description": "Identifier used to correlate the response with service logs.",
            "type": "string"
          }
        },
        "required": [
          "code",
          "message",
          "request_id"
        ],
        "type": "object"
      },
      "BatchDetailsResponse": {
        "description": "Detailed information for a single batch.",
        "example": {
          "batch_id": "BATCH-2026-001",
          "batch_length_seconds": 7200,
          "cycles": 0.8,
          "end_time": "2026-08-16T10:00:00Z",
          "energy_kwh": 8.5,
          "id": "7226a5d0-f7e7-477c-98f3-9081d3be5f6f",
          "machine_id": "35147e9e-2918-41e5-bd3b-a9c59a05edb4",
          "machine_name": "Labstar V3",
          "max_temperature_celsius": 65,
          "progress": 100,
          "recipe": "Blue",
          "specific_energy_kwh_kg": 0.0315,
          "start_time": "2026-08-16T08:00:00Z",
          "status": "COMPLETED",
          "target_type": "PASSAGE",
          "target_value": 1,
          "total_batch_size_kg": 270,
          "total_runtime_seconds": 37335
        },
        "properties": {
          "batch_id": {
            "nullable": true,
            "type": "string"
          },
          "batch_length_seconds": {
            "type": "integer"
          },
          "cycles": {
            "nullable": true,
            "type": "number"
          },
          "end_time": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "energy_kwh": {
            "nullable": true,
            "type": "number"
          },
          "id": {
            "type": "string"
          },
          "machine_id": {
            "type": "string"
          },
          "machine_name": {
            "type": "string"
          },
          "max_temperature_celsius": {
            "nullable": true,
            "type": "number"
          },
          "progress": {
            "nullable": true,
            "type": "number"
          },
          "recipe": {
            "nullable": true,
            "type": "string"
          },
          "specific_energy_kwh_kg": {
            "nullable": true,
            "type": "number"
          },
          "start_time": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "target_type": {
            "nullable": true,
            "type": "string"
          },
          "target_value": {
            "nullable": true,
            "type": "number"
          },
          "total_batch_size_kg": {
            "nullable": true,
            "type": "number"
          },
          "total_runtime_seconds": {
            "nullable": true,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "MachineListResponse": {
        "example": {
          "data": [
            {
              "commission_number": "15209999",
              "id": "35147e9e-2918-41e5-bd3b-a9c59a05edb4",
              "name": "Labstar V3",
              "production_line": "Chemical Lab",
              "status": "IDLE",
              "type": "BEAD MILL",
              "warning": false
            }
          ]
        },
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/MachineListItem"
            },
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "MachineListItem": {
        "description": "Summary of one machine visible to the token organization.",
        "properties": {
          "commission_number": {
            "description": "Commission number, or ID number when no commission number exists.",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "production_line": {
            "type": "string"
          },
          "status": {
            "enum": [
              "NODATA",
              "IDLE",
              "MAINTENANCE",
              "RUNNING",
              "WARNING",
              "CRITICAL"
            ],
            "type": "string"
          },
          "type": {
            "nullable": true,
            "type": "string"
          },
          "warning": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "commission_number",
          "production_line",
          "status",
          "warning"
        ],
        "type": "object"
      },
      "MachineDetailsResponse": {
        "description": "Machine master data and current status.",
        "example": {
          "commission_number": "15209999",
          "gateway_id": "WV35DF2F00AD",
          "id": "35147e9e-2918-41e5-bd3b-a9c59a05edb4",
          "name": "Labstar V3",
          "production_line": "Chemical Lab",
          "status": "IDLE",
          "type": "BEAD MILL",
          "updated_at": "2026-08-16T10:30:00Z",
          "warning": false
        },
        "properties": {
          "commission_number": {
            "description": "Commission number, or ID number when no commission number exists.",
            "type": "string"
          },
          "gateway_id": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "production_line": {
            "type": "string"
          },
          "status": {
            "enum": [
              "NODATA",
              "IDLE",
              "MAINTENANCE",
              "RUNNING",
              "WARNING",
              "CRITICAL"
            ],
            "type": "string"
          },
          "type": {
            "nullable": true,
            "type": "string"
          },
          "updated_at": {
            "description": "UTC timestamp of the latest machine status update.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "warning": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "commission_number",
          "production_line",
          "status",
          "warning",
          "gateway_id"
        ],
        "type": "object"
      },
      "MachineAlarmsResponse": {
        "example": {
          "data": [
            {
              "code": "E-101",
              "custom_error_id": null,
              "gateway_id": "WV35DF2F00AD",
              "gateway_int_id": 38806304,
              "id": "alarm-123",
              "is_active": true,
              "is_custom": false,
              "machine_id": "35147e9e-2918-41e5-bd3b-a9c59a05edb4",
              "message": "Emergency stop active",
              "organization_int_id": 1,
              "resolved": null,
              "should_notify": false,
              "time": "2026-08-16T10:30:00Z"
            }
          ]
        },
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/MachineAlarm"
            },
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "MachineAlarm": {
        "description": "PLC-generated machine alarm.",
        "properties": {
          "code": {
            "nullable": true,
            "type": "string"
          },
          "custom_error_id": {
            "nullable": true,
            "type": "integer"
          },
          "gateway_id": {
            "type": "string"
          },
          "gateway_int_id": {
            "nullable": true,
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "is_active": {
            "type": "boolean"
          },
          "is_custom": {
            "type": "boolean"
          },
          "machine_id": {
            "format": "uuid",
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "organization_int_id": {
            "nullable": true,
            "type": "integer"
          },
          "resolved": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "should_notify": {
            "type": "boolean"
          },
          "time": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "time",
          "gateway_id",
          "machine_id",
          "message",
          "is_active",
          "should_notify",
          "id",
          "is_custom"
        ],
        "type": "object"
      },
      "MachineAlertsResponse": {
        "example": {
          "data": [
            {
              "code": null,
              "id": "198967",
              "machine_id": "35147e9e-2918-41e5-bd3b-a9c59a05edb4",
              "machine_name": "Labstar V3",
              "message": "Mill power has crossed the configured threshold.",
              "production_line": "Chemical Lab",
              "resolved": null,
              "target": "METRIC",
              "time": "2026-08-16T10:30:00Z"
            }
          ]
        },
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/MachineAlert"
            },
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "MachineAlert": {
        "description": "Platform-generated machine or sensor alert.",
        "properties": {
          "code": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "machine_id": {
            "type": "string"
          },
          "machine_name": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "production_line": {
            "type": "string"
          },
          "resolved": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "target": {
            "description": "Identifies what originated the alert: MACHINE_STATUS for a critical machine state, or METRIC when a sensor or metric crosses a configured threshold.",
            "enum": [
              "MACHINE_STATUS",
              "METRIC"
            ],
            "type": "string"
          },
          "time": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SensorListResponse": {
        "example": {
          "data": [
            {
              "decimal_place": "1",
              "id": "mill_power_00",
              "kind": "STANDARD",
              "multiplication_factor": 1,
              "name": "Mill power",
              "period": "5s",
              "unit": "kW",
              "value_type": "NUMBER"
            }
          ]
        },
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Sensor"
            },
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "Sensor": {
        "description": "Sensor exposed by the machine public configuration.",
        "properties": {
          "decimal_place": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "multiplication_factor": {
            "nullable": true,
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "period": {
            "nullable": true,
            "type": "string"
          },
          "unit": {
            "nullable": true,
            "type": "string"
          },
          "value_type": {
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "kind"
        ],
        "type": "object"
      },
      "SnapshotResponse": {
        "example": {
          "data": [
            {
              "sensor_id": "mill_power_00",
              "sensor_name": "Mill power",
              "timestamp": "2026-08-16T10:30:00Z",
              "value": 12.5
            }
          ]
        },
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/SnapshotValue"
            },
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "SnapshotValue": {
        "description": "Latest available value for one sensor.",
        "properties": {
          "sensor_id": {
            "type": "string"
          },
          "sensor_name": {
            "type": "string"
          },
          "timestamp": {
            "format": "date-time",
            "type": "string"
          },
          "value": {
            "description": "Sensor value. Its JSON type follows the sensor value_type.",
            "nullable": true,
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "boolean"
              }
            ]
          }
        },
        "required": [
          "sensor_id",
          "sensor_name",
          "timestamp",
          "value"
        ],
        "type": "object"
      },
      "TimeseriesResponse": {
        "description": "Paginated machine timeseries response.",
        "example": {
          "data": [
            {
              "sensor_id": "mill_power_00",
              "sensor_name": "Mill power",
              "timestamp": "2026-08-16T10:30:00Z",
              "value": 12.5
            }
          ],
          "limit": 10,
          "page": 1,
          "total": 1,
          "total_pages": 1
        },
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/TimeseriesPoint"
            },
            "type": "array"
          },
          "limit": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          },
          "total_pages": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "TimeseriesPoint": {
        "description": "One raw measurement or one aggregated interval bucket.",
        "properties": {
          "avg": {
            "nullable": true,
            "type": "number"
          },
          "max": {
            "nullable": true,
            "type": "number"
          },
          "min": {
            "nullable": true,
            "type": "number"
          },
          "sensor_id": {
            "type": "string"
          },
          "sensor_name": {
            "type": "string"
          },
          "timestamp": {
            "format": "date-time",
            "type": "string"
          },
          "value": {
            "description": "Sensor value. Its JSON type follows the sensor value_type.",
            "nullable": true,
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "boolean"
              }
            ]
          }
        },
        "type": "object"
      }
    }
  },
  "servers": [
    {
      "url": "https://connect-api.iris-cloud.netzsch.com",
      "description": "Production"
    }
  ]
}
