# deleteTask

```graphql
mutation DeleteTask($projectReference: String!, $taskId: String!) {
  deleteTask(projectReference: $projectReference, taskId: $taskId) {
    ok
  }
}
```

Delete the source file of a task that is no longer needed; returns the acknowledgement ok: true. Requires project.runs.write.

## Arguments

| Name                     | Type             | Required | Description                                                               |
| ------------------------ | ---------------- | -------- | ------------------------------------------------------------------------- |
| `projectReference`       | String!          | Yes      |                                                                           |
| `taskId`                 | String!          | Yes      |                                                                           |
| `input`                  | WriteTargetInput |          |                                                                           |
| `input.sourceTargetKind` | WriteTargetKind  |          | The source to write; default project. One of `project`, `preview_branch`. |
| `input.targetBranchId`   | ID               |          | Required with the kind preview\_branch.                                   |

## Variables

```json
{
  "projectReference": "string",
  "taskId": "string"
}
```

## Responses

| Status | Description                                   |
| ------ | --------------------------------------------- |
| 200    | The SourceDeletionResult! in data.deleteTask. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "mutation DeleteTask($projectReference: String!, $taskId: String!) {\n  deleteTask(projectReference: $projectReference, taskId: $taskId) {\n    ok\n  }\n}",
  "variables": {
    "projectReference": "string",
    "taskId": "string"
  }
}'
```

## Example response

```json
{
  "data": {
    "deleteTask": {
      "ok": false
    }
  }
}
```
