---
title: "POST /providers/Microsoft.LabServices/users/{userName}/stopEnvironment"
method: POST
path: "/providers/Microsoft.LabServices/users/{userName}/stopEnvironment"
tags: ["GlobalUsers"]
---

# POST /providers/Microsoft.LabServices/users/{userName}/stopEnvironment

`POST /providers/Microsoft.LabServices/users/{userName}/stopEnvironment`

Stops an environment by stopping all resources inside the environment This operation can take a while to complete

## Path parameters

- `userName` string, required

## Query parameters

- `api-version` string, required

## Request body

- EnvironmentOperationsPayload — Represents payload for any Environment operations like get, start, stop, connect
  - `environmentId` string, required — The resourceId of the environment

## Response `200`

OK

## Other responses

- `202` — Accepted
- `default` — BadRequest

---

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