> For the complete documentation index, see [llms.txt](https://docs.brewbench.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.brewbench.co/brewbench-monitor-app-api.md).

# BrewBench Monitor App API

## Generic Device Reading

<mark style="color:green;">`POST`</mark> `https://sensor.brewbench.co/device/{token}`

Post data from any device.  At least one data value is required. Data should not be posted more often than every 15 minutes (900 seconds).  Your API key is required either in the path or header.

#### Path Parameters

| Name                                    | Type   | Description                 |
| --------------------------------------- | ------ | --------------------------- |
| token<mark style="color:red;">\*</mark> | String | API Token (App -> Settings) |

#### Headers

| Name                                        | Type   | Description                 |
| ------------------------------------------- | ------ | --------------------------- |
| X-API-KEY<mark style="color:red;">\*</mark> | String | API Token (App -> Settings) |

#### Request Body

| Name                                   | Type   | Description                                                                    |
| -------------------------------------- | ------ | ------------------------------------------------------------------------------ |
| name<mark style="color:red;">\*</mark> | String | A user unique name for you device                                              |
| source                                 | String | Source Name (Default Generic)                                                  |
| temp                                   | Number | Temperature                                                                    |
| temp\_unit                             | String | C or F (Default C)                                                             |
| gravity                                | Number | Gravity                                                                        |
| gravity\_unit                          | String | G or P (Default P)                                                             |
| temp\_adjust                           | Number | Amount to adjust the temp value by                                             |
| ambient                                | Number | Ambient Temperature                                                            |
| ambient\_unit                          | String | C or F (Default C)                                                             |
| ambient\_adjust                        | Number | Amount to adjust the ambient value by                                          |
| device\_id                             | String | A user unique id for you device (takes precedence over name for device lookup) |
| pressure                               | Number | Pressure                                                                       |
| pressure\_unit                         | String | psi, bar, mBar, Pa, kPa, hPa, inHg, mmHg (Default psi)                         |
| co2\_ppm                               | Number | CO2 Parts Per Million                                                          |
| bpm                                    | Number | Bubbles Per Minute                                                             |
| moisture                               | Number | Moisture %                                                                     |
| humidity                               | Number | Humidity %                                                                     |
| battery                                | Number | Battery voltage (4.2 - 3.3)                                                    |
| rssi                                   | Number | WiFi RSSI                                                                      |
| angle                                  | Number | Hydrometer angle                                                               |
| hysteresis                             | Number | Hydrometer hysteresis                                                          |
| interval                               | Number | Post interval in seconds                                                       |
| comment                                | String | Comment                                                                        |

{% tabs %}
{% tab title="400: Bad Request Response for at lease one data value not posted." %}

```javascript
{
  "error": {
    "statusCode": 400,
    "name": "Error",
    "message": "missing required device data"
  }
}
```

{% endtab %}

{% tab title="201: Created Response for a successful device reading, response will contain fields that were posted." %}

```javascript
{
  "name": "Generic Device",
  "temp": 30,
  "temp_unit": "C",
  "humidity": 35,
  "rssi": -58
}
```

{% endtab %}

{% tab title="401: Unauthorized Response for API key not found" %}

```javascript
{
  "error": {
    "statusCode": 401,
    "name": "Error",
    "message": "user not authorized"
  }
}
```

{% endtab %}

{% tab title="422: Unprocessable Entity Response for passing a field not listed above." %}

```javascript
{
  "error": {
    "statusCode": 422,
    "name": "UnprocessableEntityError",
    "message": "The request body is invalid. See error object `details` property for more info.",
    "code": "VALIDATION_FAILED",
    "details": [
      {
        "path": "",
        "code": "additionalProperties",
        "message": "should NOT have additional properties",
        "info": {
          "additionalProperty": "air"
        }
      }
    ]
  }
}
```

{% endtab %}

{% tab title="404: Not Found Response for not sending token in the URL path" %}

```javascript
{
  "error": {
    "statusCode": 404,
    "name": "NotFoundError",
    "message": "Endpoint \"POST /device\" not found."
  }
}
```

{% endtab %}

{% tab title="429: Too Many Requests Response for posting sooner than every 900 seconds." %}

```javascript
{
  "error": {
    "statusCode": 429,
    "name": "Error",
    "message": "sorry you cannot post more than every 900 seconds"
  }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.brewbench.co/brewbench-monitor-app-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
