# Data protection

Your users' financial data reaches your systems through Pluggy. What Pluggy stores for each Item,
and when it deletes it, is documented below with links to the details. What you copy into your own
systems is yours to protect.

## Keep bank credentials out of your servers

With [Pluggy Connect](/docs/connect-widget/introduction), your users type their bank credentials
in the widget, which sends them to Pluggy with the Connect Token: they never pass through your
backend. Prefer it to building your own credential form.

If you do collect credentials in your own interface and create Items through the API, encrypt the
`parameters` with your application's RSA public key, which you get from Pluggy: only Pluggy can
decrypt them. Recipe: [Encrypt parameters](/recipes/encrypt-parameters).

## The account holder gives the consent

The person who authorizes a connection is the account holder, in their own institution's
environment. A company that serves other companies cannot authorize on their behalf. See
[The consent stays with the account holder](/docs/get-started/multi-tenant-applications#the-consent-stays-with-the-account-holder).

When a consent expires, or the user revokes it, the Item's data endpoints return empty data. Only
the user can renew it, by connecting again. See
[Consents and expiration](/docs/connections/consents#consent-expiration--revocation).

## Let users disconnect

Give your users a way to disconnect an account at any time, and delete the Item when they do, with
[`DELETE /items/{id}`](/reference/items-delete) from your backend. Deleting an Item:

- wipes its stored credentials,
- revokes the Open Finance consent, where one applies, and expires OAuth authorizations,
- permanently deletes its data (accounts, transactions and the rest).

After that, the Item and its products answer `404`. See
[Consent management](/docs/integration-checklist/consent-management) and the
[Deleting your Data](/recipes/deleting-your-data) recipe.

## React when Pluggy deletes an Item

Pluggy also deletes Items on its own, for example Sandbox Items not used for 30 days, and every Item
of a connector 30 days after the connector is deprecated. Each deletion emits the `item/deleted`
webhook. Subscribe to it and remove your copy of the data when it arrives. See
[Data retention and automatic cleanup](/docs/connections/item-lifecycle#data-retention-and-automatic-cleanup).

## Store only what you use

- **Keep what your product needs**, and delete it when the user leaves or disconnects. Your API key
  can read the data again while the Item exists.
- **Use opaque identifiers.** Set `clientUserId` to an internal id, not an e-mail address or a CPF:
  it is stored on the Item and sent in webhook payloads.
- **Keep personal data out of logs and error reports.** Financial data and identity fields
  (names, CPF or CNPJ, account numbers) do not belong in a log line, an analytics event or a support
  ticket.
- **Restrict who can read it** in your own systems, the same way you restrict who can read your
  client secret.

## Data protection requests

A request from an **end user** to access, correct or erase their data goes to the product they
connected through, which owns the connection: that is you. Delete their Items to remove the data
Pluggy holds for them.

Requests about your **own** personal data as a Pluggy customer go to Pluggy's Data Protection
Officer. See [Data protection requests (LGPD)](/docs/get-started/delete-account#data-protection-requests-lgpd).

## Does not protect against

- Copies you made: deleting an Item removes Pluggy's data, not what your systems stored. That part
  is up to you.

Next: [Security overview checklist](/docs/security/overview#checklist).