# `JoobQ.RateLimits`
[🔗](https://github.com/azutoolkit/joobqui/tree/master/sdks/elixir/blob/main/lib/joobq/rate_limits.ex#L2)

Sliding-window rate limits kept by the gateway (JoobQ Pro): `JoobQ.rate_limit/4` reserves a slot with
`POST /sdk/rate-limit`, checking and consuming it in one step. It answers `{:ok, %{"allowed" => true, ...}}` when a
slot was granted, or `"allowed" => false` with `"retry_after_ms"`, the milliseconds until one frees up. It paces
your own code (an enqueue, a call to a partner); it does not enqueue or wait. Without a Pro licence the gateway
answers `402`: `{:error, %JoobQ.Error{reason: :pro_required}}`.

# `body`

```elixir
@spec body(String.t(), pos_integer(), pos_integer()) :: map()
```

The body of `POST /sdk/rate-limit`; raises `ArgumentError` naming a wrong argument, never its value.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
