Starter API keys and the playground sign with a test certificate that is not publicly trusted.

LENS PROOF SIGN API

Authentication

Every request carries a Lens Proof Sign API key as a bearer token, and a key works only from a server.

View as Markdown

Send the key

Send the key in the Authorization header:

text
Authorization: Bearer lps_live_<keyId>_<secret>

The prefix does not identify certificate trust. Starter-workspace keys also use this format and sign with a test certificate.

Each key starts with the fixed prefix lps_live_, followed by a key id of 16 lowercase hexadecimal characters, an underscore, and a secret of 43 characters. The key id is not secret, and the developer console shows it next to each key. The whole key is the secret.

A request with a missing, malformed, unknown, or wrong key gets 401 with the code unauthorized and a WWW-Authenticate: Bearer header. The answer is the same in all four cases, so it does not show whether a key exists.

Keep the key on your server

The API refuses every request that carries an Origin header, with 403 and the code origin_not_allowed. Browsers add an Origin header to a POST request, so a key can't be used from a web page. The API also sets no cookies and allows no cross-origin requests.

  • Keep the key in a secret store or an environment variable on your server.
  • Never put the key in browser code, a mobile app, or anything else that runs on a user's device.
  • Never put the key in a repository, a log, or an error report.
  • Give each environment its own key, so that you can revoke one key without stopping the others.

If people upload files in your web app, send the files to your own server first, and call the API from there.

Create a key

Sign in to the developer console with your Google account. If you do not belong to an organization yet, start a workspace to receive 10 test-certificate signatures and an automatically created API key. Copy the key when it appears; it is shown only once. No approval or payment is needed for this starter workspace.

If you already belong to a team, use that team's workspace. An organization waiting for approval follows the access status shown in the console. For access beyond the starter allowance, contact sales.

  • Only an admin of the organization can create, rotate, or revoke keys. Any member of a trial or approved organization can see the list of keys.
  • Each key has a label of 1 to 60 characters, and it lasts 1 to 365 days.
  • An organization can hold 10 keys that are not revoked.
  • The console shows the full key once, when it is created. Copy it into your secret store at that point, because it can't be shown again. If you lose a key, create another key and revoke the lost one.
  • Starter signatures are shared across every key in the workspace. Approved organizations have shared request limits. See Limits for admission, retries, and what consumes an allowance.

Lens Proof can also issue a key to you directly, under your organization's limits.

Rotate a key

Rotate a key to replace it without a gap. Rotation creates a new key with the same label and AI disclosure policy, and the old key keeps working until you revoke it. The new key lasts as long as the old key was set to last, counted from the day you rotate it, up to 365 days.

  1. Rotate the key in the console, and copy the new key into your secret store.
  2. Deploy the new key to your servers.
  3. Revoke the old key once no server uses it.

Revoke a key

Revoke a key in the console when you no longer need it, and revoke it at once if it may have leaked. A revoked key stops working on the next request, and requests with it get 403 with the code key_revoked. A request that is already running when you revoke its key still finishes.

A key also stops working when it expires, and requests with it then get 403 with the code key_expired. Rotate a key before its expiry date to avoid a gap. If Lens Proof pauses your organization's access, requests with any of its keys get 403 with the code customer_paused.