Appearance
Levels, Areas, Markers
Manage map entities through the project API. All endpoints require authentication.
How It Works
Levels, areas, and markers are nested inside a project. You can:
- Read them via
GET /api/projects/{project_id}/levels/ - Create / Update / Delete them via
PATCH /api/projects/{project_id}/withlevels_data - Update a single area or marker via
PATCH /api/projects/{project_id}/markers/{id_or_key}/
The levels_data route is the same approach the Layota editor uses internally: it replaces the whole structure, so anything you leave out is deleted. Use the per-entity route when an integration needs to change one thing — availability, a price, opening hours — without resending the map.
Get Levels (with Areas & Markers)
http
GET /api/projects/{project_id}/levels/
Authorization: Bearer <token>Response:
json
[
{
"id": "level-uuid",
"name": "Floor 1",
"key": "floor-1",
"order": 0,
"isHidden": false,
"imageUrl": "https://...",
"imageThumbnails": ["https://...150px"],
"defaultZoom": 1.0,
"minZoom": 0.75,
"maxZoom": 4.0,
"backgroundColor": null,
"areas": [
{
"id": "area-uuid",
"key": "coffee-shop",
"data": [[100, 200], [300, 200], [300, 400], [100, 400]],
"color": "#FF5733",
"fillOpacity": 0.3,
"strokeWidth": 2,
"strokeColor": null,
"hoverOpacity": 0.5,
"zoomOnSelect": true,
"status": null,
"address": null,
"workingHours": null,
"email": null,
"webpage": null,
"telephone": null,
"rating": null,
"price": null,
"tags": [
{ "id": "tag-uuid-1", "name": "Food", "color": "#FF5733", "translations": { "ru": "Еда" }, "showInLegend": true, "colorsAreas": false, "fillPattern": "none", "flatIn3d": false, "order": 0 }
],
"images": [
{
"id": "img-uuid",
"url": "https://...",
"thumbnails": ["https://...150px"],
"medium": null,
"order": 0
}
],
"translations": {
"en": {
"title": "Coffee Shop",
"description": "Best coffee in town",
"statusLabel": "",
"features": [],
"customButtonLabel": "Order online"
},
"ru": {
"title": "Кофейня",
"description": "Лучший кофе",
"statusLabel": null,
"features": [],
"customButtonLabel": "Заказать онлайн",
"customButtonUrl": "https://order.example/ru"
}
}
}
],
"markers": [
{
"id": "marker-uuid",
"key": "main-entrance",
"position": { "x": 250, "y": 100 },
"type": "classic",
"icon": "door-open",
"customIcon": null,
"color": "#00AA00",
"size": 10,
"opacity": 1,
"pinStyle": "icon",
"markerText": "1",
"alwaysShowLabel": false,
"showTooltip": true,
"showCard": true,
"zoomOnSelect": true,
"status": null,
"tags": [],
"images": [],
"translations": {
"en": {
"title": "Main Entrance",
"description": null,
"statusLabel": "",
"features": [],
"customButtonLabel": null
}
}
}
]
}
]Where is title?
Responses have no top-level title on areas and markers — the display name always comes from translations (the project's default language entry is always present). On write you send a top-level title, which becomes the default-language title.
Public Read-Only Endpoints
These endpoints require no authentication and work for published projects. They also support API key auth (Authorization: Bearer sk_... — read or write key), which bypasses the allowed domains check.
They return the map as it was last published — the same data as GET /api/p/{project_id}/, one level, area or marker at a time. Changes saved in the editor or written with levels_data are a draft: they appear here after publishing or Update Live. The one write that goes live at once is the single-entity PATCH on a published project. A level, area or marker that exists only in the draft answers 404.
Lookup by UUID or by slug key (e.g. floor-1, coffee-shop).
List Levels (metadata only)
http
GET /api/p/{project_id}/levels/Returns a lightweight list without nested areas/markers:
json
[
{
"id": "level-uuid",
"name": "Floor 1",
"key": "floor-1",
"imageUrl": "https://...",
"imageThumbnails": ["https://..."],
"isHidden": false,
"defaultZoom": 1.0,
"minZoom": 0.75,
"maxZoom": 4.0,
"backgroundColor": null,
"order": 0,
"areaCount": 12,
"markerCount": 5
}
]Get Level Detail
http
GET /api/p/{project_id}/levels/{level_id_or_key}/Returns full level with all areas and markers (same format as GET /api/projects/{id}/levels/ but for a single level).
Get Area Detail
http
GET /api/p/{project_id}/areas/{area_id_or_key}/Returns a single area with images, tags, and translations.
Get Marker Detail
http
GET /api/p/{project_id}/markers/{marker_id_or_key}/Returns a single marker with images, tags, and translations.
Update Project (with Levels, Areas, Markers)
Send levels_data as part of a project update. Each level can contain areas and markers arrays. Include id for existing entities (to update) or omit it (to create). Entities not included in the array are deleted.
A level's translations is { language_code: name } for the project's non-default languages (the default-language name is name); an empty name falls back to name, a level sent without translations keeps the stored ones, and {} clears them. name stays the identity — unique per project and what ?level= and the SDK match.
http
PATCH /api/projects/{project_id}/
Authorization: Bearer <token>
Content-Type: application/json
{
"levels_data": [
{
"id": "existing-level-uuid",
"name": "Ground Floor",
"translations": { "es": "Planta baja", "de": "Erdgeschoss" },
"key": "ground-floor",
"order": 0,
"isHidden": false,
"areas": [
{
"id": "existing-area-uuid",
"title": "Updated Coffee Shop",
"key": "coffee-shop",
"data": [[100, 200], [300, 200], [300, 400], [100, 400]],
"color": "#3366FF",
"fillOpacity": 0.3,
"strokeWidth": 2,
"tags": ["tag-uuid"]
},
{
"title": "New Store",
"key": "new-store",
"data": [[400, 200], [600, 200], [600, 400], [400, 400]],
"color": "#FF5733"
}
],
"markers": [
{
"title": "Main Entrance",
"key": "main-entrance",
"position": { "x": 250, "y": 100 },
"type": "classic",
"icon": "door-open",
"color": "#00AA00"
}
]
}
]
}With Image Upload
When uploading level images, use multipart/form-data with the data as a JSON string in the data field:
http
PATCH /api/projects/{project_id}/
Authorization: Bearer <token>
Content-Type: multipart/form-data
data={"levels_data": [...]}
level_image_0=<file>Update a Single Area or Marker
Change one entity without resending the map. Unlike levels_data, this is a true partial update: only the fields you send change, and nothing is deleted for being absent. Requires a write API key (or a signed-in editor); read keys get 403.
http
PATCH /api/projects/{project_id}/markers/{id_or_key}/
PATCH /api/projects/{project_id}/areas/{id_or_key}/
Authorization: Bearer sk_...
Content-Type: application/json
{
"status": { "type": "warning", "label": "Booked until 18:00" },
"price": "€45 / hour"
}The entity is addressed by its UUID or its key slug, exactly like the public read endpoints — so an integration can use its own identifiers:
bash
curl -X PATCH https://api.layota.app/api/projects/$PROJECT_ID/markers/lane-3/ \
-H "Authorization: Bearer $LAYOTA_WRITE_KEY" \
-H "Content-Type: application/json" \
-d '{"status": {"type": "success", "label": "Free now"}}'Returns the full updated entity (same shape as GET /api/p/{project_id}/markers/{id}/).
Patchable fields
| Field | Notes |
|---|---|
status | { type, label }. type is success, warning, error, info, or null to clear. The label is also written to the default-language translation. |
price | Free text, e.g. "€45 / hour" — the default-language text, also written to the default-language translation; other languages go in translations.<lang>.price |
occupancy | Occupancy schedule object |
workingHours | Opening-hours object |
customButton | { enabled, icon, label, url } — label is the default-language text; other languages go in translations.<lang>.customButtonLabel. url is the default link and may hold {lang}: the viewer puts the code of the language the map is shown in (or that language's linkCode, see Languages). A language's own link goes in translations.<lang>.customButtonUrl and wins. Links must be http(s) (also mailto:, tel:, a site path); a javascript: or data: link is a 400 |
label | On-map text inside the polygon, or null: { enabled, text, fontSize, color, opacity, rotation, auto, anchor }. text is the default-language text, other languages go in translations.<lang>.labelText; empty → the translated title; fontSize in image pixels (4–400); rotation in degrees, clockwise, normalised to [-180, 180); auto: true rotates along the polygon's longest edge; anchor: {x, y} in image pixels or null for the centroid. Logo label: mode: "image", image — the path returned by POST /projects/{id}/upload-image/ (a file of another project is a 400) — and imageWidth in image pixels (4–4000); plate: true draws a white rounded plate behind it; responses add imageUrl. The logo file counts toward the organization's storage (measured by the server). Pill label: mode: "pill" draws the text on a white rounded plate with a dot; dot is "tag" (default — the colour of the area's colouring tag, else its status colour), "status" (the status colour only) or "none". Without mode the label is text. The text fields stay the fallback while the logo loads. Also accepted by the per-entity PATCH /areas/{id}/ |
isHidden | Boolean |
showInSearch | Boolean. false keeps the place on the map (visible, clickable, a valid route end and deep-link target) but out of the viewer search and the route autocomplete |
tags | Replaces the entity's tags. With status tags flagged colorsAreas (project tags), swapping the tag is all a sync script needs to recolour a unit |
fillPattern | Areas only: none or hatch |
flatIn3d | Areas only: true = the area stays flat in the 3D view |
heightIn3d, wallColorIn3d | Areas only: the block's own height (0.25–20) and wall colour (hex) in the 3D view; null = the project's |
rating | Number |
translations | Per-language title / description / statusLabel / features / customButtonLabel / customButtonUrl (the button's link in that language; null or "" = the default customButton.url; a write that leaves the key out keeps the stored link) / price / tooltip (hover text, up to 120 characters) / labelText (areas only) |
Anything else is rejected with 400, including position, data and images — geometry and photos belong to the editor. Sending an unknown field fails loudly rather than being silently ignored.
Published maps update immediately
/api/p/ serves a published snapshot, so most writes to a published project only become visible after POST /api/projects/{id}/update-live/. This endpoint is the exception: it patches the live snapshot in place, so the change is served right away — no update-live call, no full-map rebuild.
TIP
For anything this endpoint does not cover (geometry, images, creating or deleting entities), use levels_data and then call update-live if the project is published.
Marker Types
| Type | Description |
|---|---|
classic | Standard pin (default) |
pulse | Animated pulsing dot |
drop-pin | Map-style pin with configurable pin style |
rounded-square | Square pin with rounded corners |
badge | A circle with a short text inside — a number or code such as 12, 68a, C1 |
label-hover | Text label on hover |
Deprecated: numbered and markerNumber
Until 29 Oct 2026 the badge was called numbered and took a number in markerNumber. Both are still accepted on writes: type: "numbered" is stored as badge and markerNumber: 7 as markerText: "7". Responses always use badge and markerText. Switch to them: the old names will be removed in a later release.
Area & Marker Fields Reference
Area Fields
| Field | Type | Description |
|---|---|---|
title | string | Display name (write-only at top level; read it from translations) |
key | string | URL-friendly slug |
data | array | Polygon coordinates [[x, y], ...] |
color | string | Hex colour: #RRGGBB, or #RGB (stored as #RRGGBB). No alpha and no CSS names — anything else is rejected with 400. Eight-digit hex is only for strokeColor and label.color |
fillOpacity | number | Fill transparency (0–1) |
strokeWidth | number | Border thickness |
strokeColor | string | null | Border hex color; null (default) = same as color |
fillPattern | string | none (default) or hatch — diagonal stripes over the fill. A tag with colorsAreas and its own fillPattern overrides it on the map |
flatIn3d | boolean | true = in the 3D view the area stays flat on the plan instead of standing as a block (a zone, a car park). Default false. A tag with flatIn3d does the same for all its areas |
heightIn3d | number | null | The area's own block height in the 3D view, 0.25–20 (% of the plan's longer side). null (default) = the project's height |
wallColorIn3d | string | null | The area's own wall colour in the 3D view, a hex colour like #334155. null (default) = the project's |
hoverOpacity | number | Opacity on hover |
zoomOnSelect | boolean | Zoom on click |
showInSearch | boolean | false = the place stays on the map — visible, clickable, with its card, reachable by ?areaId= / ?markerId= and as a route end — but the viewer search and the route builder's autocomplete don't list it (hedges, roads, service cells). Default true; a write that leaves it out keeps the stored value |
subLevelIds | array | Drill-down: IDs of the levels a click on the area opens (e.g. a building's floors). A level linked here is left out of the level switcher's normal list and reached through the area; showCard defaults to false when this is set. In a save that creates the levels too, their temporary ids from the same levels_data are accepted |
defaultSubLevelId | string | null | Drill-down: the sub-level the click opens first — must be one of subLevelIds (anything else is stored as null); null (default) = the first of them in level order. Lets a building keep its basement first in the switcher and still open on the ground floor. Editor: Settings → Levels → Entry Floors |
status | object | { "type": "...", "label": "..." } or null; type is one of success, warning, error, info. Responses contain only type — the label is returned per-language in translations.statusLabel |
address | string | Physical address |
workingHours | object | Schedule per day |
email | string | Email address |
webpage | string | Website URL. A javascript:, data:, vbscript:, file: or blob: link is rejected with 400 |
telephone | string | Phone number |
rating | number | Rating (e.g. 0–5) |
price | string | Free-text price in the default language; translations.<lang>.price holds the other languages (empty → this one) |
features | array | List of feature strings (write-only at top level; read per-language in translations.features) |
tags | array | Tag objects { "id", "name", "color", "showInLegend", "order" } in responses. On write, pass existing tag UUIDs (or objects with id); objects with name/color and no id create new tags |
subLevelIds and defaultSubLevelId are written with the area in PATCH /api/projects/{id}/ (levels_data); the per-entity PATCH /areas/{id}/ does not take them.
The project's tag list (tags on the project) carries two more flags per tag: colorsAreas (true = every area with this tag is drawn in the tag's colour instead of its own; of several such tags the first in list order wins) and fillPattern (none / hatch, the pattern such a tag adds). Both are written through tags_data like showInLegend.
A tag also carries flatIn3d (true = in the 3D view every area with this tag stays flat on the plan). Like the other flags it is written with tags_data and left as it is when the payload does not mention it.
Marker Fields
| Field | Type | Description |
|---|---|---|
title | string | Display name (write-only at top level; read it from translations) |
key | string | URL-friendly slug |
position | object | { "x": number, "y": number } — finite numbers only; NaN/Infinity (as strings or out-of-range literals) are rejected with 400, as for every numeric field |
type | string | Marker type (see table above) |
icon | string | Built-in icon name (Lucide) or custom icon URL |
customIcon | string | Custom icon UUID (set when using an uploaded icon) |
color | string | Hex colour: #RRGGBB, or #RGB (stored as #RRGGBB). No alpha and no CSS names — anything else is rejected with 400. Eight-digit hex is only for strokeColor and label.color |
size | number | Size in pixels, 4–100 (the editor's range; a value outside it is clamped, not rejected) |
opacity | number | Opacity (0–1) |
pinStyle | string | icon, dot, plain (drop-pin only) |
markerText | string | Text inside a badge marker, up to 6 characters ("12", "68a", "C1"). Not translated. Default "1" |
alwaysShowLabel | boolean | label-hover type: keep the label open on the map instead of only on hover (default false) |
heightIn3d | number | null | In the 3D view: how far the marker is lifted above the block or the ground under it, on a stem — 0–20 (% of the plan's longer side). null (default) or 0 = it sits on the surface |
showTooltip | boolean | Show tooltip on hover |
showCard | boolean | Show info card on click |
zoomOnSelect | boolean | Zoom on click |
showInSearch | boolean | false = the place stays on the map — visible, clickable, with its card, reachable by ?areaId= / ?markerId= and as a route end — but the viewer search and the route builder's autocomplete don't list it (hedges, roads, service cells). Default true; a write that leaves it out keeps the stored value |
status | object | { "type": "...", "label": "..." } or null; type is one of success, warning, error, info. Responses contain only type — the label is returned per-language in translations.statusLabel |
address | string | Physical address |
workingHours | object | Schedule per day |
email | string | Email address |
webpage | string | Website URL. A javascript:, data:, vbscript:, file: or blob: link is rejected with 400 |
telephone | string | Phone number |
rating | number | Rating (e.g. 0–5) |
price | string | Free-text price in the default language; translations.<lang>.price holds the other languages (empty → this one) |
features | array | List of feature strings (write-only at top level; read per-language in translations.features) |
tags | array | Tag objects { "id", "name", "color", "showInLegend", "order" } in responses. On write, pass existing tag UUIDs (or objects with id); objects with name/color and no id create new tags |
Translations
Translations are included in the entity response and can be set via the project update:
json
{
"levels_data": [
{
"id": "level-uuid",
"areas": [
{
"id": "area-uuid",
"translations": {
"ru": {
"title": "Кофейня",
"description": "Лучший кофе",
"statusLabel": "Открыто",
"features": ["Wi-Fi", "Розетки"]
}
}
}
]
}
]
}Area Images
Upload Image
http
POST /api/projects/{project_id}/upload-image/
Authorization: Bearer <token>
Content-Type: multipart/form-data
file=<file>Each image of an area or marker comes back as { id, url, thumbnails, medium, order }:
| Field | What it is |
|---|---|
url | The original file. |
thumbnails | One 150 px JPEG, for lists and pickers. Until it is generated (a moment after the upload) the list holds the original's URL. |
medium | An 800 px JPEG (longest side), made only for an original over 300 KB; null otherwise. Use medium ?? url wherever a mid-size picture is enough — the map's hover tooltip does. |
All three are read-only: they are made from the uploaded file.
Images can also be uploaded as part of the project update using multipart/form-data (fields level_{i}_image, level_{i}_area_{j}_image_{k}, level_{i}_marker_{j}_image_{k}) or as a base64 data: URI in a level's imageUrl.
Every path applies the same rules. The image type is detected from the file content, not its name: JPEG, PNG, GIF, WebP and SVG are accepted, anything else (including an .html renamed to .png) is rejected with 400 and the whole save is rolled back. The stored extension follows the detected type, so a JPEG posted as plan.png is served as .jpg. SVGs are sanitized (scripts, event handlers and non-image hrefs are stripped) and must have an <svg> root. Maximum size is 5 MB per file, and 40 megapixels (about 7 700 × 5 200) for a raster image — a larger one is rejected with 400 whatever its size in bytes.
Reusing an uploaded photo
An area or marker can take a photo the project already holds by its path instead of a new file: images: [{ "path": "<project_id>/uploads/photo-1a2b3c4d.jpg" }] (the path returned by upload-image, or the stored path of another area's or marker's photo). One file can be attached to many places. A path that is not a file of this project is rejected with 400 and the save is rolled back.