# createBranchApproval

```graphql
mutation CreateBranchApproval($branchId: ID!) {
  createBranchApproval(branchId: $branchId) {
    id
    branchId
    approvedBy
    approvedAt
    comment
    dismissedAt
    dismissedBy
    dismissedReason
  }
}
```

Approve a branch as the calling user, optionally with a comment. Requires project.files.write.

## Arguments

| Name            | Type                      | Required | Description                                                                            |
| --------------- | ------------------------- | -------- | -------------------------------------------------------------------------------------- |
| `branchId`      | ID!                       | Yes      | Branch to approve. A missing branch and one the caller cannot read are both not found. |
| `input`         | CreateBranchApprovalInput |          |                                                                                        |
| `input.comment` | String                    |          | Approval comment, at most 1000 characters.                                             |

## Variables

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

## Responses

| Status | Description                                       |
| ------ | ------------------------------------------------- |
| 200    | The BranchApproval! in data.createBranchApproval. |

## 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 CreateBranchApproval($branchId: ID!) {\n  createBranchApproval(branchId: $branchId) {\n    id\n    branchId\n    approvedBy\n    approvedAt\n    comment\n    dismissedAt\n    dismissedBy\n    dismissedReason\n  }\n}",
  "variables": {
    "branchId": "string"
  }
}'
```

## Example response

```json
{
  "data": {
    "createBranchApproval": {
      "id": "string",
      "branchId": "string",
      "approvedBy": "string",
      "approvedAt": "string",
      "comment": "string",
      "dismissedAt": "string",
      "dismissedBy": "string",
      "dismissedReason": "string"
    }
  }
}
```
