Authentication
Every request carries your publishable key. Most also carry a short-lived session token, which your server mints with your secret key.
The Data API needs a session token on every request. Create an account and keys shows where to create keys.
A publishable key opens only the APIs its scopes name, such as data or tiles. Enable only what each integration needs: the scope table is on Create an account and keys.
Add one route to your backend. It calls POST /v1/sessions with your secret key, and returns the token to your page.
Hand your route to the TypeScript client. It mints a token before the first request, and renews it before it expires.
In React, the useSessionToken hook does the same. Without the SDK, send X-API-Key and X-Session-Token on each request, and mint a new token about a minute before expires_at.
A publishable key identifies your organization, not a person. To act as one of your members, mint the token with their Mountaya user_id. Add surface: "studio-embedded" for an Embedded Studio and every itinerary, collection, or zone write.
Every request made with that token acts as that member, within their role. Mint it only for the person signed in to your own product.
The surface field sets who a token is for, and the token keeps it for life. Leave it out for your own servers, pages, and SDK calls. Use studio-embedded for every Embedded Studio, the editor and its read-only viewer alike.
A publishable key without a token, or with a token minted without user_id, reads what you publish. It never reads drafts, and lists only public items. Only a token for a member reads your drafts and private items.
A public page, such as a read-only studio, runs on a token minted without user_id. Mint it for a publishable key of its own, and hand every visitor the same token until shortly before it expires.
List the sites that may use your publishable key from a browser under Organization → Security. Enter each host with an optional port, such as maps.example.com or localhost:3000, and list each subdomain on its own.
An empty list lets any page call the APIs with your key, but lets no site frame the hosted embed. So list every site you embed on.
You list one domain unless your agreement allows more. To list another, talk to us.
A share link opens one itinerary, or one collection with everything filed in it, read-only and as last published. Anyone holding the link can open it, so rotate it to cut off the old URL. Create one in the studio, or with POST /v1/itineraries/{itinerary_id}/share-link.
A map tile or an <img> request cannot set headers. The Tile API and the Data API accept ?publishable_key= and ?session_token= instead, and a share link ?share_token=.
AI assistants connect to the MCP server over OAuth, and never see a secret key. How OAuth access works is the full model.