# Branches

This endpoint is used for the creation and deletion of branches.&#x20;

\
API URL - <https://api.moropo.com/branches>

### Available actions

1. Create Branch
2. Delete Branch

## Example - Creating a Branch

Note this request uses `POST` to inform the API that a branch is being created

```bash
curl -X 'POST' \
  'https://api.moropo.com/branches' \
  -H 'accept: */*' \
  -H 'x-app-api-key: MOROPO_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "branchName": "BRANCH_NAME"
}'
```

Where;

* `MOROPO_API_KEY` is the API key for the target app, found in your [Moropo settings](https://app.moropo.com/settings?index=integrations).
* `BRANCH_NAME` is the name of the target branch to download tests from.

#### Expected Response

```json
Successfully created branch BRANCH_NAME
```

## Example - Deleting a Branch

Note this request uses `DELETE` to inform the API that a branch is being deleted

```bash
curl -X 'DELETE' \
  'https://api.moropo.com/branches' \
  -H 'accept: */*' \
  -H 'x-app-api-key: MOROPO_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "branchName": "BRANCH_NAME"
}'
```

Where;

* `MOROPO_API_KEY` is the API key for the target app, found in your [Moropo settings](https://app.moropo.com/settings?index=integrations).
* `BRANCH_NAME` is the name of the target branch to download tests from.

#### Expected Response

```
Successfully deleted branch BRANCH_NAME
```
