Housecall Pro API keys have no scopes, so your .NET service has to supply them
This article was drafted with AI help and reviewed by the author. Most APIs that expect a backend integration give you scopes. You ask for read access to one object and nothing else. Housecall Pro does not work that way
This article was drafted with AI help and reviewed by the author.
Most APIs that expect a backend integration give you scopes. You ask for read access to one object and nothing else. Housecall Pro does not work that way. When an Admin generates a key, the choice is Full access or Read-only. That is the whole permission model.
Housecall Pro's own API overview describes a key as a way into everything stored in the account. So if a reporting job needs customers and a booking service needs to write jobs, there is no setting that gives each exactly what it needs.
In that situation your own service has to be the scope. This post lays out one way to do it with ASP.NET Core and Azure. It draws on Housecall Pro's API overview, the Azure Key Vault configuration provider docs and the Azure Identity guidance, read on 2 December 2026. Nothing here was run against a real account.
Put one small API in front of the key
Make one ASP.NET Core service the only holder of the key. Everything else, including workflows, dashboards and mobile apps, calls that service.
Give it narrow endpoints that match real needs.
- Read the open windows for a technician and a job length.
- Create a booking request with a request id.
- Read the status of a request.
Do not build a pass-through proxy that forwards any path to Housecall Pro. A proxy with the full key inside it is the same risk with an extra hop.
Callers authenticate to your service with Microsoft Entra ID tokens. Each caller is a separate app registration or managed identity, and each endpoint checks the caller's role. A dashboard identity gets the read endpoints. A booking workflow gets the create endpoint as well.
Two keys, split by purpose
Housecall Pro lets you name a key and delete it. That suggests more than one key can exist at the same time. Confirm it in your own account before you plan around it.
If it holds, create two.
- A Read-only key, used by the component that only reads windows and jobs.
- A Full access key, used by the one component that writes.
Store them as two secrets in Azure Key Vault. Then separate who can read them.
- The reading component runs under a managed identity that can read only the Read-only secret.
- The writing component runs under a different managed identity that can read only the Full access secret.
Azure RBAC supports role assignments at the scope of a single secret. Microsoft's guidance cautions against piling up many per-secret assignments, so a small vault dedicated to this integration is often simpler. Pick based on how many teams touch the vault.
Be clear about what this achieves. A leaked Read-only key still exposes the whole account for reading. The split limits damage from a bug or a leak in the reading component. It does not make either key safe to share.
How the service gets the key
In production, use a managed identity and ask for it by name. Microsoft's Azure Identity guidance recommends a specific credential such as ManagedIdentityCredential in production, because DefaultAzureCredential tries a chain and can quietly pick a different identity than you meant. Keep DefaultAzureCredential for local development if you like.
The key does not belong in appsettings, in a pipeline variable that prints, in a container image or in a chat thread.
Rotation without an outage
Housecall Pro says deleting a key breaks any integration that uses it. That tells you the order of operations.
- Generate a new key and name it with its purpose and the date.
- Write it to Key Vault as a new version of the secret.
- Wait for the service to pick it up.
- Make a harmless read through the service and confirm it works.
- Only then delete the old key in Housecall Pro.
Step three needs care. The Key Vault configuration provider reads secrets once and holds them unless you set a reload interval. With an interval, it polls and notices the new version. Code must also read through a mechanism that sees changes, such as IOptionsMonitor, not a value copied at startup. If you skip this, you will rotate the key and the old one will keep being used until the next restart.
Keep the old key alive until step four has passed. If the new key fails, the rollback is to point the secret back to the previous version.
A sample hand-off
A contractor builds a dashboard for a company. The company's Admin creates a Read-only key named for the contractor and the month. It goes into the vault, and only the dashboard's identity can read it.
When the engagement ends, the Admin deletes that one key. The booking service, which uses a different Full access key, keeps working. Nobody had to rotate everything or ask the contractor whether they kept a copy of the secret value.
That is the practical gain of naming keys by purpose and owner.
Keep an eye on the vault
If one identity can read the key, then reads of the secret are worth watching. Turn on Key Vault diagnostic logging and send it to a log workspace. Alert on reads by any identity you do not expect. Alert on a read that happens far from a deployment or a restart.
Also keep the key out of your own logs. Do not log request headers. Log your request id and the Housecall Pro response status, nothing more.
Takeaways
- Housecall Pro keys are Full access or Read-only, so build the narrower scopes in your own service.
- Expose narrow endpoints, not a pass-through proxy.
- Use separate keys and separate identities for reading and writing, if your account allows more than one key.
- Use a named managed identity credential in production.
- Rotate by adding the new key first, verifying, and deleting the old one last.
- Make sure the service can see a new secret version without a restart.
For the situations where a custom integration is worth building at all, the Housecall Pro integration blog explains when native tools stop being enough.
References
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.