# agent deactivate

Deactivate an agent in an org.

## Description for agent deactivate

Deactivating an agent makes it unavailable to your users. To make changes to an agent, such as adding or removing topics or actions, you must deactivate it. You can't preview an agent with the "agent preview" CLI command or VS Code if it's deactivated.

If you run the command without the --api-name flag, the command provides a list of agent API names for you to choose from. Use the flag to specify the exact agent without being prompted.

## Flags

| Flag Name (Long) | Flag Name (Short) | Description                                                                                                                                         |
| ---------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--api-name`     | `-n`              | **Type:** Value<br><br>API name of the agent to deactivate; if not specified, the command provides a list that you choose from.                     |
| `--api-version`  | N/A               | **Type:** Value<br><br>Override the api version used for api requests made by this command                                                          |
| `--flags-dir`    | N/A               | **Type:** Value<br><br>Import flag values from a directory.                                                                                         |
| `--json`         | N/A               | **Type:** Boolean<br><br>Format output as json.                                                                                                     |
| `--target-org`   | `-o`              | **Type:** Value<br>**Required**<br><br>Username or alias of the target org. Not required if the `target-org` configuration variable is already set. |

## Examples for agent deactivate

Deactivate an agent in your default target org by being prompted:

```shell
sf agent deactivate
```

Deactivate the agent Resort_Manager in the org with alias "my_org":

```shell
sf agent deactivate --api-name Resort_Manager --target-org my-org
```
