Alternative to /tree/<branch> in API v2 or circleci 2.1

Hi there,

Does anyone have a solution to triggering jobs within circleci 2.1?

I’m looking for an alternative to:

where I can specify a branch within the url.

I’ve tried:

-d ‘{“branch”: “$branch”}’

but this always executes the pipeline on the default github branch.

First, you should read this if you haven’t already:

So with the 1.2 API, you are triggering a pipeline, and instead of including the branch in the URL that you are POSTing to, you will specify “branch” as a top-level parameter in your payload.

Example POST:{owner}/{project}/pipeline


  "branch": "myBranch"
1 Like

In my case the branch payload was not enough as previously I was passing in the branch within the url as well as the workflow to trigger.

Something like:

-d ‘{“branch”: “$CIRCLE_BRANCH”, “parameters”: {“workflow”: my-workflow }}’

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.