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

# Delete Definition

Use this API to soft-delete (tombstone) a workflow definition. Tombstoned definitions are filtered from `get` and `list`. Definitions with in-flight executions cannot be deleted.

# Endpoint

`POST https://api.velt.dev/v2/workflow/definitions/delete`

# Headers

<ParamField header="x-velt-api-key" type="string" required>
  Your API key.
</ParamField>

<ParamField header="x-velt-auth-token" type="string" required>
  Your [Auth Token](/security/auth-tokens).
</ParamField>

# Body

#### Params

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="definitionId" type="string" required>
      The definition to delete.
    </ParamField>

    <ParamField body="organizationId" type="string">
      Required when scoped to an organization or document.
    </ParamField>

    <ParamField body="documentId" type="string">
      Required when scoped to a document.
    </ParamField>
  </Expandable>
</ParamField>

## **Example Requests**

#### Delete a definition

```JSON theme={null}
{
  "data": {
    "definitionId": "marketing-copy-approval"
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "deleted": true,
    "definitionId": "marketing-copy-approval"
  }
}
```

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "FAILED_PRECONDITION"
  }
}
```

**Errors:** `NOT_FOUND` (definition does not exist) / `FAILED_PRECONDITION` (in-flight executions exist).

<ResponseExample>
  ```js theme={null}
  {
    "result": {
      "deleted": true,
      "definitionId": "marketing-copy-approval"
    }
  }
  ```
</ResponseExample>
