API keys
Create, scope, roll and revoke the API keys your servers use for the public API, and what happens to a key when people leave.
An API key belongs to your workspace, not to a person. It authenticates your servers to the public API. Keys are managed only in the console: there is no API call that creates, lists or revokes a key, so a key that leaks cannot be used to make more.
Test and live keys
Every key is either a test key or a live key, and you can tell them apart by how they start:
pb_test_… works only on test data, sends no email
pb_live_… works on your real workspaceUse Test mode in the top right of Settings → Developers to switch the page between the two. Test keys are available on every plan. Live keys need a plan that includes them; on a plan without them, the live view links to your plan. How many keys of each kind you can have depends on your plan, and revoked keys don't count.
Create a key
Owners and admins can create keys.
Open Developers
Go to Settings → Developers → API keys, and choose test or live with Test mode.
Create the key
Choose Create test key (or Create live key), give it a name, and choose what it can do: a preset (Read-only sync, HRIS onboarding, Full integration) or each scope yourself. Optionally set an expiry and the IP addresses it may be used from.
Copy it
The whole key is shown once. Copy it into your secret manager and tick I have stored it somewhere safe. Pagebread keeps only a hash of the secret, so the key can never be shown again; if you lose it, roll the key.
After that, the key is shown as pb_live_… followed by its last four characters.
Warning
Never commit a key to source control, put it in a URL, or use it from a web page. A key in a URL query string is refused with 400 credentials_in_url, and a key used from a browser with 400 browser_request_refused. Roll any key that was exposed.
Scopes and who is responsible
Scopes say what a key may do. Each key also has a member who is responsible for it, at first the person who created it. A key can never do more than that member's role allows today: if their role changes, the key's effective_scopes change with it on the next request, and its stored scopes stay as they were. GET /v1/me shows both.
When you create a key you can only give it scopes your own role covers, and the dialog marks the scopes whose reads are logged as Sensitive.
Expiry and IP allowlists
- Expiry: never, or 30, 90 or 365 days. A key stops working the second it expires, and the owners and admins get a notice a week before and a day before. A request with an expired key is answered
401 api_key_expired. - IP allowlist: up to 20 addresses or CIDR blocks, IPv4 or IPv6. A request from anywhere else is answered
403 ip_not_allowed. Leave it empty to accept any address.
Roll a key
Rolling gives you a new key with the same name, scopes, allowlist and version, while the old one keeps working for an overlap so you can deploy the new one first. Choose Roll on the key and how long the old one should keep working: stop it now, 1 hour, 24 hours or 7 days. The new key is shown once, like a new key.
Revoke a key
Revoke stops a key on its very next request, on every server. It cannot be undone. A revoked key stays in the list, struck through, for 90 days. Requests with it are answered 401 api_key_revoked.
When people leave
When someone who is responsible for keys is removed from the workspace, the person removing them chooses: Revoke them (the default) or Keep for adoption. A kept key keeps working for 14 days, limited to what the departed member's role allowed. During that time any owner or admin can Adopt it and become responsible for it; scopes their own role does not cover are removed. Owners and admins get a notice 7 days and 1 day before the deadline. A key nobody adopts is revoked.
Someone who leaves a workspace of their own accord has their keys revoked.
If a workspace is scheduled for deletion, all its keys are revoked, and they are not restored if the deletion is cancelled.
What is recorded
Every change made to a key in the console — created, rolled, revoked, adopted — is recorded with who did it and shows in the workspace's activity log. If Pagebread support revokes a key, the activity log says so and the owners and admins are told.