Skip to main content

Recurring email schedules

A schedule sends the same email on a cron cadence — a daily digest, a weekly report — to a fixed recipient list. FilesHub evaluates every active schedule each minute and sends one email per recipient when it is due.

Create a schedule

POST /api/v1/email-schedules

Permission: write · Content-Type: application/json

FieldRequiredTypeDescription
nameYesstring (≤255)Label for the schedule.
recipientsYesarray (1–50)Each { email, name? }. One email per recipient per run.
cron_expressionYesstringStandard 5-field cron (0 9 * * 1 = Mondays 09:00) or a preset: @hourly, @daily, @weekly, @monthly.
timezoneNostringIANA timezone the cron is evaluated in (e.g. Asia/Karachi).
templateOne of template/rawstringA template slug (wins over raw content).
variablesNoobjectValues for the template placeholders.
subjectOne of template/rawstring (≤500)Raw subject (required without a template).
body_htmlOne of template/rawstringRaw HTML body.
body_textOne of template/rawstringRaw text body.
cc / bccNoarray (≤10)Extra recipients per run.
reply_toNoemailReply-to.
from_nameNostringFrom display name.
domainNostringVerified sending domain (see Send an email).
descriptionNostring (≤2000)Internal note.
is_activeNobooleanDefaults to active.
curl -X POST https://fileshub.zaions.com/api/v1/email-schedules \
-H "X-API-Key: fh_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Weekly digest",
"recipients": [{ "email": "team@example.com", "name": "Team" }],
"cron_expression": "@weekly",
"timezone": "Asia/Karachi",
"template": "weekly-digest",
"variables": { "week": "28" }
}'

Manage schedules

MethodPathPermissionPurpose
GET/email-schedulesreadList schedules (paginated).
GET/email-schedules/{id}readShow one schedule.
PATCH/email-schedules/{id}writeUpdate any field. {"is_active": false} pauses; true resumes.
DELETE/email-schedules/{id}writeDelete the schedule.
POST/email-schedules/{id}/runwriteRun now — send this run immediately, off-cadence.

{id} is the schedule's ULID public_id.

Pause a schedule
curl -X PATCH https://fileshub.zaions.com/api/v1/email-schedules/01JSCHEDXXXXXXXXXXXXXXXXXX \
-H "X-API-Key: fh_live_xxx" -H "Content-Type: application/json" \
-d '{ "is_active": false }'

Notes

  • Runs need the server scheduler. FilesHub's minute cron drives due schedules; a self-hosted deployment must have Laravel's scheduler wired.
  • ≤50 recipients per run. Each gets a separate email. For larger lists, split into multiple schedules or use your own batching over Send an email.
  • Template or raw, not both. If template is set it wins; otherwise subject + a body are required.
  • Every run is queued and shows up in Job status and the email log.