View as Markdown

API keys

Every request is authenticated with a key sent as a Bearer token. A key belongs to one workspace and one mode.

Send a key

request
curl https://globalymint.com/api/v1/customers \
  -H "Authorization: Bearer gpy_test_…"

A missing, unknown, expired or revoked key answers 401 with the code unauthorized. A valid key that is not allowed to make the call answers 403 with the code forbidden, and the message names the scope it needs.

Key types

PrefixTypeUse it
gpy_test_ / gpy_live_DeveloperFrom your server. Full access, or restricted to scopes.
agk_test_ / agk_live_AgentFor an AI agent acting for you. Give it only the scopes it needs.
pk_test_ / pk_live_PublishableSafe in a browser. It can read one thing: a pricing table.

After the prefix comes 43 random characters. The prefix shows the type and the mode at a glance, so a key in a log or a commit can be recognised without a lookup.

A publishable key takes no scopes and is refused with 403 on every route except the pricing table read. The SDK refuses to start with one.

Create, roll and revoke

Create keys in the dashboard under Developers › API keys. The key is shown once. We store only a SHA-256 hash and the last four characters, so a lost key cannot be recovered: revoke it and create another, or roll it.

Keys are managed from a signed-in session only, by the owner, admin or developer role. A request to /api/v1/api-keys made with an API key answers 403, so one key can never create, list, roll or revoke another. Revoking is permanent and takes effect on the next request.

New keys expire after 90 days unless you choose 30 days, 1 year, a custom date or never. Publishable keys never expire unless you set a date. After a key expires it answers 401. Seven days before, we email your owners and admins and send the api_key.expiring event.

Keep keys safe

  • Keep secret keys on your server, in a secret manager or an environment variable. Never ship one in a browser or a mobile app.
  • Give each service its own key, with only the scopes that service needs.
  • Use test keys everywhere except production.

What a key can never do

A key acts with the developer role. It cannot refund a payment, change workspace settings, change payment provider credentials or manage the team. Those need a signed-in person with the right role, and a key answers 403 on them whatever its scopes.

On this page