Breww public API
Breww has an open API that anyone can use to build integrations with Breww.
API keys are used for authentication and are created in Settings -> Breww Apps & API. Keys belong to an app, so you'll create a private app first and then add keys to it. See the 'Apps in Breww' section below.
Documentation on the available endpoints, data structure and more can be found at Breww public API documentation.
The API uses the REST (Representational State Transfer) architecture with JSON responses.
Breww does not currently offer a SOAP or OData interface.
API key access levels
Each API key has a single access level that controls what it's allowed to do. There are only two options, and they apply to the entire key - there are no per-endpoint scopes or per-resource permissions on Breww API keys.
- Read only - the key can only make safe, non-modifying requests. In practice this means
GET,HEADandOPTIONSonly. Any attempt toPOST,PUT,PATCHorDELETEwill be rejected. - Full access - the key can make any request the public API supports, including reads, writes, updates and deletes. This is the default for new API keys.
Every endpoint listed in the public API documentation is reachable by any authenticated key, regardless of access level - the access level only controls which HTTP methods are allowed, not which endpoints are visible. There is no way to grant a key partial access to a subset of endpoints.
A key's access level is chosen when the key is created and can't be changed afterwards. If you need a different level, create a new key with the level you want and revoke the old one. You can see the access level of every key on its app's page in Settings -> Breww Apps & API.
Troubleshooting "endpoint not reachable" errors
If you're getting an error that suggests an endpoint is unreachable, blocked, or returning permission errors, the cause is almost always one of the following:
- A read-only key is being used for a write request. A
403(or similar) onPOST,PUT,PATCHorDELETEfrom a read-only key is expected behaviour. Either change the key's access level to Full access or use a different key for write operations. - The
Authorizationheader is malformed. The header must be in the exact format documented in the API documentation. Missing the token prefix or sending the raw token without the prefix will be treated as an unauthenticated request. - The base URL is wrong. All public API endpoints are under
https://breww.com/api/.... Requests to other paths will not hit the API. - The endpoint isn't part of the public API surface. Some functionality in Breww doesn't have a public API endpoint yet. If the endpoint isn't in the public API documentation, it isn't accessible to API keys, regardless of access level.
If you're still stuck after checking the above, get in touch with Breww support with the exact request URL, HTTP method, and the response Breww returned.
Apps in Breww
Before you can create an API key or an OAuth2 client, you need to create an app. An app holds your credentials and tells the Breww team what you're building. Go to Settings -> Breww Apps & API and click Create app. You'll need the Admin permission to manage apps.
When creating an app you choose:
- App name - must be unique within your account.
- Description & notes for Breww team review - what your app does. Every app is reviewed by the Breww team, including private ones.
- App type - Private or Public, explained below. Register the correct type, as apps registered as the wrong type will be rejected.
- Integration category - which part of the integrations dashboard your app belongs in. Public apps only.
You also need to accept the App Developer Terms of Service, which are shown in the form and repeated on the app's own page for reference.
App review statuses
- Pending review - submitted and waiting on the Breww team. You can start development while your app is pending.
- Approved - reviewed and accepted.
- Rejected - the reason is shown on the app's page. Update your description and use Resubmit for review to try again.
Private apps
A private app is for your own internal tools. It can only ever access your own Breww account, and it authenticates with API keys.
Create keys from the app's page with Create API key, giving each one a name to identify it and an access level. The token is shown in the keys table and can be copied at any time, and Last used tells you when it was last seen, updated every few minutes rather than instantly.
Revoke key stops that key working immediately and permanently. Anything still using it will lose access, so make sure you've switched over to a replacement first.
Public apps
A public app is for software you want other breweries to be able to connect to. Public apps use OAuth2 instead of API keys, so each brewery grants your app access to their own account and you never handle their login details.
Breww creates the OAuth2 credentials for you when the app is created:
- Client ID - always visible on the app's page.
- Client secret - shown once, immediately after it's generated. Copy it straight away, because Breww won't show it again. If you lose it, use Regenerate client secret, which issues a new one and stops the old one working immediately.
- Redirect URIs - the addresses Breww is allowed to send users back to after they authorise your app. Enter one per line. Breww validates these, so they must be full, valid URLs.
Public apps also have a Published content section, where you supply the description, help guide URL and logo that breweries see for your app on Breww's integrations dashboard. A logo is required. Any changes you make here are reviewed by the Breww team before they go live, and the page tells you while a review is pending.
Deleting an app
Delete app removes the app along with all of its API keys and OAuth2 credentials. Everything is revoked immediately, so any integration using them loses access straight away. This can't be undone.