Lueira public API: keys, webhooks and getting started
What the Lueira public API is, how to create a key in Settings > Developers, which permissions to choose, why a webhook appears as Disabled and how to enable it, and where the technical documentation is.
On this page
- What the public API is for
- Getting an API key
- Key permissions
- Webhooks: how to enable them and what "Disabled" means
- Create a webhook
- "Disabled": it is normal at the start
- Other reasons why a webhook is Disabled
- Available events
- Environments and testing
- Where the technical documentation is
- Connecting AI assistants (ChatGPT, Claude…)
- What cannot be done from the API today
What the public API is for
The Lueira public API lets another program (your website, an ERP, a BI tool, a custom development or an external integrator) read and manage your account data without logging in to the panel: customers, orders, products, instructors, inventory, etc. Each request is identified by an API key that belongs to your account.
There are two different APIs, and each one has its own keys:
- Admin API (the "public API v1"): to read and manage your business data. It is the one described in most of this guide.
- Online store API: to build your own store or booking process (catalogue, cart, customer, checkout). It needs its own additional subscription and its own keys.
If you only want to embed your activities in a WordPress website, you do not need the API: see the guide How to embed your Lueira activities in your WordPress website.
Getting an API key
- Log in to the panel with a user with the ADMIN role. Users with other roles cannot manage keys.
- Go to Settings and, in the Developers group, open API Keys (the path is
/settings/developers/api-keys). - Click Create API key.
- Choose the type of API (Admin API or Online store API), give it a name you will remember (for example "Booking widget", minimum 3 characters) and tick the permissions it needs.
- Optional: enter an expiry date and, if the key is going to be used from a browser, the allowed origins (one per line).
- Click Create key and copy the key. It is only shown this once: if you lose it, you will have to rotate it and get a new one.
If you do not see the Developers group or the API Keys option: your account does not include the public API. The group is hidden when the account does not have access enabled, and if you try to create a key of a type that is not included, the notice "Your account does not include this API. Buy the add-on or contact support to activate it" appears. In that case, write to support.
For online store API keys, you also need to subscribe to that API (the panel itself indicates this with a Subscribe button).
On the same screen you can Rotate a key (the previous one stops working instantly) or Revoke it (requests made with that key are rejected and this cannot be undone). Treat the key like a password: store it only on your server, never in code that runs in the browser.
Key permissions
Each key can only do what you grant it when you create it. Permissions are organised by area, with read and write separated:
- Customers, orders and bookings, products, instructors and inventory: each area has a read permission and a write permission (create, edit and delete).
- Sensitive areas (finance, personal data, human resources, banking, audit log, accounting exports and marketing): they are granted separately and never come with "normal" access.
Grant only what is essential. Before creating the key, the panel shows you a notice with what it will be able to do; remember that write permission can modify or delete real data and this cannot be undone, and that some permissions include your customers' personal data (share that key only with providers you are authorised to share it with).
The exact list of permissions you see when creating a key may vary depending on the type of API chosen.
Webhooks: how to enable them and what "Disabled" means
A webhook makes Lueira notify your system (with a request to a URL of yours) when something happens in your account, for example when an order is created. They are managed in Settings > Developers > Webhooks (/settings/developers/webhooks), with an ADMIN user and with the public API enabled in your account (just like keys).
Create a webhook
- Click New webhook.
- Enter a name, the destination URL (it must be HTTPS) and tick at least one event.
- When you save it, Lueira shows you the secret only once. Copy it: you need it to verify the HMAC-SHA256 signature of each request you receive.
"Disabled": it is normal at the start
A newly created webhook appears as Disabled; this is not an error. You have to enable it by hand:
- In the webhook's row, open the menu and click Enable.
- Lueira first sends a signed test event to your URL.
- The webhook is only enabled if your server responds with a 2xx code. If not, you will see "The test failed and the webhook was not enabled" together with the HTTP response received, and you can click Retry test once you have fixed it.
Therefore, to enable it your endpoint must already be published, reachable from the internet and answering 2xx.
Other reasons why a webhook is Disabled
- You disabled it yourself from the same menu.
- Lueira disabled it automatically after 20 consecutive failed deliveries. If you hover over the status you can see the reason. Fix your endpoint and click Enable again (the test is run again).
While it is enabled, the status shows Active, or Failing (n) if the latest deliveries have failed. With View deliveries you can check every delivery: date, event, HTTP code, response and attempt. You can also Rotate secret (the previous one stops being valid instantly) or delete the webhook.
Available events
Events have the format resource.action. They include order.created, order.updated, order.deleted, order.confirmed, customer.created, customer.updated, customer.deleted, order_payment.created, order_document.created, as well as events for products, rental bookings, group and private lessons and inventory. The complete, current list is the one that appears in the selector when you create the webhook (and in the technical documentation).
Environments and testing
The API's technical documentation lists a single production server: api.lueira.com/api/v1 for the Admin API and https://api.lueira.com/api/store/v1 for the online store API.
There is no documented test (sandbox) or pre-production environment for the public API. If your integrator needs to test without touching your real data, check with support before starting. In the meantime, use read-only keys for the first tests and avoid testing writes on real data.
To keep track of consumption, in Settings > Developers > API usage you can see the month's requests against your plan's quota and you can activate pay-as-you-go automatic top-up. If you exceed the per-minute limit, the API responds 429; if you use up the monthly quota without top-up, it responds 402.
Where the technical documentation is
Your integrator needs the technical reference (endpoints, fields, errors and examples). It is available as follows:
- The OpenAPI specification of the Admin API can be downloaded without a key at
https://api.lueira.com/api/v1/openapi.yamland that of the online store API athttps://api.lueira.com/api/store/v1/openapi.json.
Requests are authenticated by sending the key in the header Authorization: Bearer <your key>.
Connecting AI assistants (ChatGPT, Claude…)
Lueira has an MCP server (the standard for connecting AI assistants with applications) that gives access to your account data. It connects using the address https://api.lueira.com/api/v1/mcp and supports two ways of authenticating:
- One-click connection (OAuth): the assistant takes you to a Lueira screen where an administrator approves which permissions to grant. The application then appears in Settings > Developers > Connected applications, from where you can revoke its access whenever you want.
- An API key as an alternative, for assistants that do not support OAuth.
Quickest way: add Lueira directly from your assistant's directory.
Add to ChatGPT · Add to Claude
Conditions and limits:
- It needs the public API enabled in your account; if you do not see the Developers group, contact support.
- The assistant can only see and do what the approved permissions allow.
- The assistant's calls count towards the same monthly quota as API requests.
- By design, the assistant cannot create or modify orders; it can read them and manage customers, products, inventory or instructors if you grant it those permissions.
- After changing permissions it may take up to 5 minutes to be reflected in the assistant.
We have not checked the process step by step in every version of ChatGPT or other AI tools, which changes frequently; if it does not let you connect it, contact support.
What cannot be done from the API today
- Recording a payment made outside Lueira (cash, bank transfer, your own card terminal): the Admin API only lets you view an order's payments, not create them. For payments collected another way, record them from the panel.
- Cart: the Admin API has no cart. Carts (create cart, add items, customer, checkout and payment) belong to the online store API, which uses its own key type and subscription. In that API prices are always calculated by Lueira: if the request includes price or amount fields (for example
price_numberoramount_number), it is rejected with a 400 error. It also does not accept rental bookings of more than 31 days. - Creating orders with the AI assistant (MCP): not available, not even with write permissions.
If you receive a 400 "invalid_request" error and it does not fit the above, send support the request (without the key), the full response and the request identifier (request_id) that the API returns.
Related guides
- Configuring Company Settings in LueiraIn this section you can configure all the properties of your school
- Settings (School / Center / Activities)Configure the parameters of your school, center or activities space: levels, meeting points, schedules, prices and more.
- Features: turn optional features on or off in your accountHow to turn Short courses, Private lesson vouchers, Material resources and Instructor ranking on or off from Settings > Company > Features.
- Several sites or centers in one Lueira accountHow to manage several sites (establishments) in the same account: create a site, give it its own online store link and decide whether it invoices with its own tax details.
- Diagnose: check your setup, an order or a productHow to use the Diagnose button and the Setup status screen to find out what is missing or wrong in your account, your store, an order, a pack or a product, and how to fix it.
- Create and manage locationsHow to create, edit and delete a location (a physical place where you operate) in Settings > Locations, what each field means and what to do if you cannot create one.