# updateBranchStatusCheck

```graphql
mutation UpdateBranchStatusCheck($branchId: ID!, $checkName: String!, $input: UpdateBranchStatusCheckInput!) {
  updateBranchStatusCheck(branchId: $branchId, checkName: $checkName, input: $input) {
    id
    branchId
    checkName
    status
    description
    externalUrl
    startedAt
    completedAt
    createdAt
    updatedAt
  }
}
```

Create or replace one named status check on a branch. Requires project.files.write.

## Arguments

| Name                | Type                          | Required | Description                                                                                      |
| ------------------- | ----------------------------- | -------- | ------------------------------------------------------------------------------------------------ |
| `branchId`          | ID!                           | Yes      | Branch the check reports on. A missing branch and one the caller cannot read are both not found. |
| `checkName`         | String!                       | Yes      | Check name; the key of the check on its branch.                                                  |
| `input`             | UpdateBranchStatusCheckInput! | Yes      |                                                                                                  |
| `input.status`      | StatusCheckStatus!            | Yes      | State to report. One of `pending`, `success`, `failure`.                                         |
| `input.description` | String                        |          | Description of the result, at most 1000 characters.                                              |
| `input.externalUrl` | String                        |          | Link to the external result; a URL of at most 2000 characters.                                   |

## Variables

```json
{
  "branchId": "string",
  "checkName": "ci/build",
  "input": {
    "status": "pending"
  }
}
```

## Responses

| Status | Description                                             |
| ------ | ------------------------------------------------------- |
| 200    | The BranchStatusCheck! in data.updateBranchStatusCheck. |

## 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 UpdateBranchStatusCheck($branchId: ID!, $checkName: String!, $input: UpdateBranchStatusCheckInput!) {\n  updateBranchStatusCheck(branchId: $branchId, checkName: $checkName, input: $input) {\n    id\n    branchId\n    checkName\n    status\n    description\n    externalUrl\n    startedAt\n    completedAt\n    createdAt\n    updatedAt\n  }\n}",
  "variables": {
    "branchId": "string",
    "checkName": "ci/build",
    "input": {
      "status": "pending"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "updateBranchStatusCheck": {
      "id": "string",
      "branchId": "string",
      "checkName": "string",
      "status": "pending",
      "description": "string",
      "externalUrl": "https://example.com",
      "startedAt": "string",
      "completedAt": "string",
      "createdAt": "string",
      "updatedAt": "string"
    }
  }
}
```
