Skip to main content

What is ctx.jelou?

ctx.jelou is the built-in messaging client. It lets you send WhatsApp messages directly from your function. Available automatically when the company has Jelou API credentials configured.

Check availability

Send messages

ctx.jelou.send(options)

Returns { messageId: string }.
Other supported types: video, audio, file, sticker, contacts, quick_reply, cta_url, flow.

Send HSM templates

ctx.jelou.sendTemplate(options)

Returns Array<{ id, destination }>.

Validate templates before sending

A sendTemplate fails silently for three reasons: the name is misspelled, the language is not approved, or you pass more or fewer params than the template expects. ctx.templateRegistry gives you the channel’s approved-template catalog so you can catch that before calling Meta.

Methods

has() and hasAnywhere() are boolean checks: if no channel is bound or the catalog does not respond, they log a warning and return false instead of throwing. When you need a definitive answer use get(), list() or validate(), which throw TemplateRegistryError with a code: unknown_template, language_not_approved, param_count_mismatch, template_paused, registry_unavailable or no_bot_context.
sendTemplate does not validate on its own — the catalog is read-only. Call validate() explicitly when you want the check.

In cron and deferred runs

On a cron or deferred run fire there is no channel resolved, so has() would always return false. Carry the botId in your own payload and bind the catalog explicitly:
for(botId) is safe on any path: on a normal request it simply re-binds to the given channel.
Results are cached for 90 seconds. A template approved moments ago may not appear until the cache expires.

Channel override

All messages default to ctx.bot.id. Override with botId:

Error handling

Testing