Appearance
API Keys
Pro & EnterpriseAPI key management requires a Pro or Enterprise subscription.
Compare plansAPI keys authenticate requests to the Layota embed, the public API and the REST API.
Key Types
| Type | Where it works | What it can read and change |
|---|---|---|
| Read | Embed, SDK, public API (/api/p/...) | Reads published maps through the public API — the same data any visitor of the map gets. Changes nothing. |
| Write | REST API (/api/projects/..., /api/templates/, /api/languages/), the analytics export, and the public API from a server | Reads and changes every project of your organization: drafts, archived maps, version history and the image library included. |
All keys look the same on the wire — sk_ followed by 64 hex characters. The type is chosen when the key is created and shown next to the key prefix in the dashboard.
A read key is not a secret. It is part of the embed code on your public page, so anyone who opens the page source can copy it — which is why it reads published maps only. On the REST API a read key gets 403, whatever the method:
json
{
"detail": "Read API keys work only with the public map API (/api/p/...) and the embed. This endpoint needs a write API key, kept on your server.",
"code": "read_key_public_only"
}So a copied read key exposes nothing beyond what the public API serves for your published maps: no drafts, no archived maps, no version history, no image library, no statistics. What it does give is the map itself on any site, past the allowed domains check — revoke the key to stop that.
Neither key type can touch your account or organization: /api/auth/*, members, billing, webhooks, analytics dashboards and API-key management always require a signed-in user (JWT) and return 403 for a key. The one exception is the analytics export, which a write key may read.
Creating Keys
- Go to Dashboard → API Keys
- Click Create Key
- Select the key type (Read or Write)
- Copy the key — it's only shown once

Using Read Keys
A read key lets a map with Allowed Domains load where the domain cannot be matched: a page that is not on the list, a mobile app, a script that calls the public API. A page on one of the allowed domains needs no key.
Web component:
html
<script src="https://app.layota.app/embed.js"></script>
<layota-map
src="https://app.layota.app/embed/PROJECT_ID?apiKey=sk_..."
style="width: 100%; height: 600px;"
></layota-map>iframe:
html
<iframe src="https://app.layota.app/embed/PROJECT_ID?apiKey=sk_..."></iframe>SDK:
typescript
const map = new LayotaMap({
container: '#map',
projectId: 'PROJECT_ID',
apiKey: 'sk_...',
})To read a published map from your own code, call the public API with the key in the Authorization header:
bash
curl -H "Authorization: Bearer sk_..." \
https://api.layota.app/api/p/PROJECT_ID/Using Write Keys
Write keys are used with the REST API for server-to-server access:
bash
curl -H "Authorization: Bearer sk_..." \
https://api.layota.app/api/projects/DANGER
Never expose write keys in client-side code. Use them only on your backend server.
The embed enforces this: a write key placed in /embed/{id}?apiKey=... (or the SDK apiKey option) is refused by the public API with 403 and the code write_key_in_embed. Create a read key for embeds. Server-to-server calls to the public API keep working with either key type.
Revoking Keys
Delete a key from Dashboard → API Keys. Revocation is immediate — existing embeds using that key will stop working.