Tutorials

Schedule API Calls Without a Server

8 min read

To schedule API calls without a server, hand the request to a hosted scheduler that sends it for you, on a cron schedule or once at a set time. This tutorial does it with Delay, in the dashboard first and then with one API call. Delay keeps the URL, method, headers and body, sends the request on time, saves every response and emails you when a call fails.

The example is a Slack reminder every weekday at 09:00, but the steps are the same for any API: a sync endpoint, a report, a GitHub Actions workflow or a serverless function.

What you need

  • The API call: its URL, method, any headers (such as an API key) and the body.
  • A public URL. Delay calls it from the internet, so localhost and private addresses such as 192.168.x won't work.
  • A Delay account. The free plan includes 1,000 requests a month, enough for a call every hour.

Delay has two kinds of scheduled request:

Call the API Use Example
Again and again A cron Every weekday at 09:00
Once, later A job March 1 at 09:00

Step 1: Describe the request

Sign up at delay.run, open Cron jobs and click New cron job. Then fill in the request:

  • Cron job name: anything that tells you what it does, such as Standup reminder.
  • HTTP method and URL: POST and your Slack webhook URL. Slack creates one per channel under Incoming Webhooks in your Slack app's settings.
  • Request Payload (JSON): the body, here {"text": "Standup in 15 minutes"}. Delay sends it as JSON.
The new cron job form with the name Standup reminder, method POST, a Slack webhook URL and a JSON payload

If the API needs a key, click Add Header and enter its name and value, for example Authorization and Bearer your-api-key. A Slack webhook URL has its secret built in, so it needs none.

Step 2: Set the schedule

Type the cron expression into Full expression, or pick one from Quick presets.... 0 9 * * 1-5 means minute 0, hour 9, Monday to Friday. The box below it reads the schedule back in words and lists the next three runs, so you can check it before saving.

Then set Timezone, here New York. Delay keeps the call at 09:00 New York time when the clocks change, so daylight saving needs no edits.

The cron expression 0 9 * * 1-5 described as Every weekday at 09:00 (America/New_York), with the next three runs and the New York timezone selected

Not sure how to write the expression? The cron expression generator builds one from plain choices.

Step 3: Turn on alerts and save

Set Failure alerting to After 1 consecutive failure. With no server, nobody watches a log file, so this is how you hear that a call broke, and a recovery alert follows when it works again. Alerts are emailed to your team. Higher plans can post them to Slack or Discord instead.

Failure alerting set to After 1 consecutive failure, Enable this cron job ticked, and the Create cron job button

Click Create cron job. The first call goes out at the next matching time, not when you save.

Step 4: Test it with Run now

Open the cron from the list and click Run now. Delay sends the request straight away without changing the schedule, and a few seconds later the cron's page shows how it went:

The Standup reminder cron page with Pause, Run now, Edit and Delete buttons, and Last run: Succeeded

To see exactly what happened, click View all under Recent runs and open the run. It shows the body Delay sent and the API's answer, here Slack's 200 and ok:

The run history with a succeeded run, the request body sent to Slack and the response body ok

Any 2xx status counts as a success. If the run failed, the page says why, and the table under When a run fails lists the usual fixes.

Call an API once at a set time

For a single call, such as a launch announcement at 09:00 on March 1, create a job instead. A job takes an exact date and time, which is easiest with the API. Create a token under Settings > API tokens with Full access, then send:

curl -X POST https://app.delay.run/api/v1/jobs \
  -H "Authorization: Bearer $DELAY_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: launch-announcement" \
  -d '{
    "url": "https://discord.com/api/webhooks/1234/abcd",
    "method": "POST",
    "payload": {"content": "We are live!"},
    "run_at": "2027-03-01T09:00:00-05:00"
  }'
  • run_at is the date and time with its offset from UTC, up to 365 days ahead. New York is -05:00 in winter and -04:00 in summer. To count from now instead, send "delay": 3600 (seconds).
  • Idempotency-Key means that sending the same request twice still creates one job.
  • If the call fails, Delay retries it after 1 minute, 30 minutes and 3 hours. A cron doesn't retry: it waits for its next time.

In the dashboard, Jobs > Create job schedules the same kind of call with a delay in seconds.

Create the cron with the API

The cron from steps 1 to 4 is one request:

curl -X POST https://app.delay.run/api/v1/crons \
  -H "Authorization: Bearer $DELAY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Standup reminder",
    "url": "https://hooks.slack.com/services/T000/B000/XXXX",
    "method": "POST",
    "payload": {"text": "Standup in 15 minutes"},
    "cron_expression": "0 9 * * 1-5",
    "timezone": "America/New_York",
    "alert_after_failures": 1
  }'

