Skip to content

API keys

Each project has a public key and any number of secret keys, for Test and for Live. Public keys go in your web page and secret keys stay on your server. See Test and Live for how they differ and how allowed websites work. Open API keys in the dashboard to manage them.

  1. Switch to Test or Live. Keys belong to one environment.
  2. Select Create secret key.
  3. Name it after the place it runs, such as Production server, so you can tell keys apart later.
  4. Choose what it can do (below), then select Create key.
  5. Copy the key. It is shown once and cannot be shown again.

A project can have up to 25 active secret keys in each environment. Only Admins and Owners can create, rotate or revoke keys; members can see the list.

Give each key the least it needs.

Permission What it can do
Full access Everything this project can do.
Emailer Send email and read email activity.
Forms Read submissions and submit entries.
Read only Read routes only. No writes, no sends.

A key that calls something its permission does not cover gets 403 insufficient_permission.

Rotate to swap a key without downtime.

  1. On the key, select Rotate.
  2. Choose how long the old key keeps working: now, 1 hour, 24 hours or 7 days.
  3. Copy the new key. It is shown once.
  4. Put the new key on your server, then let the old one expire.

Pick a grace period long enough to redeploy everywhere the key is used.

Revoke stops a key at once. Requests signed with it fail straight away, and this cannot be undone. You confirm by typing the key’s name. Revoke a key you no longer use, or one that leaked.

Terminal window
curl https://api.copilot.launchwing.io/v1/key \
-H "Authorization: Bearer $COPILOT_SECRET_KEY"

The response names the project, the environment, the kind of key and its permission. The first call also ticks First request received on the setup checklist. A key’s Last used time appears within about 10 seconds of a request.

  • 401 unauthorized. The key is wrong or was revoked. A wrong or revoked key from a browser also reads as 401.
  • 403 insufficient_permission. The key’s permission does not cover the action. Create a key with more access.
  • 409 key_not_active. The key was revoked. Create a new one.
  • 409 key_limit_reached. The environment already has 25 active secret keys. Revoke one you no longer use.
  • You lost a secret key. It is shown once. Rotate the key and copy the new one.
  • The key’s Last used time is empty. It appears within about 10 seconds of a request.

Still stuck? Write to support@launchwing.io and quote the requestId from the error. See API errors.