Skip to content

Schedule a launch and a takedown ​

Campaign pages, seminar sign-ups and limited-time offers usually need to go live at a set time and come down afterwards. Nobody should have to be awake at midnight to do either. Edge can run both for you: you schedule a promote for the launch and a takedown for the end.

This page assumes the distribution has already been live once. If it has not, start with Publish your first site. Throughout, the distribution is acme-spring-sale (d3f7a1c4-90b2-4e6a-8f15-6c2b7e0a9d38).

Where you can do this ​

Scheduling is not available in the web console. Use an agent, the CLI or the API.

The console still shows the result: on the Deployments page (https://app.edge.deca-dev.com/edge/{workspaceId}/deployments) you can see which deployment went live.

How scheduling behaves ​

  • Timing. Edge runs a schedule within about a minute of its time. Visitors then see the change within a few seconds.
  • Time zones. Give each time with its offset, for example 2026-11-01T00:00:00+09:00 for midnight in Tokyo. A time without an offset is rejected rather than guessed. The CLI can read a plain local time for you.
  • Allowed times. A schedule must be at least 60 seconds ahead and at most 366 days ahead. A distribution can have up to 20 pending schedules, at most one per minute.
  • Changing a schedule. You cannot edit one. Cancel it and schedule again.
  • Late schedules. If Edge reaches a schedule more than 24 hours late, it does not run it. The schedule is marked failed with a reason that starts missed. A launch that slipped by a day almost always needs a person to decide.

Schedule the launch ​

Publish the campaign as a deployment, check its preview, then schedule the promote. The deployment may still be building when you schedule it, but it must be ready by the time the schedule runs. If it is not, nothing goes live and the schedule is marked failed.

text
Schedule deployment 01M4T3KQ8Z6P2W9XRC1VJ5NB7D on acme-spring-sale to go live
at midnight Tokyo time on 1 November 2026.
bash
edge deployments promote 01M4T3KQ8Z6P2W9XRC1VJ5NB7D --at "2026-11-01 00:00" --tz Asia/Tokyo
bash
curl -s -X POST \
  https://api.edge.deca-dev.com/v1/deployments/01M4T3KQ8Z6P2W9XRC1VJ5NB7D/promote \
  -H "Authorization: Bearer $EDGE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "at": "2026-11-01T00:00:00+09:00" }'

The agent runs edge_deployment_promote with at. The response describes the schedule, not a promote. Nothing changes on the live site yet.

json
{
  "schedule_id": "sch_01M4T3PZ2E7Y0QW8H6KD1RJXCA",
  "action": "promote",
  "deployment_id": "01M4T3KQ8Z6P2W9XRC1VJ5NB7D",
  "run_at": "2026-10-31T15:00:00+00:00",
  "status": "scheduled",
  "pending_schedules": [ … ]
}

run_at is always returned in UTC. 2026-10-31T15:00:00+00:00 is midnight on 1 November in Tokyo.

Schedule the takedown ​

When the campaign ends, the takedown answers visitors in one of two ways:

ModeVisitors getUse it when
redirecta temporary redirect (302) to the URL you givethere is somewhere useful to send people, such as the main site
gone410 Gonethe page should simply stop existing

A redirect target must be on this distribution, on a verified custom domain in the workspace, or on a host listed in the distribution's redirect_hosts. This stops a takedown from becoming a redirect to a site you do not control.

text
When the sale ends at 23:59 Tokyo time on 30 November 2026, take acme-spring-sale
down and send visitors to https://www.acme.example/.
bash
edge distributions takedown acme-spring-sale --redirect https://www.acme.example/ \
  --at "2026-11-30 23:59" --tz Asia/Tokyo
bash
curl -s -X POST \
  https://api.edge.deca-dev.com/v1/distributions/d3f7a1c4-90b2-4e6a-8f15-6c2b7e0a9d38/takedown \
  -H "Authorization: Bearer $EDGE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "mode": "redirect", "location": "https://www.acme.example/", "at": "2026-11-30T23:59:00+09:00" }'

The agent runs edge_distribution_takedown. Leave out at (or --at) to take the site down now.

What a takedown does and does not do:

  • Nothing is deleted. The deployments, files and settings stay as they are.
  • Previews keep working, so you can prepare the next campaign while the site is down.
  • Promoting does not bring the site back. You can promote new content behind a takedown, and visitors still get the 410 or redirect until you restore.

Bring the site back ​

Restore lifts the takedown, now or at a set time.

text
Bring acme-spring-sale back online.
bash
edge distributions restore acme-spring-sale
bash
curl -s -X POST \
  https://api.edge.deca-dev.com/v1/distributions/d3f7a1c4-90b2-4e6a-8f15-6c2b7e0a9d38/restore \
  -H "Authorization: Bearer $EDGE_TOKEN"

The agent runs edge_distribution_restore. Live hosts serve the live deployment again within a few seconds. Restoring a site that is not taken down changes nothing and returns "changed": false.

See and cancel what is scheduled ​

text
What is scheduled on acme-spring-sale? Cancel the takedown.
bash
edge schedules ls acme-spring-sale
edge schedules cancel sch_01M4T3QH5V1D8N3B6K0W2YFZTR
bash
curl -s https://api.edge.deca-dev.com/v1/distributions/d3f7a1c4-90b2-4e6a-8f15-6c2b7e0a9d38/schedules \
  -H "Authorization: Bearer $EDGE_TOKEN"

curl -s -X DELETE https://api.edge.deca-dev.com/v1/schedules/sch_01M4T3QH5V1D8N3B6K0W2YFZTR \
  -H "Authorization: Bearer $EDGE_TOKEN"

The agent runs edge_deployment_schedule_list and edge_deployment_schedule_cancel. The list shows pending schedules by default. Pass status=all (CLI --status all) to also see schedules that ran, failed or were cancelled. Only a schedule that has not started can be cancelled.

A manual promote does not cancel a scheduled one. If you promote a hotfix at 22:00 and a promote is scheduled for midnight, the scheduled deployment still goes live at midnight. Every promote response lists pending_schedules so you can see this coming. Cancel the schedule if it is no longer wanted.

Get told when it happens ​

Each step emits an Edge event: deployment.scheduled, then deployment.promoted (with schedule_id), distribution.taken_down and distribution.restored. A schedule that could not run emits deployment.schedule_failed with the reason. To get a message in Slack or your monitoring tool, see Send Edge events to a webhook.

Next ​