Skip to main content
An integration authenticates its Pretectum API requests with an API key. A key is a long-lived credential that you create in the Pretectum app and send on each request. There is no token to exchange and no expiry to refresh against, so integrating is a single header. (A tool acting on a signed-in person’s behalf can send that user’s access token in the same header instead; see Access Tokens.)

Creating a key

Keys are managed in the Pretectum app under Configuration → API Keys. Creating one asks for:
The key is shown once, at the moment it is created. Pretectum stores only a hash of it and cannot show it to you again. Copy it before closing the dialog. If you lose it, delete the key and create another.
Afterwards the list shows a masked form, such as pre_Ab3d********Xy9z, which is enough to tell your keys apart but not to authenticate with.

What a key looks like

Every key starts with the pre_ prefix followed by 40 alphanumeric characters. The prefix makes keys easy to spot in logs and in secret scanners.

Using a key

Send the key in the Authorization header:

What a key can do

A key carries no permissions of its own. It is granted access the same way a person is:
  1. Roles decide which resources the key may act on, and which of view, add, edit and delete it may perform on each.
  2. Business areas decide which data the key may reach. A key with no business area assignment sees nothing, whatever its roles say.
Both are managed in the Pretectum app by your tenant administrator. Changes take effect on the next request; there is no token to expire first.

Managing keys

You can create as many keys as you need, and it is worth using one per integration rather than sharing a single key. Each key records its own last-used timestamp, so a key that stops being used is easy to spot and safe to delete. A key can be: Deleting a key takes effect immediately.

Error responses

A 401 means the credential itself was rejected; check the key, or sign in again if you sent a token. A 403 means the credential is fine but its access is not; ask your tenant administrator about roles and business areas.

Keeping keys safe

  • Store keys in a secret manager or an environment variable, never in source control.
  • Never put a key in client-side code, a browser request, or a URL query string. Anyone who reads it can act as your integration.
  • Rotate by creating the replacement first, moving traffic to it, then deleting the old key. Keys are independent, so there is no window where neither works.
  • Delete keys you no longer use.