CircleCI API v2 returns "404 Not Found"

When sending requests to CircleCI API v2 endpoints, you might receive a 404 response. Depending on which endpoint you're using at the time you could get any of the following response:

  • {"message" : "Not Found"}
  • {"message" : "Pipeline not found"}
  • {"message" : "Project not found"}
  • {"message" : "Workflow not found"}

 

Incorrect path

The response {"message" : "Not Found"} indicates that the URL path you specified is incorrect, specifically the endpoint path.

In case you receive this response, make sure that there are no typos in the endpoint path. (ex: "https://circleci.com/api/v2/wokflow" instead of "https://circleci.com/api/v2/workflow")

 

Use of a project API token instead of a personal API token

Depending on the endpoint, the responses {"message" : "Project not found"}{"message" : "Pipeline not found"} or {"message" : "Workflow not found"} can happen when you're authenticating your API call using a project API token as opposed to a personal API token.

Project tokens are currently not supported on API v2. Any token found under "Project Settings > API Permissions" is a project API token, regardless of the scope you assigned to it.

For any request made via CircleCI API v2 endpoints, make sure to use personal API tokens.

In case the API token is likely to be shared across your team, we recommend creating a machine-user and generating and personal API token for that machine-user.

 

Incorrect project name, pipeline ID or workflow ID

You API request will also returns a {"message" : "Project not found"}{"message" : "Pipeline not found"} or {"message" : "Workflow not found"} response if the project name, pipeline ID or workflow ID specified in the endpoint path is invalid (incorrect or truncated).

If you're using an environment variable to specify the project name, pipeline ID or workflow ID in your API call, make sure the related environment variable is properly populated.

 

 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.