Compile a natural language schedule to a cron expression
const url = 'http://localhost:11044/api/v1/cron/compile-schedule';const options = { method: 'POST', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>', 'Content-Type': 'application/json'}, body: '{"schedule":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:11044/api/v1/cron/compile-schedule \ --header 'Content-Type: application/json' \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \ --data '{ "schedule": "example" }'Converts a schedule description like ‘every day at 7am’ to a Spring 6-field cron expression using an LLM. The JSON body requires a schedule key. A description the LLM cannot interpret returns 200 with an error key instead of a cron key.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”The schedule in words under schedule, e.g. every day at 7am; a missing one is a 400. Nothing is saved or scheduled: the answer is a cron expression, checked to parse before it is returned, to pass on to POST /cron or POST /cron/compile
A schedule described in natural language
object
The schedule in words, e.g. ‘every day at 7am’
Example generated
{ "schedule": "example"}Responses
Section titled “Responses”A cron key on success, or an error key when the description is not a schedule
object
Missing schedule
A refusal carrying only a human-readable reason.
object
What went wrong, in the terms the caller can act on.
LLM call failed
A refusal carrying only a human-readable reason.
object
What went wrong, in the terms the caller can act on.

