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

# Rate limits

> Limites de requisições por API key.

Cada API key tem um limite de **requisições por minuto** (padrão **120**), contado em janelas fixas de 60 segundos e compartilhado entre todas as instâncias da API.

Toda resposta inclui:

| Header | Descrição |
| - | - |
| `X-RateLimit-Limit` | Limite da key por minuto |
| `X-RateLimit-Remaining` | Requisições restantes na janela atual |
| `X-RateLimit-Reset` | Início da próxima janela (Unix timestamp, segundos) |

Ao exceder o limite, a API responde `429 Too Many Requests` com o header `Retry-After` (segundos):

```json theme={null}
{
  "statusCode": 429,
  "message": "Limite de 120 requisições/min excedido. Tente novamente em 18s."
}
```

## Lidando com 429

```javascript theme={null}
async function wisedesk(path, init = {}, attempt = 0) {
  const res = await fetch(`https://wisedesk-api.wiseapp360.com/api/v1${path}`, {
    ...init,
    headers: { "X-API-Key": process.env.WISEDESK_API_KEY, "Content-Type": "application/json", ...init.headers },
  });
  if (res.status === 429 && attempt < 3) {
    const wait = Number(res.headers.get("Retry-After") ?? 1);
    await new Promise((r) => setTimeout(r, wait * 1000));
    return wisedesk(path, init, attempt + 1);
  }
  if (!res.ok) throw new Error(`${res.status}: ${(await res.json()).message}`);
  return res.json();
}
```

Precisa de um limite maior? Fale com o suporte — o limite é configurável por key (até 1.000 req/min).


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