# 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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.moropo.com/ci-integration/moropo-api/branches.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
