---
title: "Stop stale environments"
method: POST
path: "/api/v4/projects/{id}/environments/stop_stale"
tags: ["environments"]
---

# Stop stale environments

`POST /api/v4/projects/{id}/environments/stop_stale`

## Request

- Base URL: `https://gitlab.com`
- URL: `https://gitlab.com/api/v4/projects/{id}/environments/stop_stale`
- Auth: none declared

Stops all environments that were last modified or deployed to before a specified date. Excludes protected environments.

## Path parameters

- `id` string, required

## Request body

- PostApiV4ProjectsIdEnvironmentsStopStale: Stop stale environments
  - `before` string, date-time, required: Stop all environments that were last modified or deployed to before this date.

## Response `201`

Stop stale environments

## Other responses

- `400`: Bad request
- `401`: Unauthorized

---

[API](https://skmtc.dev/gitlab/apis/gitlab-api.md) - [All operations](https://skmtc.dev/gitlab/apis/gitlab-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gitlab/apis/gitlab-api/revisions/b234947ef3f2?raw)
