Get started
Map Studio API
Get started

Run Mountaya from your backend

Run Mountaya from your backend

Your backend holds the keys, mints the session tokens, and decides which member each write acts as. This page sets that up once, for a server that calls Mountaya on its own and for the pages it serves.

Keep three keys on your server

KeyLooks likeDoesLives
Publishable keypk_… with product scopesNames your organization on every callYour server, or a page
Secret keysk_…Mints session tokens, and nothing elseYour server only
Management keypk_… with management aloneAdministers members, invitations, keys and webhooksYour server only

Create all three under Organization → API keys in the Mountaya app, and read them from the environment:

export MOUNTAYA_PUBLISHABLE_KEY="pk_your_publishable_key"
export MOUNTAYA_SECRET_KEY="sk_your_secret_key"
export MOUNTAYA_MANAGEMENT_KEY="pk_your_publishable_key"

The app shows a secret key once, when you create it. Store it then.

Renew the session token before it expires

Every write, every Data API call and every management call carries a session token beside the key. A token lasts five minutes, so your server mints a new one before the last one expires. With the TypeScript client, a SessionTokenEngine does it for you:

# Mints one token: mint another before its expires_at.
curl -s -X POST https://api.mountaya.com/v1/sessions \
  -H "X-API-Key: $MOUNTAYA_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"publishable_key\": \"$MOUNTAYA_PUBLISHABLE_KEY\", \"user_id\": \"7a4e1c98-3b52-4f60-9d81-c05e2f7a83b1\", \"surface\": \"studio-embedded\"}"
Response to the mint
{
  "data": {
    "expires_at": "2026-11-19T10:05:00Z",
    "token": "sess_your_session_token",
    "user_id": "7a4e1c98-3b52-4f60-9d81-c05e2f7a83b1"
  }
}

Act as a member

A write acts as the member its token names, within their role. Mint each person's token with their Mountaya user_id, read from your own sign-in and never from the request.

People become members by invitation: an owner or admin invites their email address, and they accept in the Mountaya app. Each member, and each invitation still waiting, holds one of your agreement's seats. Manage members, invitations and keys shows each call, and how to look up a member's user_id.

Write with a member of its own

Writes no person makes, such as a nightly import from your catalog, act best as a member kept for them. Invite an address you control, such as integrations@example.com, as a contributor. Sign up with it in the Mountaya app, accept the invitation, and store its user_id.

What it writes then names that member, apart from your people. Removing a person never stops your import, and removing it never touches anyone's access.

Serve your own customers

Your organization holds every key, itinerary, zone, collection and webhook endpoint, and your keys write to it alone. Your own customers are not Mountaya organizations: serve them from yours. Give each person who edits a member of their own, and keep which customer owns what in your own records.

Next steps

Last updated