Through the API, the backend of your website sends events, errors, feedback and server-side requests. Both the request body and the response are JSON.
Base address and authentication
https://www.lunaboard.com/api/v1
- Every request carries the header
Authorization: Bearer luna_…with the API key of the site. - A key belongs to one site. You create it in the site settings and see it in full only once. Lunaboard stores only its hash.
- A key can be revoked at any time. A request with a missing, unknown or revoked key ends with code 401.
HTTP/1.1 401 Unauthorized
{"error": "unauthorized", "message": "Missing, unknown or revoked API key."}
Overview of endpoints
| Endpoint | Purpose | Batch | Success |
|---|---|---|---|
POST /events | Event from the backend | Yes | 201 |
POST /errors | Error from the backend with a trace | Yes | 201 |
POST /feedback | Message from your own form | No | 201 |
POST /hits | Server-side requests | Yes | 202 |
Events
POST /events
| Field | Required | Description |
|---|---|---|
type | Yes | Type key, for example order.created. Letters, digits, period, underscore, colon and hyphen, at most 80 characters. |
title | Yes | Short title for the overview, at most 200 characters. |
detail | No | One sentence with details, at most 500 characters. |
url | No | Link to the administration of your website (http or https). |
occurred_at | No | Time of the event. Without it, the time of receipt is used. |
flow_id | No | Shared flow identifier, at most 80 characters. Events with the same value are combined and the times between the steps are shown. |
The prepared types are user.registered, order.created, order.paid and listing.created. You can also send any custom type.
curl -X POST https://www.lunaboard.com/api/v1/events \
-H "Authorization: Bearer luna_VAS_KLIC" \
-H "Content-Type: application/json" \
-d '{
"type": "order.created",
"title": "Objednávka 2026-0042",
"detail": "3 položky, 1 490 Kč",
"url": "https://vas-web.cz/admin/objednavky/42",
"flow_id": "order-42"
}'
HTTP/1.1 201 Created
{"id": 1284}
<?php
// Laravel: odeslání události z backendu. Chyba Lunaboardu nesmí shodit objednávku.
use Illuminate\Support\Facades\Http;
try {
Http::withToken(config('services.lunaboard.key'))
->timeout(3)
->post('https://www.lunaboard.com/api/v1/events', [
'type' => 'order.created',
'title' => 'Objednávka '.$order->number,
'detail' => $order->items_count.' položek, '.$order->total_formatted,
'url' => route('admin.orders.show', $order),
'flow_id' => 'order-'.$order->id,
]);
} catch (Throwable $e) {
report($e);
}
Batches
Instead of one object, you can send an array of objects, at most 500 items in one request. The whole batch is validated in advance: if any item is invalid, nothing is stored and the 422 response states the position of the item and the field.
curl -X POST https://www.lunaboard.com/api/v1/events \
-H "Authorization: Bearer luna_VAS_KLIC" \
-H "Content-Type: application/json" \
-d '[
{"type": "order.created", "title": "Objednávka 2026-0042", "flow_id": "order-42"},
{"type": "order.paid", "title": "Zaplaceno 2026-0042", "flow_id": "order-42"}
]'
# Odpověď: 201 {"accepted": 2, "ids": [1285, 1286]}
Errors
POST /errors
| Field | Required | Description |
|---|---|---|
message | Yes | Error message. The first 500 characters are stored for the overview. |
url | No | The page where the error occurred. |
status | No | HTTP response code, for example 500. |
trace | No | Trace as text. The first 20,000 characters are stored. |
user, user_signature | No | Signed user identifier, see user identity. |
occurred_at | No | Time of the occurrence. Without it, the time of receipt is used. |
Identical errors are added up into one record with the number of occurrences and the time of the first and last occurrence. Grouping is by source, code, message and page, not by trace. When an error marked as resolved appears again, it returns with the status Appeared again.
curl -X POST https://www.lunaboard.com/api/v1/errors \
-H "Authorization: Bearer luna_VAS_KLIC" \
-H "Content-Type: application/json" \
-d '{
"message": "SQLSTATE[23000]: Integrity constraint violation",
"url": "/kosik/odeslat",
"status": 500,
"trace": "#0 app/Http/Controllers/CartController.php(88): ..."
}'
Feedback
POST /feedback always accepts one message.
| Field | Required | Description |
|---|---|---|
kind | Yes | broken, missing, idea or praise. |
text | Yes | Text of the message, at most 5,000 characters. |
url | No | The page to which the message relates. |
email | No | Email for a reply. |
user, user_signature | No | Signed user identifier. |
screenshot | No | Screenshot as a data URL (PNG, JPEG or WebP) up to 1,500 kB. |
curl -X POST https://www.lunaboard.com/api/v1/feedback \
-H "Authorization: Bearer luna_VAS_KLIC" \
-H "Content-Type: application/json" \
-d '{
"kind": "broken",
"text": "Po kliknutí na Odeslat objednávku se nic nestane.",
"url": "/kosik",
"email": "[email protected]"
}'
Server-side requests
POST /hits accepts requests that your server handled. It is the only way to measure AI bots. The fields, samples and the recommended procedure are in the section Server side and AI bots.
Response codes
| Code | Meaning |
|---|---|
| 201 | Stored. The response carries id; for a batch, accepted and ids. |
| 202 | Server-side requests accepted. The response carries totals. |
| 401 | The key is missing, unknown or revoked. |
| 422 | Invalid data. The response states the fields that did not pass. |
| 429 | Limit exceeded. The Retry-After header says after how many seconds to try again. |
Limits
- 600 requests per minute for one API key.
- At most 500 items in one batch.
- Do not place the API call in the path of a visitor request. Send it from a queue or with a short timeout, so that an outage of Lunaboard does not slow down your website.