Lockally

      Use your API key in the examples

      Replaces lk_live_… in the code samples on this site so you can copy and run them. It is stored in this browser only and is never sent anywhere, including to Ask AI.

      It will be visible on the page. Use a test key if you are sharing your screen or taking screenshots.

      API security

      A short list, because a long one gets skimmed. Each links to the page that covers it properly.

      1. Keep the key server-side A secret key in a browser is a key anyone can read
      2. Scope it down A key that can only send cannot delete a mailbox
      3. Verify webhook signatures Your endpoint is public; anything can POST to it
      4. One key per environment and deployment So revoking one costs you one thing
      5. Rotate on exposure, not on a calendar Rotation matters when something leaked

      1. The key is a password

      lk_live_ keys authenticate as your whole workspace. There is no per-request signing and no client-side key: a key in JavaScript, a mobile binary or a public repository is compromised the moment it is readable.

      If a browser needs to trigger mail, it calls your server and your server calls us. See Storing keys safely.

      2. Scopes are the real control

      Test mode suppresses delivery, not authorisation. If you want a key that cannot do damage, the tool is scopes, not test mode.

      A CI key that sends and reads sends needs send:write and send:read and nothing else. A key with mailboxes:write can delete a mailbox and its mail, and no amount of care in your code prevents that if the key is taken.

      Scopes cannot be added to a key after it is issued. That is deliberate, and it means the cheap thing is to issue a new key for a new job rather than reach for a broad one. See Permissions and least privilege.

      3. Verify every webhook

      Your endpoint is on the public internet. Anything can POST a plausible-looking delivery event to it, and if your handler acts on an unverified body, anybody can tell you a message bounced.

      The signature is an HMAC over the raw body with a timestamp. Verify it with a constant-time comparison, check the timestamp is recent, and read the raw body rather than a re-serialised parse. See Signature verification.

      4. One key per environment, per deployment

      Not for tidiness. When something leaks you want the blast radius to be one service, and you want to be able to revoke it without an outage somewhere else. A single shared key makes every incident a full-estate incident.

      Label keys for where they run (ci, staging, prod-worker), because an unlabelled key list is one nobody dares revoke from.

      5. Rotate when there is a reason

      Calendar rotation is mostly theatre: it costs a deploy, it creates a window where two keys are live, and it does not help with the thing that actually happens, which is a key appearing somewhere it should not.

      Rotate immediately on exposure, on a person leaving, or on a vendor change. See Rotating keys.

      The rest of this section