> ## Documentation Index
> Fetch the complete documentation index at: https://developers.luccasoftware.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Security Best Practices

> Your Lucca account contains sensitive data which you wouldn't want leaked.

**1. Create a new client application for each integration scenario**

This limits the depth and breadth of OAuth scopes granted to any single client application, reducing exposure in case of a credential leak.

**2. Fewer scopes is better**

Only give the bare minimum scopes needed to your client application.

Similarly, only request the subset of scopes needed to achieve what you want when requesting an access\_token. In any case, there's a limit to the number of scopes (max: 4,000 characters) that can be granted to a single access\_token and you will get an error if you attempt to exceed it.

**3. Request a new access token for each new exchange**

Divide your integration scenario into atomic flows, and generate an access\_token for each one. This makes it possible to give a very restricted set of oauth scopes to each access\_token.

The Lucca API imposes a short lifetime to all access\_tokens in order to encourage such behavior.

**4. Do not share, commit and/or publish the `client_secret`**

Make them environment variables. Never commit or push them to your repository.

If you do, then revoke them via the "client application" administration interface.

**5. Verify webhook-events signatures**

Make sure your webhook endpoint that receives events [verifies their signature](https://developers.luccasoftware.com/documentation/webhooks/catching/validate.md).

***

## Revoking Access

If a `client_secret` or an `access_token` is ever compromised, you should revoke it immediately.

**1. Revoke the client secret**

Go to the "client application" administration interface in your Lucca account and regenerate the secret for the relevant client application. The old secret becomes immediately invalid.

**2. Rotate your credentials**

Update the new `client_secret` in your integration and re-generate any access tokens derived from the old secret.

**3. Audit recent activity**

Review your [webhook delivery logs](https://developers.luccasoftware.com/documentation/webhooks/troubleshooting.md) and API usage for signs of unauthorized access.

**4. Report a security vulnerability**

If you suspect a security breach, please report it via our [support platform](https://support.lucca.fr/) or email [security@luccasoftware.com](mailto:security@luccasoftware.com).


## Related topics

- [Get Started With Employee Attributes](https://developers.luccasoftware.com/api-reference/latest/employee-attributes/get-started.md)
- [API Guidelines](https://developers.luccasoftware.com/documentation/guidelines.md)
- [Support](https://developers.luccasoftware.com/documentation/support.md)
- [Get Started](https://developers.luccasoftware.com/documentation/webhooks/catching/get-started.md)
- [Get Started With Employees](https://developers.luccasoftware.com/api-reference/latest/employees/get-started.md)
