# 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.sendping.co/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 { SendPing } from 'sendping';

const mb = new SendPing('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 "sendping"

SendPing.api_key = "mb_xxxxxxxxx"

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

**PHP**

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

use SendPing\SendPing;

$sendping = SendPing::client('mb_xxxxxxxxx');

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

**Python**

```python
import sendping

sendping.api_key = "mb_xxxxxxxxx"

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

**Go**

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

client := sendping.NewClient("mb_xxxxxxxxx")

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

**Rust**

```rust
use sendping::SendPing;

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

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

**Java**

```java
import co.sendping.SendPing;
import co.sendping.SendPingResponse;

SendPing sendping = new SendPing("mb_xxxxxxxxx");

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

**.NET**

```csharp
using SendPing;

ISendPing sendping = SendPingClient.Create("mb_xxxxxxxxx");

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

**cURL**

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

**CLI**

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

### Response

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