Webhook Scheduler
Log inStart free

Quickstart for code

Schedule your first webhook from code

About five minutes. You will send one request, watch it arrive two minutes later, then schedule a real webhook days ahead and cancel it. You need a terminal with cURL, Node.js 18+ or Python 3.8+. Using Make or n8n instead? Follow the Make or n8n quickstart.

On this page
  1. Step 1: Create an account and an API key

    1. Create a free account with your email (you confirm it with a 6-digit code) or with Google.
    2. Open Dashboard → API keys. Type a name, for example Laptop test, leave Test key unchecked, and click Create key.
    3. Copy the key. It starts with wh_live_ and is shown only once. Keep it on your computer or server, never in a browser or a mobile app.
    When it worked: the page shows Copy your key now with your key, and the key is listed under Your keys.

    One key is enough

    The Free plan allows 1 active key. A test key (wh_test_) is not a sandbox: it delivers for real and counts toward your monthly quota like a live key, so you do not need one to follow this guide.

  2. Step 2: Schedule a test webhook two minutes from now

    This request asks Webhook Scheduler to call our built-in test receiver, https://webhookscheduler.com/api/demo/receiver, two minutes from now. The receiver answers HTTP 200 to every request, so nothing reaches your own systems yet.

    Pick your system, replace wh_live_YOUR_KEY with your key, and run it. The run time is computed when the command runs, so you can copy it any day.

    # macOS or Linux
    RUN_AT=$(date -u -d '+2 minutes' '+%Y-%m-%dT%H:%M:%SZ' 2>/dev/null || date -u -v+2M '+%Y-%m-%dT%H:%M:%SZ')
    
    curl -X POST https://webhookscheduler.com/api/v1/schedule \
      -H "Authorization: Bearer wh_live_YOUR_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "url": "https://webhookscheduler.com/api/demo/receiver",
        "method": "POST",
        "runAt": "'"$RUN_AT"'",
        "body": { "message": "Hello from the quickstart" }
      }'

    The API answers right away:

    Response · 201 Createdjson
    {
      "id": "5f0c9a1e-7b2d-4c8e-9a3f-1d2e3f4a5b6c",
      "status": "PENDING",
      "scheduledFor": "YYYY-MM-DDTHH:MM:SS.000Z",
      "idempotencyKey": null,
      "reference": null,
      "criticality": "STANDARD"
    }
    When it worked: you get 201 and "status": "PENDING". The id is this webhook's job ID. Your values differ from the example.

    Got something else?

    401: the key is missing or mistyped; check it starts with wh_live_ and has no space. 400 with runAt must be in the future: your computer's clock is off. Every other answer is listed in API errors.

  3. Step 3: See it Delivered

    Open Dashboard → Jobs. Your webhook is the top row: the destination is webhookscheduler.com/api/demo/receiver and the status is Scheduled. Two minutes after you ran the command, click Refresh: the status turns to Delivered.

    Click the row to open the job. The delivery timeline shows one attempt with HTTP 200 and the receiver's response body, which contains "service": "Webhook Scheduler demo receiver".

    When it worked: the job shows Delivered. That is the whole loop: schedule, wait, deliver, log.

    Prefer the terminal? GET /api/v1/jobs/JOB_ID returns the same job with "status": "SUCCESS" and its attempts. See Get a job.

  4. Step 4: Make it real: your URL, days later

    Now point the webhook at your own endpoint and schedule it for later. Your endpoint must:

    • be a public HTTPS URL on the default port, with a domain name (not an IP address or localhost). All rules are in Target URL rules;
    • accept the method you send (POST by default) with a JSON body;
    • answer with a 2xx status within 10 seconds.

    Before you schedule, you can check the URL: in the dashboard, click Schedule webhook, paste it in Destination and click Test URL now. It sends one request right away and shows the answer.

    Then schedule from your code, here three days ahead. Replace YOUR_DOMAIN with your domain (until you do, the API refuses the URL) and set WEBHOOK_SCHEDULER_API_KEY in your server's environment.

    # runAt below is tomorrow at 09:00 UTC
    curl -X POST https://webhookscheduler.com/api/v1/schedule \
      -H "Authorization: Bearer wh_live_YOUR_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "url": "https://YOUR_DOMAIN/webhooks/trial-reminder",
        "runAt": "YYYY-MM-DDT09:00:00.000Z",
        "body": { "userId": "usr_4821" },
        "reference": "trial:usr_4821",
        "idempotencyKey": "trial-reminder:usr_4821"
      }'

    Store the returned id next to the user, invoice or order it belongs to. It is how you cancel this webhook in step 5. The reference lets you find it again by your own ID, and the idempotencyKey makes the call safe to retry: sending it twice returns the same job instead of creating a second one.

    How far ahead

    Free schedules up to 7 days ahead; Pro and Scale up to 365 days. Always send runAt in UTC with a Z (or with an offset like +02:00): the code above does.

    When it worked: you get 201 with an id, and Jobs shows the webhook as Scheduled for the date you chose. When that time comes, your endpoint receives a POST with { "userId": "usr_4821" } as its JSON body.
  5. Step 5: Cancel it with the stored id

    If the user acts first (here: upgrades before the reminder), cancel the webhook with the id you stored. Replace JOB_ID with it.

    curl -X POST https://webhookscheduler.com/api/v1/jobs/JOB_ID/cancel \
      -H "Authorization: Bearer wh_live_YOUR_KEY"
    Response · 200 OKjson
    {
      "id": "5f0c9a1e-7b2d-4c8e-9a3f-1d2e3f4a5b6c",
      "status": "CANCELED",
      "url": "https://YOUR_DOMAIN/webhooks/trial-reminder",
      "scheduledFor": "YYYY-MM-DDT09:00:00.000Z"
    }
    When it worked: you get 200 with "status": "CANCELED", and Jobs shows the webhook as Canceled. It will not be sent.

    A webhook can be canceled while it is Scheduled or Retrying. Once it is being sent, delivered, failed or already canceled, the API answers 400 (Only pending or retrying jobs can be canceled). An id that is not in your workspace gets 404.

    A cancel that arrives at the very moment of delivery can lose the race, so let your endpoint check that the reminder still makes sense (is the user still on trial?) before acting. Canceled webhooks still count toward your monthly quota.

Next steps