The answer is the new cron with its schedule in words and its next runs. Add "dry_run": true to check them without saving. If you already have a working curl command for the API, paste it into the curl converter and pick On a schedule: it writes this request for you.

Example: trigger a GitHub Actions workflow on time

GitHub's own schedule trigger can start late when Actions is busy, especially at the top of the hour, and runs can be dropped. To start a workflow on the minute, have Delay call GitHub's API:

  1. Add workflow_dispatch to the workflow's triggers:
on:
  workflow_dispatch:
  1. Create a fine-grained personal access token for that one repository, with the Actions permission set to Read and write.
  2. Create the cron, with your owner, repository and workflow file name in the URL:
curl -X POST https://app.delay.run/api/v1/crons \
  -H "Authorization: Bearer $DELAY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Nightly report workflow",
    "url": "https://api.github.com/repos/OWNER/REPO/actions/workflows/report.yml/dispatches",
    "method": "POST",
    "headers": {
      "Authorization": "Bearer github_pat_your_token",
      "Accept": "application/vnd.github+json",
      "X-GitHub-Api-Version": "2026-03-10"
    },
    "payload": {"ref": "main"},
    "cron_expression": "0 6 * * *",
    "timezone": "Europe/London",
    "alert_after_failures": 1
  }'

ref is the branch to run. A 404 usually means a wrong file name, no workflow_dispatch trigger on that branch, or a token that can't see the repository.

Example: run your own serverless function on a schedule

On Vercel's Hobby plan, a cron job runs at most once a day, at some point within the hour you set. To run a function more often or on time, let Delay call it, and check a secret header so nobody else can. A Next.js route handler:

// app/api/sync/route.ts
export async function POST(request: Request) {
    const secret = process.env.CRON_SECRET;

    if (!secret || request.headers.get('authorization') !== `Bearer ${secret}`) {
        return new Response('Unauthorized', { status: 401 });
    }

    // Do the work here: fetch from an API, update your database, send emails.

    return Response.json({ synced: true });
}

Set CRON_SECRET to a long random string in the project's environment variables and deploy. Then create a cron with the function's URL, method POST, the expression 0 * * * * (every hour) and a header named Authorization with the value Bearer followed by your secret. The same works for Netlify Functions, Cloudflare Workers or any app with a public URL.

What fits in the free plan

Every call counts as one request, including Run now, failed calls and retries. The free plan includes 1,000 a month:

Schedule Calls a month Free plan
Every 10 minutes 4,464 No
Every 30 minutes 1,488 No
Every hour 744 Yes
Every weekday at 09:00 23 at most Yes

Paid plans start at $19 a month for 20,000 requests, enough for a call every 5 minutes.

When a run fails

The run shows Likely cause Fix
301 or 302 The URL redirects Use the final URL, often with https or www
401 or 403 The key is missing, wrong or limited Check the header's name and value
404 or 405 Wrong URL or method Check both against the API's docs
400 or 422 The API doesn't accept the body Check the payload against the API's docs
Timeout The API took too long Raise Request timeout, up to 300 seconds
Blocked IP address The URL points to a private address Use a public URL

Other ways to schedule API calls without a server

  • GitHub Actions schedule. Fine if your code is on GitHub and a late run doesn't matter. The shortest interval is 5 minutes, runs can be delayed or dropped at busy times, and in a public repository scheduled workflows are disabled after 60 days without activity.
  • Cloudflare Workers Cron Triggers. You write a Worker that makes the call. They run in UTC, and the Free plan allows 5 per account.
  • Vercel Cron Jobs. Vercel calls a function in your project, in UTC. On the Hobby plan that's at most once a day, within the hour.

All three run code you write and deploy. When the job is calling an API, a scheduler like Delay only needs the request.

FAQ

Can I schedule API calls for free?

Yes. Delay's free plan includes 1,000 requests a month, enough for an hourly call or a few daily ones.

What's the shortest interval?

One minute, with the expression * * * * *. That's about 44,600 calls a month, so it needs a paid plan.

Can I schedule an API call for a specific date and time?

Yes, with a job and run_at, up to 365 days ahead. For a date that repeats, such as 09:00 on the 1st of every month, use a cron with 0 9 1 * *.

Can Delay call an API on my own computer?

Not directly, because Delay only calls public addresses. Expose your machine with a tunnel such as ngrok or Cloudflare Tunnel and use the public URL it gives you.

How do I keep the API key safe?

Give the call a key that can do only this one thing, such as a GitHub token limited to one repository, so you can revoke it without breaking anything else. Delay's API responses show header values such as Authorization as [hidden].

Schedule your first cron job

Free for 1,000 requests a month. No credit card.

Read the docs