Reading your data with your own tools

Create a read-only key so your own agents, scripts and spreadsheets can read your live record over MCP or HTTP: every table, listed, as JSON or CSV.

Your record is yours. A data access key lets your own agents and tools read it live, without asking BarrelLogic's specialists and without waiting for an export.

Keys are read-only. Nothing can be changed with one.

Creating a key

  1. Go to Settings → Data access.
  2. Enter a Name you'll recognize later, such as "My reporting agent".
  3. Choose What it can read:
    • Production records: barrels, tanks, lots, blocks, chemistry, work orders, sensors and your custom fields. No customer, team or billing data.
    • All data: everything in your full export, including customers, orders, campaigns, conversations, team and billing.
  4. Click Create key, then Copy.

The key is shown once. If you lose it, revoke it and create another.

Only the winery owner or an admin can create or revoke keys. Otherwise you'll see "Only the winery owner or an admin can manage data access keys."

Connecting an agent over MCP

If your agent speaks MCP (Claude and most agent tools do), add BarrelLogic as a remote MCP server. There's no code to write.

  • URL: https://barrellogic.com/api/mcp
  • Header: Authorization: Bearer bl_live_…

Many clients take that as a config file:

{
  "mcpServers": {
    "barrellogic": {
      "type": "http",
      "url": "https://barrellogic.com/api/mcp",
      "headers": { "Authorization": "Bearer bl_live_…" }
    }
  }
}

Your agent sees every table it can read as a resource, and gets two tools: list_tables, which lists every table with its columns and row counts, and read_table, which returns the rows. Both are read-only.

Using a key over HTTP

Send the key as a Bearer token. Two requests cover everything.

List every table, with what it holds, its columns and its row count:

curl -H "Authorization: Bearer bl_live_…" https://barrellogic.com/api/v1/data

The list also names the tables your key can't read, under not_included, so your agent knows they exist.

Read a table, as JSON or CSV:

curl -H "Authorization: Bearer bl_live_…" "https://barrellogic.com/api/v1/data/chemistry_readings"
curl -H "Authorization: Bearer bl_live_…" "https://barrellogic.com/api/v1/data/lots?format=csv"

Each request returns up to 1,000 rows. The response includes next_offset: pass it as ?offset= to get the next page. When next_offset is null you have the whole table. CSV responses carry the same in the X-Next-Offset and X-Total-Count headers.

Custom fields

Custom fields come through as two tables: custom_field_definitions (each field's key, label and type) and custom_field_values (one row per record and field). See Custom fields.

Revoking a key

Under Active keys, click Revoke. Anything using the key stops working immediately. Creating and revoking keys is recorded in Settings → Audit log.

Something went wrong?

What you see What to do
invalid_api_key The key is missing, mistyped or revoked. Send it as Authorization: Bearer bl_live_….
scope_not_allowed The key reads production records only. Create an All data key to read that table.
unknown_table That table isn't in the list. Request /api/v1/data to see the names.
rate_limit_exceeded A key can make 300 requests a minute, over MCP and HTTP combined. Wait for the number of seconds in retry_after_seconds.
"Data access isn't switched on for this workspace yet." Email us and we'll turn it on.

Still stuck?

Email us with your winery name, the page you were on, and the exact message you see. A screenshot helps.

hello@barrellogic.com