How to Switch from the Legacy API Key to Service Accounts
Replace the old company-wide API key with a service-account key for each integration so you can limit access, rotate without downtime, and keep using the same API after 3 February 2027.
Use this when an integration still uses the original company-wide Clean Smarts API key. You will create a service account, mint a new key, point the integration at it, then revoke the old key.
Applies to: Account administrators with the Manage Account module on the Expert plan. Service-account keys are created in the web portal under Company Settings → Security. They are not billed seats.
The old key still authenticates through Wednesday, 3 February 2027. After that date it will no longer work.
Before You Start
- Confirm you can open Company Settings. If Company Settings is missing from your profile menu, you need the Manage Account module.
- Confirm the company is on Expert. Foundation and legacy plans see Upgrade to Expert on the Security page instead of the API Keys card.
- List every place the current key is stored: Zapier or Make, a script, Power Automate, an AI tool, or a vendor.
- Have access to update that secret in each of those systems.
- Decide one service account per integration. A second key on the same account is only for rotation.
Why Switch
The Legacy company API key is one shared secret for the whole company. It authenticates with the same access as a company administrator. Rotating it updates every caller at once.
A service account is a non-human profile that owns its own keys. Switching gives you:
- A separate key for Zapier, the hours export, a Teams bot, or any other tool, so rotating one does not break the others.
- Modules and locations limited to what that integration needs.
- Job history and issue records that show the service-account name, not an admin’s login.
- Keys you create and revoke yourself. Clean Smarts shows the secret once and does not email it.
Host, POST paths, and the X-Api-Key header stay the same. You only replace the secret.
Create a Service Account
- Sign in to the Clean Smarts web portal.
- Click your profile in the bottom-left corner and choose Company Settings.
- Open Security.
- Under API Keys, click Create service account.
- Enter a Name that matches the integration, such as
Hours exportorZapier. - Leave Kind on Service account, unless this integration should act as a building client. Use Customer service account only when issues and other records should follow customer (Tier-II) rules.
- Under Modules, check only the capabilities that integration needs. Use Select all only if the tool truly needs every eligible module.
- Under Locations, choose All Locations or Selected Locations.
- All Locations includes current sites and sites you add later.
- Selected Locations limits the key to the sites you pick now.
- Click Create.
The new row appears in the API Keys table with No keys until you mint one.
You can only grant modules your own login already has, and only modules that the API supports. Manage Account is never available on a service account.
Create a Key and Update the Integration
- On the new service-account row, click Create key. If the account already has a key, open the ⋯ menu and choose Create key.
- In the Mint key dialog, enter a Key name.
- Optionally set Expiration (optional). Leave it blank if the key should not expire.
- Click Mint key.
- Copy the API key secret immediately. The warning on that screen is accurate: you will not be able to view the secret again.
- Click Close.
- In the integration, keep the same request shape:
POST https://admin.cleansmarts.com/api/v1/...with the secret in the X-Api-Key header. Replace only the secret. - Run a real request the integration already uses and confirm it succeeds.
Endpoint reference: developer.cleansmarts.com.
API access is also covered by the SaaS Services Agreement and the Privacy Policy.
Revoke the Legacy Company API Key
Do this only after every caller is using a service-account key.
- Stay on Company Settings → Security.
- In the API Keys table, find the Legacy company API key row (it has a Legacy badge).
- Click Revoke key.
- Confirm. Callers still using that secret stop immediately.
If anything still fails, put the integration back on its service-account key. Do not recreate a company-wide key. Mint another service-account key instead.
Choose Modules for Common Jobs
Grant the view or edit module that matches what the integration actually calls:
- Users (View) or Users (Edit) for staff lists (
get_usersand related user reads). - Locations (View) or Locations (Edit) for site data.
- Timetracking (Edit) for hours and Time Detail-style reads, and for changes to time entries. Timetracking (View Others' Time) is not available on a service account. Hours routes accept Timetracking (Edit), so a read-only export still needs that module.
- Inspections (View) or Inspections (Company) for inspection reads.
- Work Orders (View) or Work Orders (Edit) for work-order (job) reads and writes.
- Issue (Company) for company-side issue access. A Customer service account uses customer issue rules instead.
When you are unsure, start with the view module, test the call, and add more only if the response is denied.
Rotate a Service-Account Key Later
- On that service account, choose Create key again and mint a second key.
- Point the integration at the new secret.
- Confirm the integration is healthy.
- Click Revoke key on the old key.
Editing the service account’s name, modules, or locations does not require a new key.
Tips and Troubleshooting
I see “An Expert plan is required to create and manage API keys.” The API Keys card is Expert-only. Click Upgrade to Expert on that page, or ask Clean Smarts to move the account, then return to Security.
I don’t see Company Settings. Your role is missing Manage Account. Ask an account admin to grant it.
The request returns 401 after I switched. The integration is still sending the old secret, the new secret was copied incorrectly, or the key was already revoked. Create a new key, copy it once, and update the caller.
The request returns 403 with module_access_denied or location_access_denied. The service account is working, but it does not have the module or location for that call. Edit the account and grant the matching module, or add the site under Selected Locations. The legacy key used to run with administrator access, so a first 403 after the switch usually means the new account is narrower than the old key.
I closed the secret panel without copying. You cannot view that secret again. Mint a new key, update the integration, then revoke the unused one.
The page says “We couldn't load your API keys.” Existing keys keep working. You can still edit service accounts. Click Retry, or contact support@cleansmarts.com if it continues.
Several tools still share one key. Create a service account for each remaining tool, move those callers, then revoke the leftover key. One shared service-account key has the same rotation problem as the legacy key.