Skip to content
This documentation applies to Codacy Self-hosted v4.0.1

For the latest updates and improvements, see the latest Cloud documentation instead.

Using the Codacy API#

The Codacy API allows you to programmatically retrieve and analyze data from Codacy and perform a few configuration changes.

Codacy supports two API versions but we strongly recommend using the new API v3 when possible since it's the version being actively developed:

API v3 (recommended) API v2
Endpoint documentation
Base URL

Use the new endpoints to access and manipulate the following resources, among others:

  • Analysis details, issue and ignored issue details, repository quality settings
  • Account details and API token management
  • Organization details and join request management
  • People management
  • Repository management and file details
  • Tool and code pattern details

Use the legacy endpoints to access and manipulate the following resources:

  • Commit code quality details and deltas
  • Project details and configurations, file code quality and issue details


If you're using Codacy Self-hosted you must update the base URL of the APIs to include your Codacy instance domain name. For example:   

Authenticating requests to the Codacy API#

Most API endpoints require that you provide either a project or account API token. After obtaining the necessary tokens, include them in your request headers using the format api-token: <token key> or project-token: <token key>.

For example, to make a request to an API v3 endpoint that requires an account API token:

curl -X GET \
     -H 'api-token: SjE9y7ekgKdpaCofsAhd'

Or to make a request to an API v2 endpoint that requires a project API token:

curl -X GET \
     -H 'project-token: c9f2feb28e780acc8dc40754978b8bd9'

Using parameters in requests#

Most API endpoints require that you specify parameters.

For GET requests, specify parameters directly as path segments of the endpoint URLs. Some endpoints also accept optional query string parameters.

For example, to call the endpoint getRepositoryWithAnalysis with the parameters:

  • provider: gh
  • remoteOrganizationName: codacy
  • repositoryName: docs
  • branch (query string): api-overview
curl -X GET \
     -H 'api-token: SjE9y7ekgKdpaCofsAhd'

For POST, PATCH, and DELETE requests, besides the parameters included in the URL you may also need to include a JSON body.

For example, to call the endpoint searchRepositoryIssues specifying the issue levels Error and Warning in the body:

curl -X POST \
     -H 'api-token: SjE9y7ekgKdpaCofsAhd' \
     -H 'Content-Type: application/json' \
     -d '{"levels": ["Error", "Warning"]}'

Share your feedback 📢

Did this page help you?

Thanks for the feedback! Is there anything else you'd like to tell us about this page?

We're sorry to hear that. Please let us know what we can improve:

Alternatively, you can create a more detailed issue on our GitHub repository.

Thanks for helping improve the Codacy documentation.

If you have a question or need help please contact

Last modified May 17, 2021