# Edit a workflow draft

Edits a workflow: `name`, `description`, `definition` or `status`, each on its own, so renaming one does not mean sending the canvas back. Editing is SAFE and takes effect on nothing — a run executes the published version, never the draft — until somebody publishes. This is also how a workflow that HAS published is retired: `{"status": "archived"}`, because `delete_workflows_id` only takes a draft that never published.

Access class: `workspace:admin`.

## Endpoint

`PATCH /v1/workflows/{id}`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| id | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "definition": "string",
    "description": "string",
    "name": "string",
    "status": "string"
  },
  "params": {
    ":id": "string"
  },
  "query": {}
}
```

## Responses

### 200

the action's answer

Content type: `application/json`.

```json
{}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
