Skip to content

Delay an HTTP request

Use delay for one future delivery relative to submission, or deliver_at for a particular instant. Use a recurring schedule for repeated work.

Use a project API key from the quickstart. This example sends to Stormedo’s test destination:

Bash
curl --request POST \
'https://api.stormedo.com/send?url=https://api.stormedo.com/ping&delay=5m&retry=3' \
--header "Authorization: Bearer $STORMEDO_TOKEN" \
--header 'Idempotency-Key: delayed-ping-001' \
--header 'Content-Type: application/json' \
--data '{"message":"Five minutes later"}'

The 202 response has status: "scheduled" and an absolute scheduled_at. Record its data.id. Reuse this key only when recovering this same submission; use a new logical key for a different test.

Generate a future time instead of copying a timestamp that will expire. JavaScript uses a Date:

TypeScript
const request = await stormedo.send("https://api.stormedo.com/ping", {
body: { message: "At a chosen time" },
deliverAt: new Date(Date.now() + 10 * 60 * 1000),
maxAttempts: 4,
idempotencyKey: "timed-ping-001",
});

Python uses a timezone-aware datetime:

Python
from datetime import datetime, timedelta, timezone
request = stormedo.send(
"https://api.stormedo.com/ping",
body={"message": "At a chosen time"},
deliver_at=datetime.now(timezone.utc) + timedelta(minutes=10),
max_attempts=4,
idempotency_key="timed-ping-001",
)

These SDK snippets use a stormedo client initialized in the JavaScript or Python guide. Direct HTTP uses the snake-case deliver_at field with an RFC 3339 string. Use the JSON advanced endpoint to avoid query-string escaping.

  • Specify only one of delay and deliver_at.
  • Relative delays are whole seconds from one second through 30 days.
  • Absolute times must be within 30 days before or after the server’s current time. An allowed past timestamp runs immediately.
  • A scheduled time is when delivery becomes eligible to run, not a guarantee of exact destination arrival time.
  • The timeout applies separately to each outbound attempt. It does not include the scheduled wait.

Open the request in the dashboard, or call GET /requests/{request_id} with the same project key. Expect scheduled, then delivering, then a final outcome. On an initial 404, wait briefly and retry the read a bounded number of times.

To stop it, call POST /requests/{request_id}/cancel. A 202 means the cancellation signal was accepted. Inspect until the state becomes cancelled; an attempt already in flight can still complete. See Cancel and replay.