• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
std

std

delay

Public
Like
delay
Home
Code
6
README.md
client.ts
index.html
H
main.ts
schema.ts
C
worker.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
main.ts
https://std--38d01a08e80e11f0a3c242dde27851f2.web.val.run
README.md

delay.val.run

Schedule HTTP requests to be executed in the future.

⚠️ Experimental Service: This is a free, experimental service provided as-is with no guarantees. Use with caution.

Quick Start

Using the TypeScript Client

import { delay } from "https://esm.town/v/std/delay/client.ts"; // Delay by 5 minutes await delay.schedule({ url: "https://myapp.com/webhook", delaySeconds: 300, }); // Or schedule for a specific time await delay.schedule({ url: "https://myapp.com/webhook", method: "POST", headers: { "Authorization": "Bearer token" }, body: { orderId: 123 }, executeAt: "2024-12-25T10:00:00Z", });

Using fetch

await fetch("https://delay.val.run", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://myapp.com/webhook", delaySeconds: 300, }), });

Using cURL

curl -X POST https://delay.val.run \ -H "Content-Type: application/json" \ -d '{"url": "https://myapp.com/webhook", "delaySeconds": 300}'

API Reference

POST https://delay.val.run

Schedule a delayed HTTP request.

Request Body

FieldTypeRequiredDescription
urlstringYesTarget URL to send the request to
methodstringNoHTTP method (default: "POST")
headersobjectNoHeaders to include in the request
bodyanyNoRequest body (JSON or string)
delaySecondsnumber*Seconds to delay before executing
executeAtstring*ISO 8601 timestamp to execute at

* Either delaySeconds or executeAt is required (not both)

Response

{ "id": "550e8400-e29b-41d4-a716-446655440000", "scheduledFor": "2024-01-15T10:05:00.000Z", "status": "scheduled" }

Client Library

The TypeScript client provides a convenient wrapper around the API.

Installation

import { delay } from "https://esm.town/v/std/delay/client.ts";

Methods

delay.schedule(options)

Schedule a request with full configuration options.

const result = await delay.schedule({ url: "https://api.example.com/webhook", method: "POST", headers: { "X-Custom-Header": "value" }, body: { data: "payload" }, delaySeconds: 60, });

delay.delayBy(url, seconds, options?)

Convenience method to schedule by delay duration.

await delay.delayBy("https://api.example.com/webhook", 300); // With additional options await delay.delayBy("https://api.example.com/webhook", 300, { method: "PUT", body: { updated: true }, });

delay.delayUntil(url, time, options?)

Convenience method to schedule for a specific time.

await delay.delayUntil("https://api.example.com/webhook", new Date("2024-12-25T10:00:00Z")); // Or with an ISO string await delay.delayUntil("https://api.example.com/webhook", "2024-12-25T10:00:00Z");

Limitations

  • ~1 minute precision: Requests are processed every minute
  • No retries: Failed requests are not automatically retried
  • No cancellation: Scheduled requests cannot be cancelled
  • No authentication: This is an open service
  • Experimental: Service may change without notice

Use Cases

  • Delayed webhooks: Send notifications after a cooldown period
  • Reminder systems: Trigger follow-up actions at specific times
  • Retry logic: Schedule retry attempts after failures
  • Scheduled tasks: Execute API calls at future dates

License

MIT

Code
README.mdclient.tsindex.html
H
main.ts
schema.ts
C
worker.ts
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.