# Manage environments & users

## Enable/Disable panic mode

*Enable/Disable panic mode of the environment.*

> 👍 Required scope : **environment.panic**

```curl
curl --location --request PATCH 'https://api.flagship.io/v1/accounts/{ACCOUNT_ID}/account_environments/{ACCOUNT_ENVIRONMENT_ID}/panic' \
--header 'Authorization: Bearer {ACCESS_TOKEN}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "panic": "on"
}'
```

> 📘 The different modes are **on** , **off**.

## View environment users

*List all the users granted to the environment.*

> 👍 Required scope : **environment.user.list**

```curl
curl --location --request GET 'https://api.flagship.io/v1/accounts/(ACCOUNT_ID}/account_environments/{ACCOUNT_ENVIRONMENT_ID}/users' \
--header 'Authorization: Bearer {ACCESS_TOKEN}' \
--data-raw ''
```

## Add/Edit user rights

*Add or update users of the environment. You can add or edit multiple users in a row.*

> 👍 Required scope : **environment.user.put**

```curl
curl --location --request PUT 'https://api.flagship.io/v1/accounts/{ACCOUNT_ID}/account_environments/{ACCOUNT_ENVIRONMENT_ID}/users' \
--header 'Authorization: Bearer {ACCESS_TOKEN}' \
--header 'Content-Type: application/json' \
--data-raw '[
    {
        "email": "example@flagship.io",
        "role": "ACCOUNT_ADMIN"
    },
    {
        "email": "example2@flagship.io",
        "role": "CREATOR"
    }
]'
```

## Delete users

*Delete users of the environment. You can delete multiple users in a row.*

> 👍 Required scope : **environment.user.delete**

```curl
curl --location -g --request DELETE 'https://api.flagship.io/v1/accounts/{ACCOUNT_ID}/account_environments/{ACCOUNT_ENVIRONMENT_ID}/users?emails[]=example@flagship.io&emails[]=example2@flagship.io' \
--header 'Authorization: Bearer {ACCESS_TOKEN}' \
--data-raw ''
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.abtasty.com/server-side/integrations/flagship-remote-control-api/manage-environments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
