# deleteBranch

```graphql
mutation DeleteBranch($input: DeleteBranchInput!) {
  deleteBranch(input: $input) {
    ok
  }
}
```

Delete a branch and its uncommitted changes. Requires project.files.write; API keys also need delete scope.

## Arguments

| Name             | Type               | Required | Description                                                                                                           |
| ---------------- | ------------------ | -------- | --------------------------------------------------------------------------------------------------------------------- |
| `input`          | DeleteBranchInput! | Yes      |                                                                                                                       |
| `input.branchId` | ID!                | Yes      | Branch to delete. Only a branch with a base branch can be deleted, excluding main. Its associated content is removed. |

## Variables

```json
{
  "input": {
    "branchId": "string"
  }
}
```

## Responses

| Status | Description                                    |
| ------ | ---------------------------------------------- |
| 200    | The DeleteBranchPayload! in data.deleteBranch. |

## 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 DeleteBranch($input: DeleteBranchInput!) {\n  deleteBranch(input: $input) {\n    ok\n  }\n}",
  "variables": {
    "input": {
      "branchId": "string"
    }
  }
}'
```

## Example response

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