---
schema_version: "1"
id: 43f90df30baa05e5788065a381b27f9ed0e2a34df859bb6e129b726fabb0161a
title: agent deactivate
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforcedx/sfclireference/guides/agent/cli_reference_agent_deactivate.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_agent_deactivate.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 9d0e8617ef734ea3c2b9f1cf46dd7aaf51d5404deccc2c167a52812f5442f350
products:
  - Salesforce CLI Command Reference
  - salesforcedx
---
<!-- prettier-ignore-start -->

# 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 |
|------------------|-------------------|-------------|
| <code>&#8209;&#8209;api&#8209;name</code> | <code>&#8209;n</code> | **Type:** Value<br><br>API name of the agent to deactivate; if not specified, the command provides a list that you choose from. |
| <code>&#8209;&#8209;api&#8209;version</code> | N/A | **Type:** Value<br><br>Override the api version used for api requests made by this command |
| <code>&#8209;&#8209;flags&#8209;dir</code> | N/A | **Type:** Value<br><br>Import flag values from a directory. |
| <code>&#8209;&#8209;json</code> | N/A | **Type:** Boolean<br><br>Format output as json. |
| <code>&#8209;&#8209;target&#8209;org</code> | <code>&#8209;o</code> | **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
```
<!-- prettier-ignore-end -->
