> ## Documentation Index
> Fetch the complete documentation index at: https://docs.autosend.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Automation

> Soft-deletes a workflow automation. Active executions are stopped.

> [!NOTE]
>
> Soft-deletes a workflow automation. In-flight executions are stopped and no new contacts will enter the workflow.

```bash cURL theme={null}
curl --request DELETE \
  --url https://api.autosend.com/v1/automations/60d5ec49f1b2c72d9c8b9abc \
  --header 'Authorization: Bearer AS_your-project-api-key'
```

```python Python theme={null}
import requests

url = "https://api.autosend.com/v1/automations/60d5ec49f1b2c72d9c8b9abc"

headers = {
    "Authorization": "Bearer AS_your-project-api-key"
}

response = requests.delete(url, headers=headers)
print(response.json())
```

```javascript JavaScript theme={null}
fetch('https://api.autosend.com/v1/automations/60d5ec49f1b2c72d9c8b9abc', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer AS_your-project-api-key'
  }
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));
```

```php PHP theme={null}
<?php

$url = 'https://api.autosend.com/v1/automations/60d5ec49f1b2c72d9c8b9abc';

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer AS_your-project-api-key'
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
```

```go Go theme={null}
package main

import (
    "fmt"
    "net/http"
)

func main() {
    url := "https://api.autosend.com/v1/automations/60d5ec49f1b2c72d9c8b9abc"

    req, _ := http.NewRequest("DELETE", url, nil)
    req.Header.Set("Authorization", "Bearer AS_your-project-api-key")

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        fmt.Println("Error:", err)
        return
    }
    defer resp.Body.Close()

    fmt.Println("Response Status:", resp.Status)
}
```

```java Java theme={null}
import java.net.HttpURLConnection;
import java.net.URL;

public class DeleteWorkflow {
    public static void main(String[] args) {
        try {
            URL url = new URL("https://api.autosend.com/v1/automations/60d5ec49f1b2c72d9c8b9abc");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();

            con.setRequestMethod("DELETE");
            con.setRequestProperty("Authorization", "Bearer AS_your-project-api-key");

            int status = con.getResponseCode();
            System.out.println("Response Status: " + status);

            con.disconnect();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
```

```ruby Ruby theme={null}
require 'net/http'
require 'uri'

uri = URI('https://api.autosend.com/v1/automations/60d5ec49f1b2c72d9c8b9abc')

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(uri)
request['Authorization'] = 'Bearer AS_your-project-api-key'

response = http.request(request)
puts response.body
```

```json Response theme={null}
{
  "success": true,
  "message": "Workflow automation deleted successfully"
}
```

***

#### Authorizations

**Authorizations** `string | header` *required*

Project API key header of the form Bearer `AS_<key>`.

### Path Parameters

**id** `string` *required*

Workflow automation ID.

#### Response

Workflow automation deleted successfully

**success** `boolean`

Example: `true`

**message** `string`

Confirmation message.

Example: `"Workflow automation deleted successfully"`

#### Error Responses

**404 - Automation not found** `object`

Returned when no automation with the given ID exists on the project.

```json theme={null}
{
  "success": false,
  "error": {
    "message": "Automation not found",
    "code": "AUTOMATION_NOT_FOUND",
    "status": 404
  }
}
```


## OpenAPI

````yaml DELETE /automations/{id}
openapi: 3.1.0
info:
  title: AutoSend API
  description: >-
    AutoSend REST API for managing workflow automations. Workflow automations
    send a sequence of emails to contacts based on entry criteria (contact
    created, added to a list, segment match, contact-property match,
    contact-property change, or a custom event). These endpoints accept a
    standard project API key (AS_ prefix).
  version: 1.0.0
servers:
  - url: https://api.autosend.com/v1
security:
  - bearerAuth: []
paths:
  /automations/{id}:
    delete:
      summary: Delete Automation
      description: Soft-deletes a workflow automation. Active executions are stopped.
components: {}

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.