# API calls returning error message \*Branch not found\*

**URL:** <https://discuss.circleci.com/t/api-calls-returning-error-message-branch-not-found/23687>\
**Category:** Bug Reports\
**Tags:** api\
**Created:** [July 18, 2018, 10:01pm UTC](https://discuss.circleci.com/t/api-calls-returning-error-message-branch-not-found/23687 "2018-07-18T22:01:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarsyla](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@amarsyla](https://discuss.circleci.com/u/amarsyla)\
**Post date:** [July 18, 2018, 10:01pm UTC](https://discuss.circleci.com/t/api-calls-returning-error-message-branch-not-found/23687/1 "2018-07-18T22:01:04Z")

</div>

We used the API to make POST requests to `/project/:vcs-type/:username/:project` to trigger new builds before, and it stopped working yesterday. After debugging, I noticed there was an error response coming from the API which stated `Branch not found`. I thought it was an API change which I wasn’t aware of, and updated our API call to POST to `/project/:vcs-type/:username/:project/tree/:branch`. Before, the API assumed the default branch was master, but not anymore.

After the issue was fixed on our side, I went ahead to setup a new project on CircleCI, and on the project setup page, after I click “Start building”, it says `Failed`. After checking the network requests with the developer tools, I notice the same `Branch not found` error was happening there as well. So, I think that this is a bug on the API, which breaks the old trigger endpoint, and other endpoints used internally from CircleCI as well.

We use BitBucket.

---

<div class="post-metadata">

**Author:** ![owenhaynes](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/owenhaynes/32/23930_2.png) [@owenhaynes](https://discuss.circleci.com/u/owenhaynes)\
**Post date:** [July 25, 2018, 12:06pm UTC](https://discuss.circleci.com/t/api-calls-returning-error-message-branch-not-found/23687/2 "2018-07-25T12:06:39Z")

</div>

Happening here as well, we have a new repository on BitBucket unable to start builds. I am surprised more people have not encountered this issue.

---

<div class="post-metadata">

**Author:** ![amarsyla](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@amarsyla](https://discuss.circleci.com/u/amarsyla)\
**Post date:** [July 25, 2018, 4:25pm UTC](https://discuss.circleci.com/t/api-calls-returning-error-message-branch-not-found/23687/3 "2018-07-25T16:25:17Z")

</div>

If you don’t want to wait for a fix, I was able to get the project started using the API with the correct endpoint.
