BrewForge Docs

Update a keg: litres left, pour, empty, sensor

Changes a keg that is on tap or ready (a current serving stay). action: set_volume = the real litres left (volume_l); pour = take litres out (pour_l, default 0.5; it lowers the litres left now: pours have no date or history, so an earlier pour is simply recorded now); free = the keg is empty and free from today; link_brew = a keg of a hand-typed beer belongs to one of the brewer's brews (brew); attach_sensor / detach_sensor = a keg scale or volume sensor (device) takes over / stops measuring the volume. Kegs with a sensor attached cannot be set by hand. Returns the keg and an undo_token (undo_stock_change). Filling kegs is package_beer; list kegs with get_beer_stock. Needs the plan feature `cellar`. Scope: `cellar:write` (or `write`).

POST
/api/v1/actions/update_keg

Changes a keg that is on tap or ready (a current serving stay). action: set_volume = the real litres left (volume_l); pour = take litres out (pour_l, default 0.5; it lowers the litres left now: pours have no date or history, so an earlier pour is simply recorded now); free = the keg is empty and free from today; link_brew = a keg of a hand-typed beer belongs to one of the brewer's brews (brew); attach_sensor / detach_sensor = a keg scale or volume sensor (device) takes over / stops measuring the volume. Kegs with a sensor attached cannot be set by hand. Returns the keg and an undo_token (undo_stock_change). Filling kegs is package_beer; list kegs with get_beer_stock.

Needs the plan feature cellar. Scope: cellar:write (or write).

AuthorizationBearer <token>

API token in format: bfk_. Each operation lists the token scope it requires (the scopes are listed below).

  • read: Read everything (all areas)
  • write: Create, change and delete everything (all areas)
  • brews:read: List and view brews
  • brews:write: Create, update, delete brews and notes
  • inventory:read: List inventory items
  • inventory:write: Create, update, delete inventory items
  • equipment:read: List equipment profiles
  • equipment:write: Create, update, delete equipment profiles
  • styles:read: List style profiles
  • styles:write: Create, update, delete style profiles
  • profiles:read: List mash, fermentation, and water profiles
  • custom-fields:read: List custom field definitions
  • custom-fields:write: Create, update, delete custom field definitions
  • profiles:write: Create, update, delete mash, fermentation, and water profiles
  • cellar:read: View cellar, packaged stock, tap lists, and labels
  • cellar:write: Manage cellar, packaging, stock, tap lists, and labels
  • settings:read: View preferences, imports, calculators, and your data export
  • settings:write: Change preferences and undo imports
  • community:read: View community, feedback, tickets, inbox, and account overview
  • community:write: Post, vote, and reply in community, feedback, and tickets

In: header

Scope: cellar:write

Request Body

application/json

keg*string

The keg: its name (e.g. "Corny 2"), the beer in it (brew name or batch number), or stay_id from get_beer_stock.

action*string

What to do: set_volume, pour, free, link_brew, attach_sensor or detach_sensor.

Value in"set_volume" | "pour" | "free" | "link_brew" | "attach_sensor" | "detach_sensor"
volume_l?number

set_volume: litres left now, e.g. 12.5.

Range0 <= value
pour_l?number

pour: litres poured, e.g. 0.5 for a pint (default 0.5). Recorded now; pours cannot be backdated.

Range0 < value
brew?string

link_brew: the brew this beer is. The brew: its id, its batch number (e.g. 12 or "#12") or its exact name (e.g. "Citra Pale Ale"). Case does not matter.

device?string

attach_sensor / detach_sensor: device id or exact name, e.g. "Keg scale 1" (see get_beer_stock keg_sensors).

today?string

The brewer's local date today, YYYY-MM-DD (e.g. "2026-11-11"). Optional: defaults to today in UTC. Pass it when the brewer's day differs from UTC (late evening in America, early morning in Asia).

Match^\d{4}-\d{2}-\d{2}$
[key: string]?never

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://brewforge.sh/api/v1/actions/update_keg" \  -H "Content-Type: application/json" \  -d '{    "keg": "string",    "action": "set_volume"  }'
{
  "keg": {
    "id": "string",
    "vessel": "string",
    "vessel_id": "string",
    "beer": "string",
    "brew_id": "string",
    "role": "string",
    "name": "string",
    "start_date": "string",
    "end_date": "string",
    "volume_l": 0,
    "status": "planned",
    "notes": "string",
    "pints_left": 0
  },
  "undo_token": "string"
}
{
  "error": {
    "code": "string",
    "message": "string",
    "hint": "string",
    "candidates": [
      {
        "id": "string",
        "name": "string"
      }
    ],
    "fields": {
      "property1": [
        "string"
      ],
      "property2": [
        "string"
      ]
    },
    "details": {}
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "hint": "string",
    "candidates": [
      {
        "id": "string",
        "name": "string"
      }
    ],
    "fields": {
      "property1": [
        "string"
      ],
      "property2": [
        "string"
      ]
    },
    "details": {}
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "hint": "string",
    "candidates": [
      {
        "id": "string",
        "name": "string"
      }
    ],
    "fields": {
      "property1": [
        "string"
      ],
      "property2": [
        "string"
      ]
    },
    "details": {}
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "hint": "string",
    "candidates": [
      {
        "id": "string",
        "name": "string"
      }
    ],
    "fields": {
      "property1": [
        "string"
      ],
      "property2": [
        "string"
      ]
    },
    "details": {}
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "hint": "string",
    "candidates": [
      {
        "id": "string",
        "name": "string"
      }
    ],
    "fields": {
      "property1": [
        "string"
      ],
      "property2": [
        "string"
      ]
    },
    "details": {}
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "hint": "string",
    "candidates": [
      {
        "id": "string",
        "name": "string"
      }
    ],
    "fields": {
      "property1": [
        "string"
      ],
      "property2": [
        "string"
      ]
    },
    "details": {}
  }
}