---
title: "Close expired giveaways (admin/cron)"
method: POST
path: "/v1/admin/close_expired_giveaways"
tags: ["maintenance"]
---

# Close expired giveaways (admin/cron)

`POST /v1/admin/close_expired_giveaways`

Admin/cron endpoint to transition giveaways from active -> ended when end_at has passed. Does not draw winners or modify entries; it only updates status. Safe to run repeatedly (idempotent for already-ended giveaways). Returns the number of giveaways closed plus their IDs.

## Headers

- `X-MAINTENANCE-KEY` string, nullable

## Response `200`

Closed giveaways count + IDs

- CloseExpiredGiveawaysResponse — Response for closing expired giveaways.
  - `closed` integer, required — Number of giveaways that were closed
  - `giveaway_ids` string[], required — IDs of the closed giveaways

## Other responses

- `403` — Invalid maintenance key
- `422` — Validation Error

---

[API](https://skmtc.net/grove/apis/grove-api.md) · [All operations](https://skmtc.net/grove/apis/grove-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/grove/grove-api/versions/f286b48a8105/schema)
