{"openapi":"3.0.0","info":{"title":"Plaato API","version":"1.0.2","description":"Dig into our API reference documentation. If you have any questions, please get in touch at <a href=\"mailto:support@plaato.io\">support@plaato.io</a>","x-logo":{"url":"https://api.plaato.cloud/static/plaato-logo-big.png","altText":"PLAATO logo"}},"components":{"schemas":{"Batch":{"type":"object","properties":{"id":{"type":"string","description":"The batch ID","example":"99249eb1bd9ef0b6e192b271"},"clientId":{"type":"string","description":"The client ID","example":"d642fef420c5baa4c72f53de"},"fermenterId":{"type":"string","description":"Fermenter ID used for this batch","example":"d642fef420c5baa4c72x53de"},"devices":{"type":"array","items":{"type":"string"},"description":"Associated device IDs","example":["99249eb1bd9ef0b6e192b271"]},"recipeId":{"type":"string","description":"Associated recipe ID","example":"99249eb1bd9ef0b6e192b271"},"name":{"type":"string","description":"Name of the batch","example":"My IPA Batch"},"start":{"type":"string","format":"date-time","description":"Batch start date"},"end":{"type":"string","format":"date-time","description":"Batch end date"},"OG":{"type":"number","description":"Original gravity","example":1.055},"FG":{"type":"number","description":"Final gravity","example":1.01},"ABV":{"type":"number","description":"Alcohol by volume percentage","example":5.9},"attenuation":{"type":"number","description":"Attenuation percentage","example":81.8},"recipe":{"type":"object","properties":{"name":{"type":"string"},"author":{"type":"string"},"OG":{"type":"number"},"FG":{"type":"number"},"ABV":{"type":"number"},"attenuation":{"type":"number"},"fermentationDuration":{"type":"number"}}},"volume":{"type":"number","description":"Batch volume"},"archived":{"type":"boolean","description":"Whether the batch is archived"},"enabled":{"type":"boolean","description":"Whether the batch is enabled"},"latestReading":{"type":"object","properties":{"time":{"type":"string","format":"date-time"},"density":{"type":"object","properties":{"specificGravity":{"type":"number"},"plato":{"type":"number"}}},"temperature":{"type":"object","properties":{"celsius":{"type":"number"},"fahrenheit":{"type":"number"}}}}},"autoManagement":{"type":"boolean","description":"Whether automatic batch management is enabled"},"createdAt":{"type":"string","format":"date-time","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","description":"Last update timestamp"}}},"Device":{"type":"object","properties":{"id":{"type":"string","description":"The device ID","example":"99249eb1bd9ef0b6e192b271"},"clientId":{"type":"string","example":"d642fef420c5baa4c72f53de"},"name":{"type":"string","example":"B1-K-0172"},"barcode":{"type":"string","example":"B1-K-0172"},"batteryLevel":{"type":"number","example":100},"wifiStrength":{"type":"number","example":94},"firmwareVersion":{"type":"string","example":"1.0.1"},"lastOnline":{"type":"string","format":"date-time"},"latestReading":{"$ref":"#/components/schemas/Reading"}}},"Fermenter":{"type":"object","properties":{"id":{"type":"string","description":"The fermenter ID","example":"99249eb1bd9ef0b6e192b271"},"clientId":{"type":"string","description":"The client ID","example":"d642fef420c5baa4c72f53de"},"name":{"type":"string","description":"Name of the fermenter","example":"Fermenter 1"},"capacity":{"type":"number","description":"Capacity of the fermenter","example":5000},"devices":{"type":"object","properties":{"proId":{"type":"string","description":"ID of the associated device","example":"99249eb1bd9ef0b6e192b271"}}},"sortOrder":{"type":"number","description":"number used for sorting fermenters in the UI","example":1},"enabled":{"type":"boolean","description":"Whether the fermenter is enabled","example":true},"createdAt":{"type":"string","description":"Creation timestamp"},"updatedAt":{"type":"string","description":"Last update timestamp"}}},"Reading":{"type":"object","properties":{"time":{"type":"string","format":"date-time","description":"The time the reading was taken"},"frequency":{"type":"number","description":"The raw frequency read by the Plaato Pro","example":1100},"temperature":{"type":"number","description":"The temperature at the time of the reading","example":18.2},"density":{"type":"number","description":"The density at the time of the reading","example":1.022}}}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-plaato-api-key","description":"To generate your api key, go to <a href=\"https://app.plaato.cloud/account/integrations\" target=\"_blank\">your account page</a> and create a token. Here you can decide when it will expire."}}},"security":[{"ApiKeyAuth":[]}],"servers":[{"url":"https://api.plaato.cloud","description":"Environment: production"}],"paths":{"/batches":{"get":{"summary":"Returns the list of batches","tags":["Batches"],"security":[{"ApiKeyAuth":[]}],"responses":{"200":{"description":"The list of batches","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Batch"}}}}}}}},"/batches/{batchId}/readings":{"get":{"summary":"Returns readings data for a specific batch","description":"Returns readings data associated with the specified batch","tags":["Batches"],"parameters":[{"in":"path","name":"batchId","required":true,"schema":{"type":"string"},"description":"The batch ID"},{"name":"temperatureUnit","in":"query","required":false,"description":"Temperature unit to return","schema":{"type":"string","enum":["Celsius","Fahrenheit"]},"example":"Celsius"},{"name":"densityUnit","in":"query","required":false,"description":"Density unit to return","schema":{"type":"string","enum":["Specific Gravity","Plato"]},"example":"Specific Gravity"}],"security":[{"ApiKeyAuth":[]}],"responses":{"200":{"description":"Array of batch readings","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Reading"}}}}}}}},"/batches/{batchId}":{"get":{"summary":"Returns the a batch by ID","tags":["Batches"],"parameters":[{"in":"path","name":"batchId","required":true,"schema":{"type":"string"},"description":"The batch ID"}],"security":[{"ApiKeyAuth":[]}],"responses":{"200":{"description":"The batch","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Batch"}}}}}}}},"/devices":{"get":{"summary":"Returns the list of all devices","tags":["Devices"],"security":[{"ApiKeyAuth":[]}],"responses":{"200":{"description":"The list of the devices","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Device"}}}}}}}},"/devices/{deviceId}":{"get":{"summary":"Returns the details for a requested devices","tags":["Devices"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"deviceId","in":"path","required":true,"description":"Device identifier","schema":{"type":"string"}}],"responses":{"200":{"description":"The device details","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Device"}}}}}}}},"/fermenters":{"get":{"summary":"Returns the list of all fermenters","tags":["Fermenters"],"security":[{"ApiKeyAuth":[]}],"responses":{"200":{"description":"The list of the fermenters","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Fermenter"}}}}}}}},"/fermenters/{fermenterId}":{"get":{"summary":"Returns a specific fermenter by ID","tags":["Fermenters"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"in":"path","name":"fermenterId","schema":{"type":"string"},"required":true,"description":"ID of the fermenter"}],"responses":{"200":{"description":"The fermenter data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Fermenter"}}}}}}},"/devices/{deviceId}/readings":{"get":{"summary":"Returns the list of all device readings for a given time period.","tags":["Readings"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"deviceId","in":"path","required":true,"description":"Device identifier","schema":{"type":"string"}},{"name":"temperatureUnit","in":"query","required":false,"description":"Temperature unit to return","schema":{"type":"string","enum":["Celsius","Fahrenheit"]},"example":"Celsius"},{"name":"densityUnit","in":"query","required":false,"description":"Density unit to return","schema":{"type":"string","enum":["Specific Gravity","Plato"]},"example":"Specific Gravity"},{"name":"from","in":"query","required":false,"description":"If empty, defaults to 2 weeks ago.","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"description":"If empty, defaults to now.","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"The list of the readings","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Reading"}}}}}}}}},"tags":[{"name":"Readings","description":"The readings managing API"}]}