Skip to content

Authentication

Every request carries an API key in the Authorization header.

Send the key as a bearer token on every request:

Authorization: Bearer lsk_…

The only route without a key is a report's PDF: its signed link is enough, for 7 days.

Keys

  • Make and revoke keys in Settings › API keys. Only Admins can.
  • A key is shown once. LenSEO keeps only its SHA-256 fingerprint, so a lost key can't be shown again: make a new one.
  • A key works on the account that made it, with a Member's rights: it reads and starts work, but can't change billing, the team or keys.
  • Revoking a key stops it at once and removes the webhooks it subscribed.
  • Settings › API keys shows when each key was last used.

Keep keys secret

A key can spend the account's credits. Use it from your server, never in a web page or an app you hand out. If one leaks, revoke it.

Language

Error messages come in the language of the account that owns the key, English or Arabic. Codes, field names and values are the same in both.

When a key is refused

StatusCodeWhy
401unauthenticatedNo key, or not sent as Bearer.
401invalid_keyThe key isn't valid, or it was revoked.
402entitlement_exceededThe account's plan doesn't include the API.