Skip to content
Status

Authentication with API keys

If you are integrating your own Shuttle account, you authenticate with one of your account’s API keys. An API key starts with ik_ and reaches only your account.

Building a platform for many merchants? See Authentication for platforms. Calling the API with an OAuth access token from account sharing? See Calling the API with an access token.

In the Merchant Portal, open your account and select Settings in the menu. Your keys are in the API Keys section of the Edit Account page. You need the Admin role. API keys come with the paid plans: on other plans the API Keys section is marked UPGRADE instead.

Select Create key. The new key is shown once: copy it straight into your secret store (a secrets manager or your deployment’s encrypted environment variables), then confirm you have copied it. After that the Merchant Portal shows only the start and end of the key, when it was created and when it was last used. If you lose a key, create a new one and delete the old one. For each step in the Merchant Portal, with screenshots, see API keys.

If a platform manages your account, it can also create keys for you in the Shuttle portal, from your account’s panel.

Keep the key on your server. Anyone with it can take and refund payments on your account, so never put it in a browser, a mobile app or a code repository.

Use HTTP Basic authentication with your API key as the password. The username is optional; if you send one, it must be your account’s instance key, shown on the same page. Most HTTP clients do this for you:

Terminal window
curl -u "$INSTANCE_KEY:$SHUTTLE_API_KEY" \
"https://app.shuttleglobal.com/c/api/transactions?limit=1"

The key identifies your account, so the path doesn’t need your instance key. If you build the header yourself, Base64-encode the instance key, a colon and the API key:

const auth = Buffer.from(`${process.env.INSTANCE_KEY}:${process.env.SHUTTLE_API_KEY}`).toString('base64')
const response = await fetch('https://app.shuttleglobal.com/c/api/transactions?limit=1', {
headers: { Authorization: `Basic ${auth}` }
})
const { transactions, meta } = await response.json()

A successful call returns your most recent transaction in a transactions list, and meta gives the limit, offset and total.

Shuttle also accepts:

  • the API key as the username with a blank password: curl -u "$SHUTTLE_API_KEY:" ... (note the colon after the key)
  • the API key as a bearer token: Authorization: Bearer ik_...

Every endpoint in the Merchant Instance API works with your key. The reference shows each path as /c/api/instances/{instance_key}/.... Both forms work with an API key: put your own instance key in the path, or leave /instances/{instance_key} out, for example https://app.shuttleglobal.com/c/api/payments.

Your account can have at most two API keys, so you can change over without downtime:

  1. Create a second key.
  2. Switch every integration that uses the old key to the new one, including any Twilio or Telnyx Pay Connector that uses it as its password.
  3. When the old key’s Last used date stops changing, select Disable on it. A disabled key is refused; select Enable to bring it back if something still needs it.
  4. Once nothing needs it, select Delete on the disabled key. Only a disabled key can be deleted, and a deleted key can’t be restored.

Rotate straight away if a key may have been exposed: committed to a code repository, written to a log, or pasted into a ticket, chat or email.

Accounts set up before API keys have a secret key (it starts with sk_). API keys replace it. Your old secret key stops working, for good, at the first of these:

  • 24 hours after any new API key on your account is first used,
  • after 28 days without use, though never before 30 November 2026, 12:00 UTC, or
  • straight away, if you delete it in the API Keys section (Delete old key (recommended)).

To change over, create a new API key, then switch every integration that uses the old secret key, including any Twilio or Telnyx Pay Connector, within 24 hours of each other. Then delete the old key. If you delete all of your API keys while the old secret key still works, the 24 hours start again when a new API key is first used.

A request with a missing or invalid key gets a 401 response. Check that:

  • the API key is enabled and hasn’t been deleted
  • the API key is the password (or the username with a blank password), not your instance key
  • if you send a username alongside the API key, it is your own account’s instance key
  • you are not still using an old secret key that has stopped working (see Replacing an old secret key)

Was this page helpful?