# Delete Automation Step

> DELETE /automations/:id/steps/:stepId — remove a step from a disabled automation.

`DELETE /automations/:id/steps/:stepId`

Removes a single step from an automation. The automation must be **disabled** — deleting steps from an enabled automation is not allowed because it would change the graph for in-flight runs. [Stop](https://www.senddart.com/docs/api/automations-stop) or disable the automation first, then delete the step.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The ID of the automation that owns the step. |
| `stepId` | string | Yes | The ID of the step to delete. |

**Node.js**

```js
import { SendDart } from 'senddart';

const mb = new SendDart('mb_xxxxxxxxx');

const { data, error } = await mb.automations.deleteStep('c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd', '9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d');
console.log({ data, error });
```

**Ruby**

```ruby
require "senddart"

SendDart.api_key = "mb_xxxxxxxxx"

SendDart::Automations.delete_step("c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd", "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d")
```

**PHP**

```php
<?php
require 'vendor/autoload.php';

use SendDart\SendDart;

$senddart = SendDart::client('mb_xxxxxxxxx');

$senddart->automations->deleteStep('c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd', '9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d');
```

**Python**

```python
import senddart

senddart.api_key = "mb_xxxxxxxxx"

senddart.Automations.delete_step("c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd", "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d")
```

**Go**

```go
import "github.com/shekhu10/senddart-sdks/senddart-go"

client := senddart.NewClient("mb_xxxxxxxxx")

removed, err := client.Automations.DeleteStep("c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd", "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d")
```

**Rust**

```rust
use senddart::SendDart;

let mb = SendDart::new("mb_xxxxxxxxx");

let _removed = mb.automations.delete_step("c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd", "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d").await?;
```

**Java**

```java
import com.senddart.SendDart;
import com.senddart.SendDartResponse;

SendDart senddart = new SendDart("mb_xxxxxxxxx");

SendDartResponse response = senddart.automations().deleteStep(
        "c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd",
        "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d");
```

**.NET**

```csharp
using SendDart;

ISendDart senddart = SendDartClient.Create("mb_xxxxxxxxx");

var resp = await senddart.AutomationDeleteStepAsync(
    "c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd",
    "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d");
```

**cURL**

```bash
curl -X DELETE 'https://www.senddart.com/api/automations/c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd/steps/9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d' \
  -H 'Authorization: Bearer mb_xxxxxxxxx'
```

**CLI**

```bash
senddart automations delete-step c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd 9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
```

### Response

```json
{
  "id": "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
  "deleted": true
}
```
