# Calling circleci api from within another circleci project gives '"Project not found"' error

**URL:** <https://discuss.circleci.com/t/calling-circleci-api-from-within-another-circleci-project-gives-project-not-found-error/20763>\
**Category:** Bug Reports\
**Created:** [March 16, 2018, 4:30am UTC](https://discuss.circleci.com/t/calling-circleci-api-from-within-another-circleci-project-gives-project-not-found-error/20763 "2018-03-16T04:30:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kongakong](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/kongakong/32/2276_2.png) [@kongakong](https://discuss.circleci.com/u/kongakong)\
**Post date:** [March 16, 2018, 4:30am UTC](https://discuss.circleci.com/t/calling-circleci-api-from-within-another-circleci-project-gives-project-not-found-error/20763/1 "2018-03-16T04:30:29Z")

</div>

When I try this command in a shell on my local PC , it works as expected

`curl -X POST --header "Content-Type: application/json" https://circleci.com/api/v1.1/project/github/<CompanyGitHubAccount>/myproject/tree/mybranch?circle-token=...`

I can see a job to build myproject is started.

However if I put this as a step in a workflow

```
  deploy:
    docker: *docker
    steps:
      - run:
          name: Run deploy command
          command: |
            TRIGGER_BUILD_URL=https://circleci.com/api/v1.1/project/github/CompanyGitHubAccount/myproject/tree/${CIRCLE_BRANCH}?circle-token=
            echo Deploy url ${TRIGGER_BUILD_URL}
            curl -X POST --header "Content-Type: application/json" ${TRIGGER_BUILD_URL}=${CI_TOKEN}

```

I get this error:

```
{
  "message" : "Project not found"
}

```

If I use an invalid project name in my shell, I will get a different error message:

```
{
  "message" : "{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3/repos/#get\"}"

```

My questions:

1. Why api call failed as a step in my circleci job?

2. Why the error messages are entirely different between the circleci one and my local one?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:35am UTC](https://discuss.circleci.com/t/calling-circleci-api-from-within-another-circleci-project-gives-project-not-found-error/20763/2 "2018-06-18T11:35:34Z")

</div>


