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

# Manage API keys

> Create, rotate and revoke brand keys in the dashboard

Brand keys are created and managed in the dashboard, under **Credenciais de API** in the account menu. Only **admins** of the brand can see this page.

## Create a key

| Field | What to set |
| - | - |
| **Name** | Where the key is used, for example `BI warehouse`. 2 to 64 characters. |
| **Vertical** | **Network** or **White label**. Shown only when your brand has both products. It cannot be changed later. |
| **What the key can read** | The resources the key has access to. Select only what the integration needs. Each one becomes a [scope](#scopes). |
| **Expiration** | 30 days, 90 days, 1 year or no expiration. |

After you confirm, the full key is shown **once**. Lomadee stores only a hash of it and cannot show it again. If you lose it, rotate the key.

A brand can have up to **10 active keys**.

## Scopes

A scope is the vertical of the key followed by the resource: `network:orders:read`, `whitelabel:orders:read`. All scopes of a key have the same vertical.

| In the dashboard | Gives access to | Network key | White-label key |
| - | - | - | - |
| Programa | Program settings | `network:program:read` | `whitelabel:program:read` |
| Pedidos | Orders and their commission | `network:orders:read` | `whitelabel:orders:read` |
| Campanhas | Offers and coupons | `network:campaigns:read` | `whitelabel:campaigns:read` |
| Comissões | Commission rules | `network:commissions:read` | `whitelabel:commissions:read` |
| Relatório de desempenho | Performance report | `network:reports:read` | `whitelabel:reports:read` |
| Canais de afiliado | Affiliate channels in your program | `network:channels:read` | — |
| Afiliados | Affiliates of your program and their registration data | — | `whitelabel:affiliates:read` |

> [!WARNING]
>
> `whitelabel:affiliates:read` returns personal data: name, e-mail, document, phone, address and the additional fields of your program. Grant it only to integrations that need it.

Scopes cannot be edited after creation. To change them, create a new key and revoke the old one.

## Rotate a key

**Rotate** issues a new secret for the same key and keeps its name, vertical and scopes. The old secret stops working within **1 minute**. Update your integration with the new value right after rotating.

## Revoke a key

**Revoke** disables the key permanently. Requests with a revoked key return `401` within **1 minute**. A revoked key cannot be restored.

## What the dashboard shows

| Column | Meaning |
| - | - |
| **Name** | The name of the key and, under it, what the key can read |
| **Key** | The prefix only, for example `lmd_prod_a1B2c3D4e5_••••••••` |
| **Vertical** | Network or White label |
| **Last used** | Last request made with the key (updated every 5 minutes) |
| **Expires** | Expiration date, a warning in the last 7 days, or "Sem validade" |

## Keep keys safe

* Use keys only on servers. Never ship a key in a browser, a mobile app or a public repository.
* Use one key per integration, so you can revoke one without stopping the others.
* Set an expiration and rotate before it ends.
* If a key leaks, revoke it at once and create a new one.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.