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

Cron and interval job schedules, registered from code with `POST /sdk/schedules` (`JoobQ.register_schedule/4`).

A schedule is idempotent by its name: registering the same name again updates it in place. It fires on the server,
which enqueues the job onto its queue at every tick; a worker of that queue runs it. Editing, pausing and deleting
schedules are console operations, not the SDK's.

Options:

  * `:cron` (a 5- or 6-field expression) or `:every` (`"<count> <unit>"`, e.g. `"30 seconds"`): exactly one.
  * `:timezone`: the cron's time zone, `"UTC"` by default.
  * `:payload`: the job's payload, `%{}` by default.
  * `:max_retries`: 0 to 100, 3 by default.
  * `:encrypt_fields`, `:unique_key`: as for `JoobQ.enqueue/4` (`JoobQ.Job`).

# `body`

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

The body of `POST /sdk/schedules`; raises `ArgumentError` naming a wrong option, never its value.

---

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