# Auth0-deploy-cli error: Problem deleting actions BadRequestError Status code: 400 "message": "Invalid Argument"

**URL:** <https://community.auth0.com/t/auth0-deploy-cli-error-problem-deleting-actions-badrequesterror-status-code-400-message-invalid-argument/202727>\
**Category:** Get Help\
**Tags:** auth0-deploy-cli, extensions\
**Created:** [August 20, 2026, 7:11pm UTC](https://community.auth0.com/t/auth0-deploy-cli-error-problem-deleting-actions-badrequesterror-status-code-400-message-invalid-argument/202727 "2026-08-20T19:11:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![seb.dtrg](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/seb.dtrg/32/66102_2.png) [@seb.dtrg](https://community.auth0.com/u/seb.dtrg)\
**Post date:** [August 20, 2026, 7:11pm UTC](https://community.auth0.com/t/auth0-deploy-cli-error-problem-deleting-actions-badrequesterror-status-code-400-message-invalid-argument/202727/1 "2026-08-20T19:11:44Z")

</div>

Ive encountered an error with the auth0-deploy-cli tool: 400 Deploy error with deleting Actions even though the management API has deletion scope.

_I added the `delete:actions` scope to the Auth0 API for nb-auth0 deploy CLI which hasnt resolved this issue._

You will encounter this error when using the auth0-deploy-cli [GitHub - auth0/auth0-deploy-cli: The Auth0 Deploy CLI is a tool that helps you manage your Auth0 tenant configuration. It integrates into your development workflows as a standalone CLI or as a node module. · GitHub](https://github.com/auth0/auth0-deploy-cli) , if an action exists on the Auth0 tenant but isnt included in the configuration being deployed. The config deployment attempts to delete the action, but fails with an error. Even though our management cli has the scope to delete actions. This is an issue I’d like to bring up with Auth0 engineers working on the `auth0-deploy-cli` tool, but since I am not yet sure this issue is specific to the auth0-deploy-cli tool, I would like to share with the community.

```typescript
2026-08-14T18:01:23.264Z - error: Problem running command import during stage processChanges when processing type actions
2026-08-14T18:01:23.264Z - error: Problem deleting actions {"id":"6a37163b-c801-4017-9fe9-db353dad2940","name":"Custom Event Stream Action (2026-08-06 20:27:16)"}
BadRequestError: BadRequestError
Status code: 400
Body: {
  "statusCode": 400,
  "error": "Bad Request",
  "message": "Invalid Argument"
}

```

#### Steps to reproduce

1. Pull your current tenant configs using the directory (json) format using the auth0-deploy-cli like so

```bash
npx auth0-deploy-cli export \
  --strip \
  --format directory \
  --output_folder ./${output_folder} \
  --config_file ./${output_folder}/${from_tenant}.json \
  --debug true

```

1. Create an action bound to a trigger in the Auth0 UI, also can be reproduced with Actions belonging to an eventStream .
2. Then without exporting any of the newly created action+triggers in step 1, perform an import to tenant, in our case the command uses the directory (json) format. (At this point the newly created trigger + Action exists on the auth0 tenant but not at all on the config repo on my local machine, so it will attempt to delete).
3. See the error occur, error: Problem deleting actions

```bash
#https://github.com/auth0/auth0-deploy-cli/blob/master/docs/using-as-cli.md
npx auth0-deploy-cli import \
  --input_file ./${input_folder} \
  --config_file ./${input_folder}/${to_tenant}.json \
  --debug true \

```

#### Known workaround

The solution is to manually delete the action in the auth0 UI if possible. Then re-import to tenant and the error should be resolved.

Also note, for Actions bound to an eventStream as a trigger, it is not possible to delete these Actions code from the Auth0 UI, the eventStream must be deleted. I have recently accidentally orphaned the action belonging to an eventStream, wont go into the details how to reproduce here, but I got completely stuck with a broken deploy tool because I couldnt delete the action in the UI. Deleting an action that is orphaned from an eventStream is only possible with the latest `auth0` cli interface (Confirmed with `auth0/auth0-cli/auth0` version 1.33.0):

```bash
nb-auth0 % auth0 actions show
...
nb-dev.eu.auth0.com action

  ID c402bad2-8b11-4e9c-85cd-e33a66420b12
...
nb-auth0 % auth0 actions delete "c402bad2-8b11-4e9c-85cd-e33a66420b12"  
 Are you sure you want to proceed? Yes
Deleting action(s)... done

```

#### Background

I am working on updating our depency of `auth0-deploy-cli` for our config repo, and this issue of actions not being able to be deleted by the deploy tool has been around as long as I can remember since 2024 (as of Aug20th 2026 time of writing, we’re on `auth0-deploy-cli `v8.25, and I’m working on updating to latest 8.43.0)  
I’d like to improve our experience with the auth0-deploy-cli and make it a more robust + reliable infrastructure as code tool, with less manual workarounds such as this. If this issue is better moved to [GitHub - auth0/auth0-deploy-cli: The Auth0 Deploy CLI is a tool that helps you manage your Auth0 tenant configuration. It integrates into your development workflows as a standalone CLI or as a node module. · GitHub](https://github.com/auth0/auth0-deploy-cli), that would be cool with me as well, I wanted to get other developers attention to this.

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [August 21, 2026, 5:46pm UTC](https://community.auth0.com/t/auth0-deploy-cli-error-problem-deleting-actions-badrequesterror-status-code-400-message-invalid-argument/202727/3 "2026-08-21T17:46:26Z")

</div>

Hi @seb.dtrg

Welcome back to the Auth0 Community!

You are encountering a 400 “Invalid Argument” error when the auth0-deploy-cli attempts to delete Actions during import, even though the `delete:actions` scope has been added to the Management API credentials for the deploy CLI application.

\*\*The 400 error when deleting actions in auth0-deploy-cli is most likely caused by one of two conditions:

1. The action is bound to a trigger in the Auth0 tenant
2. The action has stale or orphaned references (particularly for actions associated with Event Streams). The `delete:actions` scope alone is not sufficient if the action is still bound to a trigger or has invalid internal state.\*\*

**[ROOT CAUSE]**  
Auth0’s action deletion logic enforces a constraint: **actions cannot be deleted if they are bound to a trigger or have unresolved dependencies**. This is by design to prevent accidental removal of active authentication flows. When auth0-deploy-cli attempts to delete an action that exists on the tenant but is not in your configuration file, it first tries to delete the action directly. If that action is bound to a trigger (even if the trigger is not in your config), the Management API returns a 400 “Invalid Argument” error instead of a more explicit “action bound to trigger” error.

Additionally, if an action is orphaned from an Event Stream (a known issue in the deploy-cli), the action enters an invalid state and cannot be deleted via the Management API, even with the correct scopes.

**[Official Workaround]**

**Step 1: Verify trigger bindings before import**

Before running the import command, check the Auth0 Dashboard to see if the action you are trying to delete is bound to any triggers:

1. **Navigate to** Auth0 Dashboard → Actions → Flows (or Triggers).
2. **Identify** any actions that exist on the tenant but are not in your configuration file.
3. **Check** if those actions are bound to any trigger flows.

**Step 2: Remove trigger bindings manually (if possible)**

If the action is bound to a trigger:

1. **Navigate to** Auth0 Dashboard → Actions → [Trigger Name] (e.g., Post-Login).
2. **Remove** the action from the flow by clicking the action and selecting Delete or Remove.
3. **Save** the flow.

After the trigger binding is removed, the action can be deleted.

**Step 3: Use the newer auth0 CLI for orphaned actions**

If the action is orphaned from an Event Stream or cannot be deleted via the Dashboard, use the official `auth0` CLI (version 1.33.0 or later) to delete it:

```auto
auth0 actions show
# Find the action ID you need to delete

auth0 actions delete "<ACTION_ID>"
# Confirm the deletion when prompted

```

**Step 4: Re-run the deploy-cli import**

After manually removing the action, re-run your import command:

```auto
npx auth0-deploy-cli import \
  --input_file ./${input_folder} \
  --config_file ./${input_folder}/${to_tenant}.json \
  --debug true

```

**Step 5: Prevent future deletions with AUTH0\_ALLOW\_DELETE**

To prevent the deploy-cli from attempting to delete actions in the future, add the following to your configuration file:

```auto
{
  "AUTH0_DOMAIN": "<domain>",
  "AUTH0_CLIENT_ID": "<client>",
  "AUTH0_ALLOW_DELETE": false
}

```

Setting `AUTH0_ALLOW_DELETE` to `false` will prevent the deploy-cli from deleting any resources that exist on the tenant but are not in your configuration.

I understand that you have already mentioned the known workaround provided, however, I have added all additional details in response to your post.

Also well noted in your post, actions bound to Event Streams cannot be deleted from the Auth0 Dashboard UI. If you need to remove an Event Stream action, you must either:

- Delete the Event Stream itself (which will remove the associated action), or
- Use the `auth0` CLI to delete the orphaned action directly.

This issue has been reported as a long-standing limitation in auth0-deploy-cli (present since at least v8.25). Consider opening or upvoting an issue on the [auth0-deploy-cli GitHub repository](https://github.com/auth0/auth0-deploy-cli/issues) to request improved error messaging and automatic trigger unbinding before deletion. In the meantime, the workarounds above should resolve your immediate deployment issues.

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [August 23, 2026, 5:47pm UTC](https://community.auth0.com/t/auth0-deploy-cli-error-problem-deleting-actions-badrequesterror-status-code-400-message-invalid-argument/202727/4 "2026-08-23T17:47:17Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
