Skip to main content

Authentication

Most requests to the Gomry API must include a credential. The exception: an agent can browse events and build an order with no credential at all.

For agents: no credential needed to quote

Create the checkout session with no credential and send your buyer its continue_url. They pay there by card, Apple Pay or Google Pay; nobody signs in to Gomry and nobody approves your agent. You need a credential only to pay yourself with a Shared Payment Token through complete, which otherwise answers 401 authentication_required. A credential that is sent and fails (wrong key, expired token, empty header, a key in the query string) always gets its 401. It is never treated as no credential.

For agents: get a credential yourself

You do not need an API key or a human to browse the catalog or buy tickets. Register once, then exchange your secret for a token whenever you need one. 1. Register (once). Send no redirect_uris. Save the client_secret: it is shown only once.
2. Get an access token. Tokens last 15 minutes and there is no refresh token: request a new one with the same secret.
3. Call the API with Authorization: Bearer:
The token response says scope: checkout:write. That is expected: catalog read access comes with it. Every endpoint outside the catalog and checkout answers 403, because this credential belongs to no organization. Full walkthrough, including payment: gomry.com/auth.md.

Can’t send a client secret? Let the person sign in

Some agent platforms keep secrets away from the model, so they cannot send client_secret to the token endpoint. If a person can sign in, use the standard OAuth 2.1 authorization-code flow with PKCE instead and request checkout:write alongside mcp:
The consent page tells the person your agent can buy tickets for them. Their access token then works on the catalog and checkout as Authorization: Bearer, and the purchase is theirs: send no buyer and their verified name and email are used, and the tickets appear in their Gomry account. A token without the scope gets 403 insufficient_scope naming checkout:write; a token whose grant the person revoked stops buying at once (401). Full walkthrough: gomry.com/auth.md.

For integrations: organization API keys

Organization API keys are scoped to your organization and gated by a per-resource scope map that controls which resources the key can read or write. See Scopes for the full list and how to configure them.

Generating an API Key

  1. Log in to your Gomry dashboard
  2. Navigate to Organization Settings → API Keys
  3. Click Create API Key and give it a descriptive name
  4. Copy the key immediately — it is only displayed once
Treat your API key like a password. Anyone with your key can read your organization’s event data. Never commit it to version control or expose it in client-side code.

Using Your API Key

Include the key in the X-API-KEY header on every request:

Security Best Practices

Never hardcode API keys in your source code. Use environment variables or a secrets manager.
API keys should only be used in server-side code. Never include them in frontend JavaScript, mobile apps, or any code that runs on user devices.
Create a new key and revoke the old one periodically. You can manage keys in your dashboard under Organization Settings → API Keys.
Create a dedicated key for each integration or service. This way, if a key is compromised, you can revoke it without affecting other integrations.

Authentication Errors