# Discard Developer Workflow Draft

> Discard the current unpublished draft while preserving published versions.

Source: [https://genhealth.ai/docs/workflows/api-reference/v1/workflow-developer-api/discard-developer-workflow-draft](https://genhealth.ai/docs/workflows/api-reference/v1/workflow-developer-api/discard-developer-workflow-draft)

## Endpoint

`DELETE /developer/v1/workflows/{definition_id}/draft`

## Authentication

Send a GenHealth credential in the `Authorization` header:

```http
Authorization: Bearer <YOUR_API_KEY>
Accept: application/json
```

Required scopes: `workflow:write`

## Parameters

| Name | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `definition_id` | path | string | Yes | No description provided. |

## Request examples

### cURL

```curl
curl --request DELETE \
  --url 'https://api.umpa.genhealth.ai/developer/v1/workflows/{definition_id}/draft' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Accept: application/json'
```

### JavaScript

```javascript
const response = await fetch('https://api.umpa.genhealth.ai/developer/v1/workflows/{definition_id}/draft', {
  method: 'DELETE',
  headers: {
    Authorization: 'Bearer <YOUR_API_KEY>',
    Accept: 'application/json',
  },
});

const data = await response.json();
```

### Python

```python
import requests

response = requests.delete(
    'https://api.umpa.genhealth.ai/developer/v1/workflows/{definition_id}/draft',
    headers={
        'Authorization': 'Bearer <YOUR_API_KEY>',
        'Accept': 'application/json',
    },
)

data = response.json()
```

## Responses

| Status | Description |
| --- | --- |
| 204 | Successful Response |
| 422 | Validation Error |

### 204 response example

```json
{
  "message": "Successful Response"
}
```

### 422 response example

```json
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
```
