CircleCI API v.1.1 - Cannot find a definition for job named build

I am trying API v1.1 as I want to use the project token instead of the personal token as project token is still not supported in v2.

curl --request POST \
  --url https://circleci.com/api/v1.1/project/github/xxx/yyy/tree/feature-dms \
  --header 'Circle-Token: CCIPRJ_xxxx' \
  --header 'content-type: application/json' \
  --data '{"build_parameters":{"USE_RUNNER_AGENT": true, "TAGS": "'tf_init,eks_application'"},"branch": "dev"}' \
  --ssl-no-revoke -k

For this, I am getting the error:

"message" : "Error calling workflow: 'build' Cannot find a definition for job named build"

I don’t have any workflow or job with the name build. What is going on here?

1 Like

Hi,

Referring to the docs for the v1 endpoint:

Parameter Description
job Name of job. If not provided, defaults to a job named build.

By default, the job name will be build if you do not pass in the name with the request.

Could you try passing in the job name like the following example?

--data '{"job": "jobotherthanbuild", "build_parameters":{"USE_RUNNER_AGENT": true, "TAGS": "'tf_init,eks_application'"},"branch": "dev"}'

Please note that we recommend using the newer v2 endpoints when possible.

Thank you!