NAV Navigation
Shell HTTP JavaScript Node.js Ruby Python Java Go

Codacy API v3.0.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Codacy API v3 reference.

Import the OpenAPI 2.0 definition into your development tools to help bootstrap your integration with Codacy. For more information see Using the Codacy API.

Base URLs:

Email: Codacy Team Web: Codacy Team License: Codacy. All rights reserved

Authentication

version

getVersion

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/version \
  -H 'Accept: application/json'

GET https://app.codacy.com/api/v3/version HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/version',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://app.codacy.com/api/v3/version',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://app.codacy.com/api/v3/version',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://app.codacy.com/api/v3/version', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/version");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/version", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /version

Return the version of the Codacy installation

Example responses

200 Response

{
  "data": "string"
}

Responses

Status Meaning Description Schema
200 OK Successful operation Version
401 Unauthorized Unauthorized Unauthorized
500 Internal Server Error Internal Server Error InternalServerError

analysis

listOrganizationRepositoriesWithAnalysis

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories

List an organization repositories with analysis information for the authenticated user.

List an organization repositories with analysis information for the authenticated user. For Bitbucket you must URL encode the cursor before using it in subsequent API calls, as the pagination comes directly from the Git provider.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return
search query string false Filter the results searching by this string.
repositories query string false Deprecated, use SearchOrganizationRepositoriesWithAnalysis instead

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "lastAnalysedCommit": {
        "sha": "string",
        "id": 1,
        "commitTimestamp": "2019-05-07T14:29:13.430Z",
        "authorName": "string",
        "authorEmail": "string",
        "message": "string",
        "startedAnalysis": "2022-01-07T14:29:13.430Z",
        "endedAnalysis": "2022-01-07T14:29:13.430Z",
        "isMergeCommit": false,
        "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
        "parents": [
          "string"
        ]
      },
      "grade": 74,
      "gradeLetter": "A",
      "issuesPercentage": 1,
      "complexFilesPercentage": 1,
      "duplicationPercentage": 1,
      "repository": {
        "repositoryId": 45738,
        "provider": "gh",
        "owner": "codacy",
        "name": "codacy-eslint",
        "fullPath": "codacy/codacy-eslint",
        "visibility": "Private",
        "remoteIdentifier": "3",
        "lastUpdated": "2019-05-07T14:29:13.430Z",
        "permission": "admin",
        "problems": [
          {
            "message": "We can't analyze this repository because none of the committers are part of the organization.",
            "actions": [
              {
                "name": "Check our documentation",
                "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
              }
            ],
            "code": "failed_to_clone",
            "severity": "all_analysis"
          }
        ],
        "languages": [
          "Java",
          "Scala",
          "CSS"
        ],
        "defaultBranch": {
          "id": 1,
          "name": "master",
          "isDefault": true,
          "isEnabled": true,
          "lastUpdated": "2019-05-07T14:29:13.430Z",
          "branchType": "Branch",
          "lastCommit": "string"
        },
        "badges": {
          "grade": "https://app.codacy.com/project/badge/Grade/d992a862b1994805907ec277e16b0fda",
          "coverage": "https://app.codacy.com/project/badge/Coverage/d992a862b1994805907ec277e16b0fda"
        },
        "codingStandardId": 0,
        "codingStandardName": "string",
        "addedState": "Added",
        "gatePolicyId": 0,
        "gatePolicyName": "string"
      },
      "branch": {
        "id": 1,
        "name": "master",
        "isDefault": true,
        "isEnabled": true,
        "lastUpdated": "2019-05-07T14:29:13.430Z",
        "branchType": "Branch",
        "lastCommit": "string"
      },
      "selectedBranch": {
        "id": 1,
        "name": "master",
        "isDefault": true,
        "isEnabled": true,
        "lastUpdated": "2019-05-07T14:29:13.430Z",
        "branchType": "Branch",
        "lastCommit": "string"
      },
      "coverage": {
        "filesUncovered": 1,
        "filesWithLowCoverage": 1,
        "coveragePercentage": 1,
        "coveragePercentageWithDecimals": 15.25,
        "numberTotalFiles": 1,
        "numberCoveredLines": 1,
        "numberCoverableLines": 1
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation RepositoryWithAnalysisListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError
502 Bad Gateway Bad Gateway BadGateway

searchOrganizationRepositoriesWithAnalysis

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/search/analysis/organizations/{provider}/{remoteOrganizationName}/repositories \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/search/analysis/organizations/{provider}/{remoteOrganizationName}/repositories HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/search/analysis/organizations/{provider}/{remoteOrganizationName}/repositories',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "names": [
    "string"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/search/analysis/organizations/{provider}/{remoteOrganizationName}/repositories',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/search/analysis/organizations/{provider}/{remoteOrganizationName}/repositories',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/search/analysis/organizations/{provider}/{remoteOrganizationName}/repositories', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/search/analysis/organizations/{provider}/{remoteOrganizationName}/repositories");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/search/analysis/organizations/{provider}/{remoteOrganizationName}/repositories", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /search/analysis/organizations/{provider}/{remoteOrganizationName}/repositories

Search organization repositories with analysis information for the authenticated user.

For Bitbucket you must URL encode the cursor before using it in subsequent API calls, as the pagination comes directly from the Git provider.

Body parameter

{
  "names": [
    "string"
  ]
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return
body body SearchOrganizationRepositoriesWithAnalysis true Search query body

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "lastAnalysedCommit": {
        "sha": "string",
        "id": 1,
        "commitTimestamp": "2019-05-07T14:29:13.430Z",
        "authorName": "string",
        "authorEmail": "string",
        "message": "string",
        "startedAnalysis": "2022-01-07T14:29:13.430Z",
        "endedAnalysis": "2022-01-07T14:29:13.430Z",
        "isMergeCommit": false,
        "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
        "parents": [
          "string"
        ]
      },
      "grade": 74,
      "gradeLetter": "A",
      "issuesPercentage": 1,
      "complexFilesPercentage": 1,
      "duplicationPercentage": 1,
      "repository": {
        "repositoryId": 45738,
        "provider": "gh",
        "owner": "codacy",
        "name": "codacy-eslint",
        "fullPath": "codacy/codacy-eslint",
        "visibility": "Private",
        "remoteIdentifier": "3",
        "lastUpdated": "2019-05-07T14:29:13.430Z",
        "permission": "admin",
        "problems": [
          {
            "message": "We can't analyze this repository because none of the committers are part of the organization.",
            "actions": [
              {
                "name": "Check our documentation",
                "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
              }
            ],
            "code": "failed_to_clone",
            "severity": "all_analysis"
          }
        ],
        "languages": [
          "Java",
          "Scala",
          "CSS"
        ],
        "defaultBranch": {
          "id": 1,
          "name": "master",
          "isDefault": true,
          "isEnabled": true,
          "lastUpdated": "2019-05-07T14:29:13.430Z",
          "branchType": "Branch",
          "lastCommit": "string"
        },
        "badges": {
          "grade": "https://app.codacy.com/project/badge/Grade/d992a862b1994805907ec277e16b0fda",
          "coverage": "https://app.codacy.com/project/badge/Coverage/d992a862b1994805907ec277e16b0fda"
        },
        "codingStandardId": 0,
        "codingStandardName": "string",
        "addedState": "Added",
        "gatePolicyId": 0,
        "gatePolicyName": "string"
      },
      "branch": {
        "id": 1,
        "name": "master",
        "isDefault": true,
        "isEnabled": true,
        "lastUpdated": "2019-05-07T14:29:13.430Z",
        "branchType": "Branch",
        "lastCommit": "string"
      },
      "selectedBranch": {
        "id": 1,
        "name": "master",
        "isDefault": true,
        "isEnabled": true,
        "lastUpdated": "2019-05-07T14:29:13.430Z",
        "branchType": "Branch",
        "lastCommit": "string"
      },
      "coverage": {
        "filesUncovered": 1,
        "filesWithLowCoverage": 1,
        "coveragePercentage": 1,
        "coveragePercentageWithDecimals": 15.25,
        "numberTotalFiles": 1,
        "numberCoveredLines": 1,
        "numberCoverableLines": 1
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation RepositoryWithAnalysisListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError
502 Bad Gateway Bad Gateway BadGateway

getRepositoryWithAnalysis

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}

Get a repository with analysis information for the authenticated user

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
branch query string false Name of a repository branch enabled on Codacy,

Detailed descriptions

branch: Name of a repository branch enabled on Codacy, as returned by the endpoint listRepositoryBranches. By default, uses the main branch defined on the Codacy repository settings.

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "lastAnalysedCommit": {
      "sha": "string",
      "id": 1,
      "commitTimestamp": "2019-05-07T14:29:13.430Z",
      "authorName": "string",
      "authorEmail": "string",
      "message": "string",
      "startedAnalysis": "2022-01-07T14:29:13.430Z",
      "endedAnalysis": "2022-01-07T14:29:13.430Z",
      "isMergeCommit": false,
      "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
      "parents": [
        "string"
      ]
    },
    "grade": 74,
    "gradeLetter": "A",
    "issuesPercentage": 1,
    "complexFilesPercentage": 1,
    "duplicationPercentage": 1,
    "repository": {
      "repositoryId": 45738,
      "provider": "gh",
      "owner": "codacy",
      "name": "codacy-eslint",
      "fullPath": "codacy/codacy-eslint",
      "visibility": "Private",
      "remoteIdentifier": "3",
      "lastUpdated": "2019-05-07T14:29:13.430Z",
      "permission": "admin",
      "problems": [
        {
          "message": "We can't analyze this repository because none of the committers are part of the organization.",
          "actions": [
            {
              "name": "Check our documentation",
              "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
            }
          ],
          "code": "failed_to_clone",
          "severity": "all_analysis"
        }
      ],
      "languages": [
        "Java",
        "Scala",
        "CSS"
      ],
      "defaultBranch": {
        "id": 1,
        "name": "master",
        "isDefault": true,
        "isEnabled": true,
        "lastUpdated": "2019-05-07T14:29:13.430Z",
        "branchType": "Branch",
        "lastCommit": "string"
      },
      "badges": {
        "grade": "https://app.codacy.com/project/badge/Grade/d992a862b1994805907ec277e16b0fda",
        "coverage": "https://app.codacy.com/project/badge/Coverage/d992a862b1994805907ec277e16b0fda"
      },
      "codingStandardId": 0,
      "codingStandardName": "string",
      "addedState": "Added",
      "gatePolicyId": 0,
      "gatePolicyName": "string"
    },
    "branch": {
      "id": 1,
      "name": "master",
      "isDefault": true,
      "isEnabled": true,
      "lastUpdated": "2019-05-07T14:29:13.430Z",
      "branchType": "Branch",
      "lastCommit": "string"
    },
    "selectedBranch": {
      "id": 1,
      "name": "master",
      "isDefault": true,
      "isEnabled": true,
      "lastUpdated": "2019-05-07T14:29:13.430Z",
      "branchType": "Branch",
      "lastCommit": "string"
    },
    "coverage": {
      "filesUncovered": 1,
      "filesWithLowCoverage": 1,
      "coveragePercentage": 1,
      "coveragePercentageWithDecimals": 15.25,
      "numberTotalFiles": 1,
      "numberCoveredLines": 1,
      "numberCoverableLines": 1
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation RepositoryWithAnalysisResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getTools

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools

Get analysis tools settings of a repository

Note: When applied to public repositories, this operation does not require authentication.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "name": "string",
      "isClientSide": true,
      "settings": {
        "name": "string",
        "isEnabled": true,
        "usesConfigurationFile": true
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation AnalysisToolsResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

configureTool

Code samples

# You can also use wget
curl -X PATCH https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools/{toolUuid} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

PATCH https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools/{toolUuid} HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools/{toolUuid}',
  method: 'patch',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "patterns": [
    {
      "id": "ESLint_@typescript-eslint_no-shadow",
      "enabled": true
    }
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools/{toolUuid}',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.patch 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools/{toolUuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.patch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools/{toolUuid}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools/{toolUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools/{toolUuid}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools/{toolUuid}

*Configure an analysis tool by enabling and disabling its patterns for a repository. This endpoint will apply the changes without verifying if the repository belongs to a coding standard. *

Body parameter

{
  "patterns": [
    {
      "id": "ESLint_@typescript-eslint_no-shadow",
      "enabled": true
    }
  ]
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
toolUuid path string true Tool unique identifier
deleteIssuesForDisabledPatterns query boolean false Whether to delete related issues when disabling a tool's pattern.
body body ConfigureToolBody true none

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
409 Conflict Conflict Conflict
500 Internal Server Error Internal Server Error InternalServerError

getFirstAnalysisOverview

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/analysis-progress \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/analysis-progress HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/analysis-progress',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/analysis-progress',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/analysis-progress',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/analysis-progress', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/analysis-progress");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/analysis-progress", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/analysis-progress

Get the analysis progress of a repository

Note: When applied to public repositories, this operation does not require authentication.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
branch query string false Name of a repository branch enabled on Codacy,

Detailed descriptions

branch: Name of a repository branch enabled on Codacy, as returned by the endpoint listRepositoryBranches. By default, uses the main branch defined on the Codacy repository settings.

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "action": "clone",
      "complete": false
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation FirstAnalysisOverviewResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listRepositoryPullRequests

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests

List pull requests from a repository that the user as access to

You can search this endpoint for either last-updated (default), impact or merged

Note: When applied to public repositories, this operation does not require authentication.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
limit query integer(int32) false Maximum number of items to return
cursor query string false Cursor to specify a batch of results to request
search query string false Filter the results searching by this string.
includeNotAnalyzed query boolean false If true, also return pull requests that weren't analyzed

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "isUpToStandards": true,
      "isAnalysing": false,
      "pullRequest": {
        "id": 1,
        "number": 1,
        "updated": "2019-05-07T14:29:13.430Z",
        "status": "open",
        "repository": "awesome-repository",
        "title": "Amazing pull request",
        "owner": {
          "name": "Foo",
          "avatarUrl": "https://example.com/foo",
          "username": "foo.bar",
          "email": "foobar@example.com"
        },
        "headCommitSha": "2957025d42e8daadf937d4044516f991d21deea4",
        "commonAncestorCommitSha": "3357025d42e8daadf937d4044516f991d21deea4",
        "originBranch": "feat-branch",
        "targetBranch": "master",
        "gitHref": "https://github.com/..."
      },
      "newIssues": 1,
      "fixedIssues": 1,
      "deltaComplexity": 1,
      "deltaClonesCount": 1,
      "deltaCoverageWithDecimals": 71,
      "deltaCoverage": 1,
      "diffCoverage": 71,
      "coverage": {
        "deltaCoverage": 71,
        "diffCoverage": {
          "value": 71,
          "coveredLines": 11,
          "coverableLines": 21,
          "cause": "NoCoverableLines"
        },
        "isUpToStandards": true,
        "resultReasons": [
          {
            "gate": "string",
            "expected": -1,
            "expectedThreshold": {
              "threshold": 0,
              "minimumSeverity": "Error"
            },
            "isUpToStandards": true
          }
        ]
      },
      "quality": {
        "newIssues": 1,
        "fixedIssues": 1,
        "deltaComplexity": 1,
        "deltaClonesCount": 1,
        "isUpToStandards": true,
        "resultReasons": [
          {
            "gate": "string",
            "expected": -1,
            "expectedThreshold": {
              "threshold": 0,
              "minimumSeverity": "Error"
            },
            "isUpToStandards": true
          }
        ]
      },
      "meta": {
        "analyzable": true,
        "reason": "string"
      }
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation PullRequestWithAnalysisListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getRepositoryPullRequest

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}

Get pull request from a repository

Note: When applied to public repositories, this operation does not require authentication.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
pullRequestNumber path integer(int32) true Pull request number

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "isUpToStandards": true,
  "isAnalysing": false,
  "pullRequest": {
    "id": 1,
    "number": 1,
    "updated": "2019-05-07T14:29:13.430Z",
    "status": "open",
    "repository": "awesome-repository",
    "title": "Amazing pull request",
    "owner": {
      "name": "Foo",
      "avatarUrl": "https://example.com/foo",
      "username": "foo.bar",
      "email": "foobar@example.com"
    },
    "headCommitSha": "2957025d42e8daadf937d4044516f991d21deea4",
    "commonAncestorCommitSha": "3357025d42e8daadf937d4044516f991d21deea4",
    "originBranch": "feat-branch",
    "targetBranch": "master",
    "gitHref": "https://github.com/..."
  },
  "newIssues": 1,
  "fixedIssues": 1,
  "deltaComplexity": 1,
  "deltaClonesCount": 1,
  "deltaCoverageWithDecimals": 71,
  "deltaCoverage": 1,
  "diffCoverage": 71,
  "coverage": {
    "deltaCoverage": 71,
    "diffCoverage": {
      "value": 71,
      "coveredLines": 11,
      "coverableLines": 21,
      "cause": "NoCoverableLines"
    },
    "isUpToStandards": true,
    "resultReasons": [
      {
        "gate": "string",
        "expected": -1,
        "expectedThreshold": {
          "threshold": 0,
          "minimumSeverity": "Error"
        },
        "isUpToStandards": true
      }
    ]
  },
  "quality": {
    "newIssues": 1,
    "fixedIssues": 1,
    "deltaComplexity": 1,
    "deltaClonesCount": 1,
    "isUpToStandards": true,
    "resultReasons": [
      {
        "gate": "string",
        "expected": -1,
        "expectedThreshold": {
          "threshold": 0,
          "minimumSeverity": "Error"
        },
        "isUpToStandards": true
      }
    ]
  },
  "meta": {
    "analyzable": true,
    "reason": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation PullRequestWithAnalysis
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getPullRequestCommits

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/commits \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/commits HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/commits',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/commits',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/commits',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/commits', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/commits");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/commits", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/commits

Return analysis results for the commits in a pull request

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
pullRequestNumber path integer(int32) true Pull request number
limit query integer(int32) false Maximum number of items to return
cursor query string false Cursor to specify a batch of results to request

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "commit": {
        "sha": "string",
        "id": 1,
        "commitTimestamp": "2019-05-07T14:29:13.430Z",
        "authorName": "string",
        "authorEmail": "string",
        "message": "string",
        "startedAnalysis": "2022-01-07T14:29:13.430Z",
        "endedAnalysis": "2022-01-07T14:29:13.430Z",
        "isMergeCommit": false,
        "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
        "parents": [
          "string"
        ]
      },
      "coverage": {
        "totalCoveragePercentage": 93.23,
        "deltaCoveragePercentage": 15.25,
        "isUpToStandards": true,
        "resultReasons": [
          {
            "gate": "string",
            "expected": -1,
            "expectedThreshold": {
              "threshold": 0,
              "minimumSeverity": "Error"
            },
            "isUpToStandards": true
          }
        ]
      },
      "quality": {
        "newIssues": 1,
        "fixedIssues": 1,
        "deltaComplexity": 1,
        "deltaClonesCount": 1,
        "isUpToStandards": true,
        "resultReasons": [
          {
            "gate": "string",
            "expected": -1,
            "expectedThreshold": {
              "threshold": 0,
              "minimumSeverity": "Error"
            },
            "isUpToStandards": true
          }
        ]
      },
      "meta": {
        "analyzable": true,
        "reason": "string"
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation CommitWithAnalysisListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

bypassPullRequestAnalysis

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/bypass \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/bypass HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/bypass',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/bypass',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/bypass',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/bypass', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/bypass");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/bypass", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/bypass

Bypass analysis status in a pull request

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
pullRequestNumber path integer(int32) true Pull request number

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getPullRequestCoverageReports

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/coverage/status \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/coverage/status HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/coverage/status',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/coverage/status',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/coverage/status',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/coverage/status', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/coverage/status");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/coverage/status", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/coverage/status

List all coverage reports uploaded for the common ancestor commit and head commit of a pull request branch

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
pullRequestNumber path integer(int32) true Pull request number

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "headCommit": {
      "commitId": 1,
      "commitSha": "string",
      "reports": [
        {
          "targetCommitSha": "string",
          "commit": {
            "sha": "string",
            "id": 1,
            "commitTimestamp": "2019-05-07T14:29:13.430Z",
            "authorName": "string",
            "authorEmail": "string",
            "message": "string",
            "startedAnalysis": "2022-01-07T14:29:13.430Z",
            "endedAnalysis": "2022-01-07T14:29:13.430Z",
            "isMergeCommit": false,
            "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
            "parents": [
              "string"
            ],
            "branches": [
              {
                "id": 1,
                "name": "master",
                "isDefault": true,
                "isEnabled": true,
                "lastUpdated": "2019-05-07T14:29:13.430Z",
                "branchType": "Branch",
                "lastCommit": "string"
              }
            ]
          },
          "language": "string",
          "createdAt": "2019-08-24T14:15:22Z",
          "status": "Pending"
        }
      ]
    },
    "commonAncestorCommit": {
      "commitId": 1,
      "commitSha": "string",
      "reports": [
        {
          "targetCommitSha": "string",
          "commit": {
            "sha": "string",
            "id": 1,
            "commitTimestamp": "2019-05-07T14:29:13.430Z",
            "authorName": "string",
            "authorEmail": "string",
            "message": "string",
            "startedAnalysis": "2022-01-07T14:29:13.430Z",
            "endedAnalysis": "2022-01-07T14:29:13.430Z",
            "isMergeCommit": false,
            "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
            "parents": [
              "string"
            ],
            "branches": [
              {
                "id": 1,
                "name": "master",
                "isDefault": true,
                "isEnabled": true,
                "lastUpdated": "2019-05-07T14:29:13.430Z",
                "branchType": "Branch",
                "lastCommit": "string"
              }
            ]
          },
          "language": "string",
          "createdAt": "2019-08-24T14:15:22Z",
          "status": "Pending"
        }
      ]
    },
    "origin": {
      "commitId": 1,
      "commitSha": "string",
      "reports": [
        {
          "targetCommitSha": "string",
          "commit": {
            "sha": "string",
            "id": 1,
            "commitTimestamp": "2019-05-07T14:29:13.430Z",
            "authorName": "string",
            "authorEmail": "string",
            "message": "string",
            "startedAnalysis": "2022-01-07T14:29:13.430Z",
            "endedAnalysis": "2022-01-07T14:29:13.430Z",
            "isMergeCommit": false,
            "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
            "parents": [
              "string"
            ],
            "branches": [
              {
                "id": 1,
                "name": "master",
                "isDefault": true,
                "isEnabled": true,
                "lastUpdated": "2019-05-07T14:29:13.430Z",
                "branchType": "Branch",
                "lastCommit": "string"
              }
            ]
          },
          "language": "string",
          "createdAt": "2019-08-24T14:15:22Z",
          "status": "Pending"
        }
      ]
    },
    "target": {
      "commitId": 1,
      "commitSha": "string",
      "reports": [
        {
          "targetCommitSha": "string",
          "commit": {
            "sha": "string",
            "id": 1,
            "commitTimestamp": "2019-05-07T14:29:13.430Z",
            "authorName": "string",
            "authorEmail": "string",
            "message": "string",
            "startedAnalysis": "2022-01-07T14:29:13.430Z",
            "endedAnalysis": "2022-01-07T14:29:13.430Z",
            "isMergeCommit": false,
            "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
            "parents": [
              "string"
            ],
            "branches": [
              {
                "id": 1,
                "name": "master",
                "isDefault": true,
                "isEnabled": true,
                "lastUpdated": "2019-05-07T14:29:13.430Z",
                "branchType": "Branch",
                "lastCommit": "string"
              }
            ]
          },
          "language": "string",
          "createdAt": "2019-08-24T14:15:22Z",
          "status": "Pending"
        }
      ]
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation CoveragePullRequestResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listPullRequestIssues

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/issues \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/issues HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/issues',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/issues',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/issues',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/issues', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/issues");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/issues", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/issues

List issues found in a pull request

Returns a list of issues found in a pull request. We can request either new or fixed issues.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
pullRequestNumber path integer(int32) true Pull request number
status query string false Issue status
onlyPotential query boolean false If true, retrieves only potential issues
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl
status all
status new
status fixed

Example responses

200 Response

{
  "analyzed": true,
  "data": [
    {
      "commitIssue": {
        "issueId": "string",
        "resultDataId": 0,
        "filePath": "string",
        "fileId": 0,
        "patternInfo": {
          "id": "accessor-pairs",
          "title": "string",
          "category": "Security",
          "subCategory": "XSS",
          "level": "Error",
          "severityLevel": "Error"
        },
        "toolInfo": {
          "uuid": "847feb32-9ff2-11ea-bb37-0242ac130002",
          "name": "ESLint"
        },
        "lineNumber": 0,
        "message": "string",
        "suggestion": "string",
        "language": "string",
        "lineText": "string",
        "commitInfo": {
          "sha": "string",
          "commiter": "string",
          "commiterName": "string",
          "timestamp": "2019-05-07T14:29:13.430Z"
        }
      },
      "deltaType": "Added"
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation PullRequestIssuesResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listPullRequestClones

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/clones \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/clones HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/clones',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/clones',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/clones',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/clones', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/clones");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/clones", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/clones

List duplicate code blocks found in a pull request

Returns a list of new or removed duplicate code blocks found in a pull request.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
pullRequestNumber path integer(int32) true Pull request number
status query string false Issue status
onlyPotential query boolean false If true, retrieves only potential issues
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl
status all
status new
status fixed

Example responses

200 Response

{
  "data": [
    {
      "id": 0,
      "status": "Added",
      "clones": [
        {
          "path": "string",
          "fileId": 0,
          "fileDataId": 0,
          "fromLine": 0,
          "toLine": 0
        }
      ]
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation ClonesResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listCommitClones

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/clones \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/clones HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/clones',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/clones',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/clones',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/clones', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/clones");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/clones", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/clones

List duplicate code blocks found in a commit

Returns a list of new or removed duplicate code blocks found in a commit.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
commitUuid path string true UUID or SHA identifier of the source commit
status query string false Issue status
onlyPotential query boolean false If true, retrieves only potential issues
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl
status all
status new
status fixed

Example responses

200 Response

{
  "data": [
    {
      "id": 0,
      "status": "Added",
      "clones": [
        {
          "path": "string",
          "fileId": 0,
          "fileDataId": 0,
          "fromLine": 0,
          "toLine": 0
        }
      ]
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation ClonesResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listPullRequestLogs

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/logs \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/logs HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/logs',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/logs',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/logs',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/logs', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/logs");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/logs", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/logs

Get analysis logs for a pull request

Returns the analysis logs for the specified pull request.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
pullRequestNumber path integer(int32) true Pull request number

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "headCommitSha": "string",
    "commonAncestorCommitSha": "string",
    "start": "2019-08-24T14:15:22Z",
    "end": "2019-08-24T14:15:22Z",
    "totalAnalysisTime": 0,
    "steps": [
      {
        "title": "string",
        "start": "2019-08-24T14:15:22Z",
        "end": "2019-08-24T14:15:22Z",
        "activeExecutionTime": 0,
        "totalExecutionTime": 0,
        "stackTrace": "string",
        "status": "success"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation LogsResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listCommitLogs

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/logs \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/logs HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/logs',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/logs',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/logs',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/logs', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/logs");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/logs", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/logs

Get analysis logs for a commit

Returns the analysis logs for the specified commit.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
commitUuid path string true UUID or SHA identifier of the source commit

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "headCommitSha": "string",
    "commonAncestorCommitSha": "string",
    "start": "2019-08-24T14:15:22Z",
    "end": "2019-08-24T14:15:22Z",
    "totalAnalysisTime": 0,
    "steps": [
      {
        "title": "string",
        "start": "2019-08-24T14:15:22Z",
        "end": "2019-08-24T14:15:22Z",
        "activeExecutionTime": 0,
        "totalExecutionTime": 0,
        "stackTrace": "string",
        "status": "success"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation LogsResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getRepositoryQualitySettings

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/quality-settings \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/quality-settings HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/quality-settings',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/quality-settings',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/quality-settings',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/quality-settings', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/quality-settings");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/quality-settings", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/quality-settings

[Deprecated: use getQualitySettingsForRepository instead] Get quality settings for the specific repository

Note: When applied to public repositories, this operation does not require authentication.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "issueThreshold": 1,
    "duplicationThreshold": 1,
    "coverageThreshold": 1,
    "complexityThreshold": 1,
    "fileDuplicationThreshold": 1,
    "fileComplexityThreshold": 1
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation DeprecatedRepositoryQualitySettingsResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listCommitFiles

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/files \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/files HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/files',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/files',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/files',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/files', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/files");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/files", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/files

List files of a commit with analysis results

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
commitUuid path string true UUID or SHA string that identifies the commit
branch query string false Name of a repository branch enabled on Codacy,
filter query string false Optional field to filter the results. The possible values are empty (default, return files changed in the commit or with coverage changes) or withCoverageChanges (return files with coverage changes).
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return
search query string false Filter files that include this string anywhere in their relative path
sortColumn query string false Field used to sort the results. The possible values are deltaCoverage (to sort by the coverage variation value of the files) , totalCoverage (to sort by the total coverage value of the files) or filename (to sort by the name of the files).
columnOrder query string false Sort direction. The possible values are asc (ascending) or desc (descending).

Detailed descriptions

branch: Name of a repository branch enabled on Codacy, as returned by the endpoint listRepositoryBranches. By default, uses the main branch defined on the Codacy repository settings.

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl
filter withCoverageChanges
sortColumn totalCoverage
sortColumn deltaCoverage
sortColumn filename
columnOrder asc
columnOrder desc

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "file": {
        "branchId": 1,
        "commitId": 1,
        "commitSha": "string",
        "fileId": 1,
        "fileDataId": 1,
        "path": "/src/test.go",
        "language": "Go",
        "gitProviderUrl": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2"
      },
      "coverage": {
        "deltaCoverage": -2.35,
        "totalCoverage": -2.35
      },
      "quality": {
        "deltaNewIssues": 1,
        "deltaFixedIssues": 1,
        "deltaComplexity": 1,
        "deltaClonesCount": 1
      },
      "comparedWithCommit": {
        "commitId": 1,
        "coverage": {
          "totalCoverage": 82.35
        }
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation FileAnalysisListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listPullRequestFiles

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/files \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/files HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/files',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/files',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/files',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/files', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/files");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/files", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/files

List files of a pull request with analysis results

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
pullRequestNumber path integer(int32) true Pull request number
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return
sortColumn query string false Field used to sort the results. The possible values are deltaCoverage (to sort by the coverage variation value of the files) , totalCoverage (to sort by the total coverage value of the files) or filename (to sort by the name of the files).
columnOrder query string false Sort direction. The possible values are asc (ascending) or desc (descending).

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl
sortColumn totalCoverage
sortColumn deltaCoverage
sortColumn filename
columnOrder asc
columnOrder desc

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "file": {
        "branchId": 1,
        "commitId": 1,
        "commitSha": "string",
        "fileId": 1,
        "fileDataId": 1,
        "path": "/src/test.go",
        "language": "Go",
        "gitProviderUrl": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2"
      },
      "coverage": {
        "deltaCoverage": -2.35,
        "totalCoverage": -2.35
      },
      "quality": {
        "deltaNewIssues": 1,
        "deltaFixedIssues": 1,
        "deltaComplexity": 1,
        "deltaClonesCount": 1
      },
      "comparedWithCommit": {
        "commitId": 1,
        "coverage": {
          "totalCoverage": 82.35
        }
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation FileAnalysisListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listOrganizationPullRequests

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/pull-requests \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/pull-requests HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/pull-requests',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/pull-requests',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/pull-requests',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/pull-requests', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/pull-requests");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/pull-requests", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/pull-requests

List an organization pull requests from repositories that the user as access to

You can search this endpoint for either last-updated (default), impact or merged

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
limit query integer(int32) false Maximum number of items to return
search query string false Filter the results searching by this string.
repositories query string false Deprecated, use SearchOrganizationRepositoriesWithAnalysis instead

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "isUpToStandards": true,
      "isAnalysing": false,
      "pullRequest": {
        "id": 1,
        "number": 1,
        "updated": "2019-05-07T14:29:13.430Z",
        "status": "open",
        "repository": "awesome-repository",
        "title": "Amazing pull request",
        "owner": {
          "name": "Foo",
          "avatarUrl": "https://example.com/foo",
          "username": "foo.bar",
          "email": "foobar@example.com"
        },
        "headCommitSha": "2957025d42e8daadf937d4044516f991d21deea4",
        "commonAncestorCommitSha": "3357025d42e8daadf937d4044516f991d21deea4",
        "originBranch": "feat-branch",
        "targetBranch": "master",
        "gitHref": "https://github.com/..."
      },
      "newIssues": 1,
      "fixedIssues": 1,
      "deltaComplexity": 1,
      "deltaClonesCount": 1,
      "deltaCoverageWithDecimals": 71,
      "deltaCoverage": 1,
      "diffCoverage": 71,
      "coverage": {
        "deltaCoverage": 71,
        "diffCoverage": {
          "value": 71,
          "coveredLines": 11,
          "coverableLines": 21,
          "cause": "NoCoverableLines"
        },
        "isUpToStandards": true,
        "resultReasons": [
          {
            "gate": "string",
            "expected": -1,
            "expectedThreshold": {
              "threshold": 0,
              "minimumSeverity": "Error"
            },
            "isUpToStandards": true
          }
        ]
      },
      "quality": {
        "newIssues": 1,
        "fixedIssues": 1,
        "deltaComplexity": 1,
        "deltaClonesCount": 1,
        "isUpToStandards": true,
        "resultReasons": [
          {
            "gate": "string",
            "expected": -1,
            "expectedThreshold": {
              "threshold": 0,
              "minimumSeverity": "Error"
            },
            "isUpToStandards": true
          }
        ]
      },
      "meta": {
        "analyzable": true,
        "reason": "string"
      }
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation PullRequestWithAnalysisListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listCommitAnalysisStats

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commit-statistics \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commit-statistics HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commit-statistics',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commit-statistics',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commit-statistics',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commit-statistics', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commit-statistics");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commit-statistics", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commit-statistics

Lists commit analysis statistics in the last n days that have analysis data

Returns the last n days with available data. This means that the returned days may not match the last n calendar days.

Note: When applied to public repositories, this operation does not require authentication.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
branch query string false Name of a repository branch enabled on Codacy,
days query integer(int32) false Number of days with data to return.

Detailed descriptions

branch: Name of a repository branch enabled on Codacy, as returned by the endpoint listRepositoryBranches. By default, uses the main branch defined on the Codacy repository settings.

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "repositoryId": 1,
      "commitId": 1,
      "numberIssues": 1,
      "numberLoc": 1,
      "issuesPerCategory": [
        {
          "categoryId": 1,
          "numberOfIssues": 100
        }
      ],
      "issuePercentage": 1,
      "totalComplexity": 1,
      "numberComplexFiles": 1,
      "complexFilesPercentage": 1,
      "filesChangedToIncreaseComplexity": 1,
      "numberDuplicatedLines": 1,
      "duplicationPercentage": 1,
      "coveragePercentage": 1,
      "coveragePercentageWithDecimals": 15.25,
      "numberFilesUncovered": 1,
      "techDebt": 1,
      "totalFilesAdded": 1,
      "totalFilesRemoved": 1,
      "totalFilesChanged": 1,
      "commitTimestamp": "2019-05-07T14:29:13.430Z",
      "commitAuthorName": "Mike The Developer",
      "commitShortUUID": "00d3079ed"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation CommitAnalysisStatsListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listCategoryOverviews

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/category-overviews \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/category-overviews HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/category-overviews',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/category-overviews',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/category-overviews',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/category-overviews', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/category-overviews");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/category-overviews", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/category-overviews

Lists analysis category overviews for a repository that the user as access to

Note: When applied to public repositories, this operation does not require authentication.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
branch query string false Name of a repository branch enabled on Codacy,

Detailed descriptions

branch: Name of a repository branch enabled on Codacy, as returned by the endpoint listRepositoryBranches. By default, uses the main branch defined on the Codacy repository settings.

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "commitId": 1,
      "category": {
        "categoryType": "string",
        "name": "string",
        "description": "string"
      },
      "percentage": 1.6,
      "totalResults": 1
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation CategoryOverviewListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getIssue

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/{resultDataId} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/{resultDataId} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/{resultDataId}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/{resultDataId}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/{resultDataId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/{resultDataId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/{resultDataId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/{resultDataId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/{resultDataId}

Returns information about an issue that Codacy found in a repository and that is still open.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
resultDataId path integer(int64) true Identifier of an open issue.

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "issueId": "string",
    "resultDataId": 0,
    "filePath": "string",
    "fileId": 0,
    "patternInfo": {
      "id": "accessor-pairs",
      "title": "string",
      "category": "Security",
      "subCategory": "XSS",
      "level": "Error",
      "severityLevel": "Error"
    },
    "toolInfo": {
      "uuid": "847feb32-9ff2-11ea-bb37-0242ac130002",
      "name": "ESLint"
    },
    "lineNumber": 0,
    "message": "string",
    "suggestion": "string",
    "language": "string",
    "lineText": "string",
    "commitInfo": {
      "sha": "string",
      "commiter": "string",
      "commiterName": "string",
      "timestamp": "2019-05-07T14:29:13.430Z"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK An issue found in a repository. GetIssueResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

searchRepositoryIssues

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/search \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/search HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/search',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "branchName": "a-feature-branch-name",
  "patternIds": [
    "ESLint_@typescript-eslint_consistent-indexed-object-style",
    "ESLint_@typescript-eslint_no-redeclare"
  ],
  "languages": [
    "Java",
    "Scala",
    "CSS",
    "ObjectiveC"
  ],
  "categories": [
    "Security",
    "CodeStyle"
  ],
  "levels": [
    "Error",
    "Warning"
  ],
  "authorEmails": [
    "example@mail.com",
    "another@mail.com"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/search',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/search',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/search', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/search");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/search", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/search

List issues in a repository

Returns information about the issues that Codacy found in a repository as available on the Issues page. Use SearchRepositoryIssuesBody to filter the returned issues.

Body parameter

{
  "branchName": "a-feature-branch-name",
  "patternIds": [
    "ESLint_@typescript-eslint_consistent-indexed-object-style",
    "ESLint_@typescript-eslint_no-redeclare"
  ],
  "languages": [
    "Java",
    "Scala",
    "CSS",
    "ObjectiveC"
  ],
  "categories": [
    "Security",
    "CodeStyle"
  ],
  "levels": [
    "Error",
    "Warning"
  ],
  "authorEmails": [
    "example@mail.com",
    "another@mail.com"
  ]
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return
body body SearchRepositoryIssuesBody false Only return issues matching these filters

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "issueId": "string",
      "resultDataId": 0,
      "filePath": "string",
      "fileId": 0,
      "patternInfo": {
        "id": "accessor-pairs",
        "title": "string",
        "category": "Security",
        "subCategory": "XSS",
        "level": "Error",
        "severityLevel": "Error"
      },
      "toolInfo": {
        "uuid": "847feb32-9ff2-11ea-bb37-0242ac130002",
        "name": "ESLint"
      },
      "lineNumber": 0,
      "message": "string",
      "suggestion": "string",
      "language": "string",
      "lineText": "string",
      "commitInfo": {
        "sha": "string",
        "commiter": "string",
        "commiterName": "string",
        "timestamp": "2019-05-07T14:29:13.430Z"
      }
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Responses

Status Meaning Description Schema
200 OK List of issues in the repository SearchRepositoryIssuesListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

issuesOverview

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/overview \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/overview HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/overview',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "branchName": "a-feature-branch-name",
  "patternIds": [
    "ESLint_@typescript-eslint_consistent-indexed-object-style",
    "ESLint_@typescript-eslint_no-redeclare"
  ],
  "languages": [
    "Java",
    "Scala",
    "CSS",
    "ObjectiveC"
  ],
  "categories": [
    "Security",
    "CodeStyle"
  ],
  "levels": [
    "Error",
    "Warning"
  ],
  "authorEmails": [
    "example@mail.com",
    "another@mail.com"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/overview',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/overview',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/overview', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/overview");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/overview", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/overview

Get an overview of the issues in a repository

Returns information about the number of issues that Codacy found in a repository as available on the Issues page. Use SearchRepositoryIssuesBody to filter the returned issues.

Body parameter

{
  "branchName": "a-feature-branch-name",
  "patternIds": [
    "ESLint_@typescript-eslint_consistent-indexed-object-style",
    "ESLint_@typescript-eslint_no-redeclare"
  ],
  "languages": [
    "Java",
    "Scala",
    "CSS",
    "ObjectiveC"
  ],
  "categories": [
    "Security",
    "CodeStyle"
  ],
  "levels": [
    "Error",
    "Warning"
  ],
  "authorEmails": [
    "example@mail.com",
    "another@mail.com"
  ]
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
body body SearchRepositoryIssuesBody false Only return issues matching these filters

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "counts": {
      "categories": [
        {
          "name": "string",
          "total": 0
        }
      ],
      "languages": [
        {
          "name": "string",
          "total": 0
        }
      ],
      "levels": [
        {
          "name": "string",
          "total": 0
        }
      ],
      "patterns": [
        {
          "id": "string",
          "title": "string",
          "total": 0
        }
      ],
      "authors": [
        {
          "name": "string",
          "total": 0
        }
      ]
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Overview of the issues in the repository IssuesOverviewResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

updateIssueState

Code samples

# You can also use wget
curl -X PATCH https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/{issueId} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

PATCH https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/{issueId} HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/{issueId}',
  method: 'patch',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "ignored": true
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/{issueId}',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.patch 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/{issueId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.patch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/{issueId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/{issueId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/{issueId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/{issueId}

Ignore or unignore an issue

Body parameter

{
  "ignored": true
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
issueId path string true Issue identifier
body body IssueStateBody true New ignored status of the issue

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

searchRepositoryIgnoredIssues

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/ignoredIssues/search \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/ignoredIssues/search HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/ignoredIssues/search',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "branchName": "a-feature-branch-name",
  "patternIds": [
    "ESLint_@typescript-eslint_consistent-indexed-object-style",
    "ESLint_@typescript-eslint_no-redeclare"
  ],
  "languages": [
    "Java",
    "Scala",
    "CSS",
    "ObjectiveC"
  ],
  "categories": [
    "Security",
    "CodeStyle"
  ],
  "levels": [
    "Error",
    "Warning"
  ],
  "authorEmails": [
    "example@mail.com",
    "another@mail.com"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/ignoredIssues/search',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/ignoredIssues/search',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/ignoredIssues/search', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/ignoredIssues/search");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/ignoredIssues/search", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/ignoredIssues/search

List ignored issues in a repository

Returns information about the issues that Codacy found in a repository and were ignored on the Codacy UI. Use SearchRepositoryIssuesBody to filter the returned ignored issues.

Body parameter

{
  "branchName": "a-feature-branch-name",
  "patternIds": [
    "ESLint_@typescript-eslint_consistent-indexed-object-style",
    "ESLint_@typescript-eslint_no-redeclare"
  ],
  "languages": [
    "Java",
    "Scala",
    "CSS",
    "ObjectiveC"
  ],
  "categories": [
    "Security",
    "CodeStyle"
  ],
  "levels": [
    "Error",
    "Warning"
  ],
  "authorEmails": [
    "example@mail.com",
    "another@mail.com"
  ]
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return
body body SearchRepositoryIssuesBody false Only return issues matching these filters

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "issueId": "string",
      "filePath": "string",
      "fileId": 0,
      "patternInfo": {
        "id": "accessor-pairs",
        "title": "string",
        "category": "Security",
        "subCategory": "XSS",
        "level": "Error",
        "severityLevel": "Error"
      },
      "toolInfo": {
        "uuid": "847feb32-9ff2-11ea-bb37-0242ac130002",
        "name": "ESLint"
      },
      "lineNumber": 0,
      "message": "string",
      "language": "string",
      "lineText": "string",
      "commitInfo": {
        "sha": "string",
        "commiter": "string",
        "commiterName": "string",
        "timestamp": "2019-05-07T14:29:13.430Z"
      }
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Responses

Status Meaning Description Schema
200 OK List of ignored issues in the repository IgnoredIssuesListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listRepositoryCommits

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits

Return analysis results for the commits in a branch

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
branch query string false Name of a repository branch enabled on Codacy,
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return

Detailed descriptions

branch: Name of a repository branch enabled on Codacy, as returned by the endpoint listRepositoryBranches. By default, uses the main branch defined on the Codacy repository settings.

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "commit": {
        "sha": "string",
        "id": 1,
        "commitTimestamp": "2019-05-07T14:29:13.430Z",
        "authorName": "string",
        "authorEmail": "string",
        "message": "string",
        "startedAnalysis": "2022-01-07T14:29:13.430Z",
        "endedAnalysis": "2022-01-07T14:29:13.430Z",
        "isMergeCommit": false,
        "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
        "parents": [
          "string"
        ]
      },
      "coverage": {
        "totalCoveragePercentage": 93.23,
        "deltaCoveragePercentage": 15.25,
        "isUpToStandards": true,
        "resultReasons": [
          {
            "gate": "string",
            "expected": -1,
            "expectedThreshold": {
              "threshold": 0,
              "minimumSeverity": "Error"
            },
            "isUpToStandards": true
          }
        ]
      },
      "quality": {
        "newIssues": 1,
        "fixedIssues": 1,
        "deltaComplexity": 1,
        "deltaClonesCount": 1,
        "isUpToStandards": true,
        "resultReasons": [
          {
            "gate": "string",
            "expected": -1,
            "expectedThreshold": {
              "threshold": 0,
              "minimumSeverity": "Error"
            },
            "isUpToStandards": true
          }
        ]
      },
      "meta": {
        "analyzable": true,
        "reason": "string"
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK List of commits with analysis results CommitWithAnalysisListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getCommit

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}

Get analysis results for a commit

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
commitUuid path string true UUID or SHA string that identifies the commit

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "commit": {
    "sha": "string",
    "id": 1,
    "commitTimestamp": "2019-05-07T14:29:13.430Z",
    "authorName": "string",
    "authorEmail": "string",
    "message": "string",
    "startedAnalysis": "2022-01-07T14:29:13.430Z",
    "endedAnalysis": "2022-01-07T14:29:13.430Z",
    "isMergeCommit": false,
    "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
    "parents": [
      "string"
    ]
  },
  "coverage": {
    "totalCoveragePercentage": 93.23,
    "deltaCoveragePercentage": 15.25,
    "isUpToStandards": true,
    "resultReasons": [
      {
        "gate": "string",
        "expected": -1,
        "expectedThreshold": {
          "threshold": 0,
          "minimumSeverity": "Error"
        },
        "isUpToStandards": true
      }
    ]
  },
  "quality": {
    "newIssues": 1,
    "fixedIssues": 1,
    "deltaComplexity": 1,
    "deltaClonesCount": 1,
    "isUpToStandards": true,
    "resultReasons": [
      {
        "gate": "string",
        "expected": -1,
        "expectedThreshold": {
          "threshold": 0,
          "minimumSeverity": "Error"
        },
        "isUpToStandards": true
      }
    ]
  },
  "meta": {
    "analyzable": true,
    "reason": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation CommitWithAnalysis
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getCommitDeltaStatistics

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/deltaStatistics \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/deltaStatistics HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/deltaStatistics',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/deltaStatistics',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/deltaStatistics',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/deltaStatistics', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/deltaStatistics");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/deltaStatistics", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/deltaStatistics

Get analysis statistics of a commit

Returns the quality metric deltas introduced by a commit. The values of the metrics are 0 or null if Codacy didn't analyze the commit yet. To obtain the full analysis statistics for the repository use the endpoint getRepositoryWithAnalysis.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
commitUuid path string true UUID or SHA string that identifies the commit

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "commitUuid": "string",
  "newIssues": 0,
  "fixedIssues": 0,
  "deltaComplexity": 0,
  "deltaCoverage": 0,
  "deltaCoverageWithDecimals": 71,
  "deltaClonesCount": 0,
  "analyzed": true
}

Responses

Status Meaning Description Schema
200 OK Succesful operation CommitDeltaStatistics
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listCommitDeltaIssues

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{srcCommitUuid}/deltaIssues \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{srcCommitUuid}/deltaIssues HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{srcCommitUuid}/deltaIssues',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{srcCommitUuid}/deltaIssues',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{srcCommitUuid}/deltaIssues',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{srcCommitUuid}/deltaIssues', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{srcCommitUuid}/deltaIssues");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{srcCommitUuid}/deltaIssues", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{srcCommitUuid}/deltaIssues

List the issues introduced or fixed by a commit

Returns a list of issues introduced or fixed given a source commit SHA. By default, Codacy will calculate the issues by creating a delta between the source commit and its parent commit. As an alternative, you can also provide a destination commit to calculate the deltas. To list all issues in the repository, use searchRepositoryIssues.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
srcCommitUuid path string true UUID or SHA string that identifies the source commit
targetCommitUuid query string false UUID or SHA string that identifies the target commit
status query string false Issue status
onlyPotential query boolean false If true, retrieves only potential issues
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl
status all
status new
status fixed

Example responses

200 Response

{
  "analyzed": true,
  "data": [
    {
      "commitIssue": {
        "issueId": "string",
        "resultDataId": 0,
        "filePath": "string",
        "fileId": 0,
        "patternInfo": {
          "id": "accessor-pairs",
          "title": "string",
          "category": "Security",
          "subCategory": "XSS",
          "level": "Error",
          "severityLevel": "Error"
        },
        "toolInfo": {
          "uuid": "847feb32-9ff2-11ea-bb37-0242ac130002",
          "name": "ESLint"
        },
        "lineNumber": 0,
        "message": "string",
        "suggestion": "string",
        "language": "string",
        "lineText": "string",
        "commitInfo": {
          "sha": "string",
          "commiter": "string",
          "commiterName": "string",
          "timestamp": "2019-05-07T14:29:13.430Z"
        }
      },
      "deltaType": "Added"
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation CommitDeltaIssuesResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getCommitDetails

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/commit/{commitId} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/commit/{commitId} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/commit/{commitId}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/commit/{commitId}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/commit/{commitId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/commit/{commitId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/commit/{commitId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/commit/{commitId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/commit/{commitId}

Get information about a commit

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
commitId path integer(int64) true Identifier of the commit

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "commit": {
    "sha": "string",
    "id": 1,
    "commitTimestamp": "2019-05-07T14:29:13.430Z",
    "authorName": "string",
    "authorEmail": "string",
    "message": "string",
    "startedAnalysis": "2022-01-07T14:29:13.430Z",
    "endedAnalysis": "2022-01-07T14:29:13.430Z",
    "isMergeCommit": false,
    "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
    "parents": [
      "string"
    ]
  },
  "repository": {
    "repositoryId": 0,
    "name": "codacy-eslint"
  }
}

Responses

Status Meaning Description Schema
200 OK Details about the commit. CommitDetails
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

repository

followAddedRepository

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/follow \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/follow HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/follow',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/follow',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/follow',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/follow', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/follow");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/follow", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/follow

Follow a repository that was already added to Codacy

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": "Added"
}

Responses

Status Meaning Description Schema
200 OK Successful operation AddedStateResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

unfollowRepository

Code samples

# You can also use wget
curl -X DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/follow \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/follow HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/follow',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/follow',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.delete 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/follow',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.delete('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/follow', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/follow");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/follow", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/follow

unfollow a repository

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getQualitySettingsForRepository

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository

Get quality settings for the specific repository

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "maxIssuePercentage": 1,
    "maxDuplicatedFilesPercentage": 1,
    "minCoveragePercentage": 1,
    "maxComplexFilesPercentage": 1,
    "fileDuplicationBlockThreshold": 1,
    "fileComplexityValueThreshold": 1
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation RepositoryQualitySettingsResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

updateRepositoryQualitySettings

Code samples

# You can also use wget
curl -X PUT https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

PUT https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "maxIssuePercentage": 1,
  "maxDuplicatedFilesPercentage": 1,
  "minCoveragePercentage": 1,
  "maxComplexFilesPercentage": 1,
  "fileDuplicationBlockThreshold": 1,
  "fileComplexityValueThreshold": 1
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.put 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.put('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PUT /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository

Update quality settings for the specific repository

Body parameter

{
  "maxIssuePercentage": 1,
  "maxDuplicatedFilesPercentage": 1,
  "minCoveragePercentage": 1,
  "maxComplexFilesPercentage": 1,
  "fileDuplicationBlockThreshold": 1,
  "fileComplexityValueThreshold": 1
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
body body RepositoryQualitySettings true The new value for the quality settings of the repository

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "maxIssuePercentage": 1,
    "maxDuplicatedFilesPercentage": 1,
    "minCoveragePercentage": 1,
    "maxComplexFilesPercentage": 1,
    "fileDuplicationBlockThreshold": 1,
    "fileComplexityValueThreshold": 1
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation RepositoryQualitySettingsResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

regenerateUserSshKey

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/ssh-user-key \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/ssh-user-key HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/ssh-user-key',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/ssh-user-key',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/ssh-user-key',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/ssh-user-key', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/ssh-user-key");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/ssh-user-key", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/ssh-user-key

Regenerate the user SSH key that Codacy uses to clone the repository

Codacy automatically adds the new public user SSH key to the user account on the Git provider. Using a user SSH key is recommended if your repository includes submodules.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "publicSshKey": "string"
}

Responses

Status Meaning Description Schema
200 OK Successful operation SshKeySettingResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

regenerateRepositorySshKey

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/ssh-repository-key \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/ssh-repository-key HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/ssh-repository-key',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/ssh-repository-key',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/ssh-repository-key',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/ssh-repository-key', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/ssh-repository-key");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/ssh-repository-key", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/ssh-repository-key

Regenerate the SSH key that Codacy uses to clone the repository

Codacy automatically adds the new public SSH key to the repository on the Git provider.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "publicSshKey": "string"
}

Responses

Status Meaning Description Schema
200 OK Successful operation SshKeySettingResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getRepositoryPublicSshKey

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/stored-ssh-key \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/stored-ssh-key HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/stored-ssh-key',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/stored-ssh-key',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/stored-ssh-key',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/stored-ssh-key', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/stored-ssh-key");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/stored-ssh-key", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/stored-ssh-key

Get the public SSH key for the repository

Returns the most recently generated public SSH key, which can be either a user or repository SSH key.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "publicSshKey": "string"
}

Responses

Status Meaning Description Schema
200 OK Successful operation SshKeySettingResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

syncRepositoryWithProvider

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/sync \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/sync HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/sync',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/sync',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/sync',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/sync', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/sync");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/sync", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/sync

Synchronize project name and visibility with Git provider

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "name": "codacy-eslint",
  "visibility": "Private"
}

Responses

Status Meaning Description Schema
200 OK Successful operation SyncProviderSettingResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getBuildServerAnalysisSetting

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/analysis \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/analysis HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/analysis',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/analysis',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/analysis',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/analysis', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/analysis");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/analysis", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/analysis

Get the status of the repository setting Run analysis on your build server

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "buildServerAnalysisSetting": true
}

Responses

Status Meaning Description Schema
200 OK Successful operation BuildServerAnalysisSettingResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
405 Method Not Allowed Method Not Allowed MethodNotAllowed
500 Internal Server Error Internal Server Error InternalServerError

updateBuildServerAnalysisSetting

Code samples

# You can also use wget
curl -X PATCH https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/analysis \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

PATCH https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/analysis HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/analysis',
  method: 'patch',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "buildServerAnalysisSetting": true
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/analysis',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.patch 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/analysis',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.patch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/analysis', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/analysis");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/analysis", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/analysis

Updates the status of the repository setting Run analysis on your build server

Body parameter

{
  "buildServerAnalysisSetting": true
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
body body BuildServerAnalysisSettingRequest true New value for the repository setting Run analysis on your build server

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "buildServerAnalysisSetting": true
}

Responses

Status Meaning Description Schema
200 OK Successful operation BuildServerAnalysisSettingResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
405 Method Not Allowed Method Not Allowed MethodNotAllowed
500 Internal Server Error Internal Server Error InternalServerError

getCommitQualitySettings

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits

Get quality settings for the commits of a repository.

diffCoverageThreshold is never returned because this threshold isn't currently supported for commits.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "qualityGate": {
      "issueThreshold": {
        "threshold": 1,
        "minimumSeverity": "Error"
      },
      "securityIssueThreshold": 1,
      "duplicationThreshold": 1,
      "coverageThreshold": 1,
      "coverageThresholdWithDecimals": -0.02,
      "diffCoverageThreshold": 70,
      "complexityThreshold": 1
    },
    "repositoryGatePolicyInfo": {
      "id": 0,
      "name": "string"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation QualitySettingsResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

updateCommitQualitySettings

Code samples

# You can also use wget
curl -X PUT https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

PUT https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "issueThreshold": {
    "threshold": 1,
    "minimumSeverity": "Error"
  },
  "securityIssueThreshold": 1,
  "duplicationThreshold": 1,
  "coverageThreshold": 1,
  "coverageThresholdWithDecimals": -0.02,
  "diffCoverageThreshold": 70,
  "complexityThreshold": 1
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.put 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.put('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PUT /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits

Update quality settings for the commits of a repository

Body parameter

{
  "issueThreshold": {
    "threshold": 1,
    "minimumSeverity": "Error"
  },
  "securityIssueThreshold": 1,
  "duplicationThreshold": 1,
  "coverageThreshold": 1,
  "coverageThresholdWithDecimals": -0.02,
  "diffCoverageThreshold": 70,
  "complexityThreshold": 1
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
body body QualityGate true The new value for the quality settings of commits in a repository

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "qualityGate": {
      "issueThreshold": {
        "threshold": 1,
        "minimumSeverity": "Error"
      },
      "securityIssueThreshold": 1,
      "duplicationThreshold": 1,
      "coverageThreshold": 1,
      "coverageThresholdWithDecimals": -0.02,
      "diffCoverageThreshold": 70,
      "complexityThreshold": 1
    },
    "repositoryGatePolicyInfo": {
      "id": 0,
      "name": "string"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation QualitySettingsResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

resetCommitsQualitySettings

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits/reset \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits/reset HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits/reset',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits/reset',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits/reset',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits/reset', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits/reset");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits/reset", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/commits/reset

Reset quality settings for the commits of a repository to Codacy’s default values

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "qualityGate": {
      "issueThreshold": {
        "threshold": 1,
        "minimumSeverity": "Error"
      },
      "securityIssueThreshold": 1,
      "duplicationThreshold": 1,
      "coverageThreshold": 1,
      "coverageThresholdWithDecimals": -0.02,
      "diffCoverageThreshold": 70,
      "complexityThreshold": 1
    },
    "repositoryGatePolicyInfo": {
      "id": 0,
      "name": "string"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation QualitySettingsResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

resetPullRequestsQualitySettings

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests/reset \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests/reset HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests/reset',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests/reset',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests/reset',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests/reset', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests/reset");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests/reset", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests/reset

Reset quality settings for the pull requests of a repository to Codacy’s default values

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "qualityGate": {
      "issueThreshold": {
        "threshold": 1,
        "minimumSeverity": "Error"
      },
      "securityIssueThreshold": 1,
      "duplicationThreshold": 1,
      "coverageThreshold": 1,
      "coverageThresholdWithDecimals": -0.02,
      "diffCoverageThreshold": 70,
      "complexityThreshold": 1
    },
    "repositoryGatePolicyInfo": {
      "id": 0,
      "name": "string"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation QualitySettingsResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

resetRepositoryQualitySettings

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository/reset \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository/reset HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository/reset',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository/reset',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository/reset',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository/reset', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository/reset");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository/reset", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/repository/reset

Reset quality settings for the repository to Codacy’s default values

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "maxIssuePercentage": 1,
    "maxDuplicatedFilesPercentage": 1,
    "minCoveragePercentage": 1,
    "maxComplexFilesPercentage": 1,
    "fileDuplicationBlockThreshold": 1,
    "fileComplexityValueThreshold": 1
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation RepositoryQualitySettingsResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getPullRequestQualitySettings

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests

Get quality settings for the pull requests of a repository

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "qualityGate": {
      "issueThreshold": {
        "threshold": 1,
        "minimumSeverity": "Error"
      },
      "securityIssueThreshold": 1,
      "duplicationThreshold": 1,
      "coverageThreshold": 1,
      "coverageThresholdWithDecimals": -0.02,
      "diffCoverageThreshold": 70,
      "complexityThreshold": 1
    },
    "repositoryGatePolicyInfo": {
      "id": 0,
      "name": "string"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation QualitySettingsResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

updatePullRequestQualitySettings

Code samples

# You can also use wget
curl -X PUT https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

PUT https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "issueThreshold": {
    "threshold": 1,
    "minimumSeverity": "Error"
  },
  "securityIssueThreshold": 1,
  "duplicationThreshold": 1,
  "coverageThreshold": 1,
  "coverageThresholdWithDecimals": -0.02,
  "diffCoverageThreshold": 70,
  "complexityThreshold": 1
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.put 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.put('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PUT /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/quality/pull-requests

Update quality settings for the pull requests of a repository

Body parameter

{
  "issueThreshold": {
    "threshold": 1,
    "minimumSeverity": "Error"
  },
  "securityIssueThreshold": 1,
  "duplicationThreshold": 1,
  "coverageThreshold": 1,
  "coverageThresholdWithDecimals": -0.02,
  "diffCoverageThreshold": 70,
  "complexityThreshold": 1
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
body body QualityGate true The new value for the quality settings of pull requests in the repository

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "qualityGate": {
      "issueThreshold": {
        "threshold": 1,
        "minimumSeverity": "Error"
      },
      "securityIssueThreshold": 1,
      "duplicationThreshold": 1,
      "coverageThreshold": 1,
      "coverageThresholdWithDecimals": -0.02,
      "diffCoverageThreshold": 70,
      "complexityThreshold": 1
    },
    "repositoryGatePolicyInfo": {
      "id": 0,
      "name": "string"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation QualitySettingsResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getRepositoryIntegrationsSettings

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/providerSettings \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/providerSettings HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/providerSettings',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/providerSettings',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/providerSettings',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/providerSettings', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/providerSettings");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/providerSettings", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/providerSettings

Get Git provider integration settings for a repository

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "settings": {
    "commitStatus": true,
    "pullRequestComment": true,
    "pullRequestSummary": true,
    "coverageSummary": true,
    "suggestions": true,
    "aiEnhancedComments": true
  },
  "integratedBy": "example@codacy.com"
}

Responses

Status Meaning Description Schema
200 OK Successful operation RepositoryIntegrationSettings
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError
502 Bad Gateway Bad Gateway BadGateway

updateRepositoryIntegrationsSettings

Code samples

# You can also use wget
curl -X PATCH https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/providerSettings \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

PATCH https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/providerSettings HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/providerSettings',
  method: 'patch',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "commitStatus": true,
  "pullRequestComment": true,
  "pullRequestSummary": true,
  "coverageSummary": true,
  "suggestions": true,
  "aiEnhancedComments": true
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/providerSettings',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.patch 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/providerSettings',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.patch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/providerSettings', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/providerSettings");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/providerSettings", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/providerSettings

Update Git provider integration settings for a repository

Body parameter

{
  "commitStatus": true,
  "pullRequestComment": true,
  "pullRequestSummary": true,
  "coverageSummary": true,
  "suggestions": true,
  "aiEnhancedComments": true
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
body body ProviderIntegrationSettingsPatchBody true none

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError
502 Bad Gateway Bad Gateway BadGateway

createPostCommitHook

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/postCommitHook \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/postCommitHook HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/postCommitHook',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/postCommitHook',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/postCommitHook',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/postCommitHook', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/postCommitHook");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/postCommitHook", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/integrations/postCommitHook

Creates a post-commit hook for a repository

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error An unexpected error occurred while creating the post-commit hook InternalServerError

reanalyzeCommitById

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/reanalyzeCommit \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/reanalyzeCommit HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/reanalyzeCommit',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "commitUuid": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/reanalyzeCommit',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/reanalyzeCommit',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/reanalyzeCommit', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/reanalyzeCommit");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/reanalyzeCommit", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/reanalyzeCommit

Reanalyze a specific commit in a repository

Body parameter

{
  "commitUuid": "string"
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
body body CommitUuidRequest true UUID or SHA string that identifies the commit

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getRepository

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}

Fetch the specified repository

Note: When applied to public repositories, this operation does not require authentication.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "repositoryId": 45738,
    "provider": "gh",
    "owner": "codacy",
    "name": "codacy-eslint",
    "fullPath": "codacy/codacy-eslint",
    "visibility": "Private",
    "remoteIdentifier": "3",
    "lastUpdated": "2019-05-07T14:29:13.430Z",
    "permission": "admin",
    "problems": [
      {
        "message": "We can't analyze this repository because none of the committers are part of the organization.",
        "actions": [
          {
            "name": "Check our documentation",
            "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
          }
        ],
        "code": "failed_to_clone",
        "severity": "all_analysis"
      }
    ],
    "languages": [
      "Java",
      "Scala",
      "CSS"
    ],
    "defaultBranch": {
      "id": 1,
      "name": "master",
      "isDefault": true,
      "isEnabled": true,
      "lastUpdated": "2019-05-07T14:29:13.430Z",
      "branchType": "Branch",
      "lastCommit": "string"
    },
    "badges": {
      "grade": "https://app.codacy.com/project/badge/Grade/d992a862b1994805907ec277e16b0fda",
      "coverage": "https://app.codacy.com/project/badge/Coverage/d992a862b1994805907ec277e16b0fda"
    },
    "codingStandardId": 0,
    "codingStandardName": "string",
    "addedState": "Added",
    "gatePolicyId": 0,
    "gatePolicyName": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation RepositoryResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

deleteRepository

Code samples

# You can also use wget
curl -X DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.delete 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.delete('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}

Delete the specified repository

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listRepositoryBranches

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches

List repository branches

Note: When applied to public repositories, this operation does not require authentication.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
enabled query boolean false Returns only the enabled or disabled branches.
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return
search query string false Filter the results searching by this string.
sort query string false Field used to sort the list of branches. The allowed values are 'name' and 'last-updated'.
direction query string false Sort direction. Possible values are 'asc' (ascending) or 'desc' (descending).

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "id": 1,
      "name": "master",
      "isDefault": true,
      "isEnabled": true,
      "lastUpdated": "2019-05-07T14:29:13.430Z",
      "branchType": "Branch",
      "lastCommit": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation BranchListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

updateRepositoryBranchConfiguration

Code samples

# You can also use wget
curl -X PATCH https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches/{branchName} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

PATCH https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches/{branchName} HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches/{branchName}',
  method: 'patch',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "isEnabled": true
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches/{branchName}',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.patch 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches/{branchName}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.patch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches/{branchName}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches/{branchName}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches/{branchName}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches/{branchName}

Update the settings for a repository branch

Toggle analysis for a branch.

Body parameter

{
  "isEnabled": true
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
branchName path string true Repository branch name
body body UpdateRepositoryBranchConfigurationBody true none

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

setRepositoryBranchAsDefault

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches/{branchName}/setDefault \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches/{branchName}/setDefault HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches/{branchName}/setDefault',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches/{branchName}/setDefault',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches/{branchName}/setDefault',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches/{branchName}/setDefault', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches/{branchName}/setDefault");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches/{branchName}/setDefault", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/branches/{branchName}/setDefault

Set branch as default

Sets the default branch for a repository. The new default branch must already be enabled on Codacy.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
branchName path string true Repository branch name

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

createBadgePullRequest

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/gh/{remoteOrganizationName}/repositories/{repositoryName}/badge \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/gh/{remoteOrganizationName}/repositories/{repositoryName}/badge HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/gh/{remoteOrganizationName}/repositories/{repositoryName}/badge',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/gh/{remoteOrganizationName}/repositories/{repositoryName}/badge',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/gh/{remoteOrganizationName}/repositories/{repositoryName}/badge',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/gh/{remoteOrganizationName}/repositories/{repositoryName}/badge', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/gh/{remoteOrganizationName}/repositories/{repositoryName}/badge");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/gh/{remoteOrganizationName}/repositories/{repositoryName}/badge", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/gh/{remoteOrganizationName}/repositories/{repositoryName}/badge

Create a pull request adding the Codacy analysis badge to the repository

Creates a pull request adding the Codacy static code analysis badge to the README of the GitHub repository if the repository is public and doesn't already have a badge.

Note: The pull request is created asynchronously and may fail even if this endpoint responds successfully.

Parameters

Name In Type Required Description
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

addRepository

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/repositories \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'caller: string' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/repositories HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json
caller: string

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'caller':'string',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/repositories',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "repositoryFullPath": "codacy/codacy-analysis-cli",
  "provider": "gh"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'caller':'string',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/repositories',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'caller' => 'string',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/repositories',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'caller': 'string',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/repositories', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/repositories");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "caller": []string{"string"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/repositories", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /repositories

Add a repository to Codacy

Add a new repository to an existing organization on Codacy

Body parameter

{
  "repositoryFullPath": "codacy/codacy-analysis-cli",
  "provider": "gh"
}

Parameters

Name In Type Required Description
caller header string false Caller
body body AddRepositoryBody true Information of repository to add

Example responses

200 Response

{
  "repositoryId": 45738,
  "provider": "gh",
  "owner": "codacy",
  "name": "codacy-eslint",
  "fullPath": "codacy/codacy-eslint",
  "visibility": "Private",
  "remoteIdentifier": "3",
  "lastUpdated": "2019-05-07T14:29:13.430Z",
  "permission": "admin",
  "problems": [
    {
      "message": "We can't analyze this repository because none of the committers are part of the organization.",
      "actions": [
        {
          "name": "Check our documentation",
          "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
        }
      ],
      "code": "failed_to_clone",
      "severity": "all_analysis"
    }
  ],
  "languages": [
    "Java",
    "Scala",
    "CSS"
  ],
  "defaultBranch": {
    "id": 1,
    "name": "master",
    "isDefault": true,
    "isEnabled": true,
    "lastUpdated": "2019-05-07T14:29:13.430Z",
    "branchType": "Branch",
    "lastCommit": "string"
  },
  "badges": {
    "grade": "https://app.codacy.com/project/badge/Grade/d992a862b1994805907ec277e16b0fda",
    "coverage": "https://app.codacy.com/project/badge/Coverage/d992a862b1994805907ec277e16b0fda"
  },
  "codingStandardId": 0,
  "codingStandardName": "string",
  "addedState": "Added",
  "gatePolicyId": 0,
  "gatePolicyName": "string"
}

Responses

Status Meaning Description Schema
200 OK Successful operation Repository
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
402 Payment Required PaymentRequired PaymentRequired
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
409 Conflict Conflict Conflict
500 Internal Server Error Internal Server Error InternalServerError

listFiles

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files

List files in a repository

Returns the most recent analysis information for the files in a repository as available on the Files page. Files that are ignored on Codacy aren't returned.

Note: When applied to public repositories, this operation does not require authentication.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
branch query string false Name of a repository branch enabled on Codacy,
search query string false Filter files that include this string anywhere in their relative path
sort query string false Field used to sort the list of files. The allowed values are 'filename', 'issues', 'grade', 'duplication', 'complexity', and 'coverage'.
direction query string false Sort direction. Possible values are 'asc' (ascending) or 'desc' (descending).
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return

Detailed descriptions

branch: Name of a repository branch enabled on Codacy, as returned by the endpoint listRepositoryBranches. By default, uses the main branch defined on the Codacy repository settings.

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "fileId": 2,
      "branchId": 3,
      "path": "/src/test.go",
      "totalIssues": 42,
      "complexity": 3,
      "grade": 74,
      "gradeLetter": "A",
      "coverage": 71,
      "coverageWithDecimals": 71,
      "duplication": 7,
      "linesOfCode": 123,
      "sourceLinesOfCode": 90,
      "numberOfMethods": 12,
      "numberOfClones": 5
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Responses

Status Meaning Description Schema
200 OK List of files in the repository FileListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getFileWithAnalysis

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}

Get analysis information and coverage metrics for a file in a repository

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
fileId path integer(int64) true Identifier of a file in a specific commit

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "file": {
    "branchId": 1,
    "commitId": 1,
    "commitSha": "string",
    "fileId": 1,
    "fileDataId": 1,
    "path": "/src/test.go",
    "language": "Go",
    "gitProviderUrl": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2"
  },
  "metrics": {
    "linesOfCode": 123,
    "commentedLinesOfCode": 123,
    "numberOfMethods": 123,
    "numberOfClasses": 123
  },
  "coverage": {
    "coverage": 71,
    "coverableLines": 2,
    "coveredLines": 1
  }
}

Responses

Status Meaning Description Schema
200 OK File with analysis FileInformationWithAnalysis
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listRepositoryApiTokens

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens

List the project API tokens for a repository

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "id": 0,
      "token": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation ApiTokenListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

createRepositoryApiToken

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens

Create a new project API token for a repository

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

201 Response

{
  "data": {
    "id": 0,
    "token": "string"
  }
}

Responses

Status Meaning Description Schema
201 Created Successful operation ApiTokenResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

deleteRepositoryApiToken

Code samples

# You can also use wget
curl -X DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens/{tokenId} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens/{tokenId} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens/{tokenId}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens/{tokenId}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.delete 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens/{tokenId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.delete('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens/{tokenId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens/{tokenId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens/{tokenId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tokens/{tokenId}

Delete a project API token for a repository by ID

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
tokenId path integer(int64) true API token ID

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listCoverageReports

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/coverage/status \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/coverage/status HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/coverage/status',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/coverage/status',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/coverage/status',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/coverage/status', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/coverage/status");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/coverage/status", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/coverage/status

Returns a list of the most recent coverage reports and their respective status

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
limit query integer(int32) false Maximum number of items to return

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "hasCoverageOverview": true,
    "lastReports": [
      {
        "targetCommitSha": "string",
        "commit": {
          "sha": "string",
          "id": 1,
          "commitTimestamp": "2019-05-07T14:29:13.430Z",
          "authorName": "string",
          "authorEmail": "string",
          "message": "string",
          "startedAnalysis": "2022-01-07T14:29:13.430Z",
          "endedAnalysis": "2022-01-07T14:29:13.430Z",
          "isMergeCommit": false,
          "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
          "parents": [
            "string"
          ],
          "branches": [
            {
              "id": 1,
              "name": "master",
              "isDefault": true,
              "isEnabled": true,
              "lastUpdated": "2019-05-07T14:29:13.430Z",
              "branchType": "Branch",
              "lastCommit": "string"
            }
          ]
        },
        "language": "string",
        "createdAt": "2019-08-24T14:15:22Z",
        "status": "Pending"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation CoverageReportResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getFileCoverage

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}/coverage \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}/coverage HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}/coverage',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}/coverage',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}/coverage',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}/coverage', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}/coverage");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}/coverage", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}/coverage

Get coverage information for a file in the head commit of a repository branch.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
fileId path integer(int64) true Identifier of a file in a specific commit

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "line": 2,
      "hits": 3
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK File Coverage GetFileCoverageResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

updateFileState

Code samples

# You can also use wget
curl -X PATCH https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/file \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

PATCH https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/file HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/file',
  method: 'patch',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "ignored": true,
  "filepath": "src/main/scala/main/Main.scala"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/file',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.patch 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/file',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.patch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/file', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/file");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/file", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/file

Ignore or unignore a file

Body parameter

{
  "ignored": true,
  "filepath": "src/main/scala/main/Main.scala"
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
body body FileStateBody true none

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getPullRequestDiff

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/diff \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/diff HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/diff',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/diff',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/diff',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/diff', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/diff");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/diff", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/diff

Returns the human-readable Git diff of a pull request

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
pullRequestNumber path integer(int32) true Pull request number

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "diff": "diff --git a/example.md b/example.md\nindex 9eeb703..777b981 100644\n--- a/example.md\n+++ b/example.md\n@@ -1 +1 @@\n-Edited line\n+Edited line (edit)\n"
}

Responses

Status Meaning Description Schema
200 OK Successful operation DiffResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
422 Unprocessable Entity Unprocessable Entity UnprocessableEntity
500 Internal Server Error Internal Server Error InternalServerError

getCommitDiff

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/diff \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/diff HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/diff',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/diff',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/diff',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/diff', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/diff");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/diff", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/diff

Returns the human-readable Git diff of a commit

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
commitUuid path string true UUID or SHA string that identifies the commit

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "diff": "diff --git a/example.md b/example.md\nindex 9eeb703..777b981 100644\n--- a/example.md\n+++ b/example.md\n@@ -1 +1 @@\n-Edited line\n+Edited line (edit)\n"
}

Responses

Status Meaning Description Schema
200 OK Successful operation DiffResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
422 Unprocessable Entity Unprocessable Entity UnprocessableEntity
500 Internal Server Error Internal Server Error InternalServerError

account

getUser

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/user \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/user HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/user',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/user',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/user',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/user', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/user");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/user", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /user

Get the authenticated user

Get the authenticated user

Example responses

200 Response

{
  "data": {
    "id": 0,
    "name": "Foo",
    "mainEmail": "main@codacy.com",
    "otherEmails": [
      "foo@bar.com"
    ],
    "isAdmin": false,
    "isActive": true,
    "created": "2019-05-07T14:29:13.430Z",
    "intercomHash": "userhash",
    "zendeskHash": "userzendeskhash",
    "shouldDoClientQualification": false
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation UserResponse
401 Unauthorized Unauthorized Unauthorized
500 Internal Server Error Internal Server Error InternalServerError

deleteUser

Code samples

# You can also use wget
curl -X DELETE https://app.codacy.com/api/v3/user \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

DELETE https://app.codacy.com/api/v3/user HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/user',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/user',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.delete 'https://app.codacy.com/api/v3/user',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.delete('https://app.codacy.com/api/v3/user', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/user");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://app.codacy.com/api/v3/user", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /user

Example responses

401 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "Unauthorized",
  "code": "Unauthorized"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
401 Unauthorized Unauthorized Unauthorized
409 Conflict Conflict Conflict
500 Internal Server Error Internal Server Error InternalServerError

patchUser

Code samples

# You can also use wget
curl -X PATCH https://app.codacy.com/api/v3/user \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

PATCH https://app.codacy.com/api/v3/user HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/user',
  method: 'patch',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "name": "Foo",
  "shouldDoClientQualification": false
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/user',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.patch 'https://app.codacy.com/api/v3/user',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.patch('https://app.codacy.com/api/v3/user', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/user");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "https://app.codacy.com/api/v3/user", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /user

Body parameter

{
  "name": "Foo",
  "shouldDoClientQualification": false
}

Parameters

Name In Type Required Description
body body UserBody true none

Example responses

200 Response

{
  "data": {
    "id": 0,
    "name": "Foo",
    "mainEmail": "main@codacy.com",
    "otherEmails": [
      "foo@bar.com"
    ],
    "isAdmin": false,
    "isActive": true,
    "created": "2019-05-07T14:29:13.430Z",
    "intercomHash": "userhash",
    "zendeskHash": "userzendeskhash",
    "shouldDoClientQualification": false
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation UserResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listUserOrganizations

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/user/organizations \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/user/organizations HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/user/organizations',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/user/organizations',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/user/organizations',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/user/organizations', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/user/organizations");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/user/organizations", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /user/organizations

List organizations for the authenticated user

List organizations for the authenticated user

Parameters

Name In Type Required Description
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "identifier": 0,
      "remoteIdentifier": "string",
      "name": "FooOrganization",
      "avatar": "someRandomLink.com",
      "created": "2019-05-07T14:29:13.430Z",
      "provider": "gh",
      "joinMode": "auto",
      "type": "Organization",
      "joinStatus": "member",
      "singleProviderLogin": true
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation OrganizationListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
500 Internal Server Error Internal Server Error InternalServerError

listOrganizations

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/user/organizations/{provider} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/user/organizations/{provider} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/user/organizations/{provider}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/user/organizations/{provider}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/user/organizations/{provider}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/user/organizations/{provider}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/user/organizations/{provider}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/user/organizations/{provider}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /user/organizations/{provider}

List organizations for the authenticated user

List organizations for the authenticated user

Parameters

Name In Type Required Description
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return
provider path string true Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "identifier": 0,
      "remoteIdentifier": "string",
      "name": "FooOrganization",
      "avatar": "someRandomLink.com",
      "created": "2019-05-07T14:29:13.430Z",
      "provider": "gh",
      "joinMode": "auto",
      "type": "Organization",
      "joinStatus": "member",
      "singleProviderLogin": true
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation OrganizationListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
500 Internal Server Error Internal Server Error InternalServerError

getUserOrganization

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/user/organizations/{provider}/{remoteOrganizationName} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/user/organizations/{provider}/{remoteOrganizationName} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/user/organizations/{provider}/{remoteOrganizationName}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/user/organizations/{provider}/{remoteOrganizationName}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/user/organizations/{provider}/{remoteOrganizationName}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/user/organizations/{provider}/{remoteOrganizationName}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/user/organizations/{provider}/{remoteOrganizationName}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/user/organizations/{provider}/{remoteOrganizationName}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /user/organizations/{provider}/{remoteOrganizationName}

Get organization for the authenticated user

Get organization for the authenticated user

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "identifier": 0,
    "remoteIdentifier": "string",
    "name": "FooOrganization",
    "avatar": "someRandomLink.com",
    "created": "2019-05-07T14:29:13.430Z",
    "provider": "gh",
    "joinMode": "auto",
    "type": "Organization",
    "joinStatus": "member",
    "singleProviderLogin": true
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation OrganizationResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listUserIntegrations

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/user/integrations \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/user/integrations HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/user/integrations',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/user/integrations',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/user/integrations',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/user/integrations', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/user/integrations");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/user/integrations", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /user/integrations

List integrations for the authenticated user

List integrations for the authenticated user

Parameters

Name In Type Required Description
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "provider": "github",
      "lastAuthenticated": "2019-05-07T14:29:13.430Z"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation IntegrationListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
500 Internal Server Error Internal Server Error InternalServerError

deleteIntegration

Code samples

# You can also use wget
curl -X DELETE https://app.codacy.com/api/v3/user/integrations/{accountProvider} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

DELETE https://app.codacy.com/api/v3/user/integrations/{accountProvider} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/user/integrations/{accountProvider}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/user/integrations/{accountProvider}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.delete 'https://app.codacy.com/api/v3/user/integrations/{accountProvider}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.delete('https://app.codacy.com/api/v3/user/integrations/{accountProvider}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/user/integrations/{accountProvider}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://app.codacy.com/api/v3/user/integrations/{accountProvider}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /user/integrations/{accountProvider}

Parameters

Name In Type Required Description
accountProvider path string true Account Provider

Enumerated Values

Parameter Value
accountProvider github
accountProvider google
accountProvider bitbucket
accountProvider gitlab

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getOrganizationByInstallationId

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/installation/{installationId} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/installation/{installationId} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/installation/{installationId}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/installation/{installationId}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/installation/{installationId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/installation/{installationId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/installation/{installationId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/installation/{installationId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/installation/{installationId}

Get organization by provider installation id

Note Currently supports only gh as the provider parameter.

Parameters

Name In Type Required Description
provider path string true Git provider
installationId path integer(int64) true Identifier of the Codacy installation

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "identifier": 0,
    "remoteIdentifier": "string",
    "name": "FooOrganization",
    "avatar": "someRandomLink.com",
    "created": "2019-05-07T14:29:13.430Z",
    "provider": "gh",
    "joinMode": "auto",
    "type": "Organization",
    "joinStatus": "member",
    "singleProviderLogin": true
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation OrganizationResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getUserApiTokens

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/user/tokens \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/user/tokens HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/user/tokens',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/user/tokens',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/user/tokens',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/user/tokens', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/user/tokens");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/user/tokens", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /user/tokens

List the account API tokens of the authenticated user

Parameters

Name In Type Required Description
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "id": 0,
      "token": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation ApiTokenListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
500 Internal Server Error Internal Server Error InternalServerError

createUserApiToken

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/user/tokens \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/user/tokens HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/user/tokens',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/user/tokens',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/user/tokens',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/user/tokens', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/user/tokens");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/user/tokens", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /user/tokens

Create a new account API token for the authenticated user

Example responses

200 Response

{
  "id": 0,
  "token": "string"
}

Responses

Status Meaning Description Schema
200 OK Successful operation ApiToken
401 Unauthorized Unauthorized Unauthorized
500 Internal Server Error Internal Server Error InternalServerError

deleteUserApiToken

Code samples

# You can also use wget
curl -X DELETE https://app.codacy.com/api/v3/user/tokens/{tokenId} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

DELETE https://app.codacy.com/api/v3/user/tokens/{tokenId} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/user/tokens/{tokenId}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/user/tokens/{tokenId}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.delete 'https://app.codacy.com/api/v3/user/tokens/{tokenId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.delete('https://app.codacy.com/api/v3/user/tokens/{tokenId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/user/tokens/{tokenId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://app.codacy.com/api/v3/user/tokens/{tokenId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /user/tokens/{tokenId}

Delete an account API token for the authenticated user by ID

Parameters

Name In Type Required Description
tokenId path integer(int64) true API token ID

Example responses

401 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "Unauthorized",
  "code": "Unauthorized"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

organization

getOrganization

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}

Get organization

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "organization": {
      "identifier": 0,
      "remoteIdentifier": "string",
      "name": "FooOrganization",
      "avatar": "someRandomLink.com",
      "created": "2019-05-07T14:29:13.430Z",
      "provider": "gh",
      "joinMode": "auto",
      "type": "Organization",
      "joinStatus": "member",
      "singleProviderLogin": true
    },
    "membership": {
      "userRole": "admin"
    },
    "billing": {
      "isPremium": true,
      "model": "Auto",
      "code": "trial",
      "monthly": true,
      "price": 1000,
      "pricedPerUser": true
    },
    "paywall": {
      "organizationDashboard": true,
      "securityDashboard": true
    },
    "organizationPayWall": {
      "organizationDashboard": true
    },
    "analysisConfigurationMinimumPermission": "admin",
    "subscriptions": [
      {
        "product": "coverage",
        "plan": {
          "isPremium": true,
          "code": "string"
        },
        "paywall": {
          "securityDashboard": true
        }
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation OrganizationWithMetaResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

deleteOrganization

Code samples

# You can also use wget
curl -X DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName} HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "joinReason": {
    "title": "string",
    "notes": [
      "string"
    ]
  },
  "cancelReason": {
    "title": "string",
    "notes": [
      "string"
    ]
  }
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}',
{
  method: 'DELETE',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.delete 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.delete('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /organizations/{provider}/{remoteOrganizationName}

Delete organization

Delete organization

Body parameter

{
  "joinReason": {
    "title": "string",
    "notes": [
      "string"
    ]
  },
  "cancelReason": {
    "title": "string",
    "notes": [
      "string"
    ]
  }
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
body body ChurnFeedback false Reasons

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
409 Conflict Conflict Conflict
500 Internal Server Error Internal Server Error InternalServerError

organizationDetailedBilling

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/billing \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/billing HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/billing',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/billing',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/billing',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/billing', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/billing");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/billing", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/billing

Get detailed information about organization billing

Get detailed information about organization billing

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "numberOfSeats": 42,
    "numberOfPurchasedSeats": 100,
    "paymentPlan": {
      "isPremium": true,
      "model": "Auto",
      "code": "trial",
      "monthly": true,
      "price": 1000,
      "pricedPerUser": true
    },
    "paymentGateway": "stripe",
    "priceInCents": 12020,
    "pricePerSeatInCents": 1405,
    "nextPaymentDate": "2019-05-07T14:29:13.430Z",
    "invoiceDetails": {
      "address": "Av. João Crisóstomo, nº31 - 6º, 1050-125 Lisboa",
      "email": "codacy@codacy.com"
    },
    "taxes": [
      {
        "name": "string",
        "rate": 0
      }
    ],
    "subscriptions": [
      {
        "product": "coverage",
        "plan": {
          "isPremium": true,
          "model": "Auto",
          "code": "trial",
          "monthly": true,
          "price": 1000,
          "pricedPerUser": true
        }
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation OrganizationBillingInformationResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

syncMarketplaceBilling

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/billing/sync \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/billing/sync HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/billing/sync',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/billing/sync',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/billing/sync',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/billing/sync', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/billing/sync");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/billing/sync", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/billing/sync

Sync the information about organization billing

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

applyProviderSettings

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings/apply \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings/apply HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings/apply',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings/apply',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings/apply',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings/apply', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings/apply");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings/apply", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings/apply

Apply default settings to all repositories

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError
502 Bad Gateway Bad Gateway BadGateway

getProviderSettings

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings

Get Git provider settings

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "commitStatus": true,
  "pullRequestComment": true,
  "pullRequestSummary": true,
  "coverageSummary": true,
  "suggestions": true,
  "aiEnhancedComments": true
}

Responses

Status Meaning Description Schema
200 OK Successful operation ProviderIntegrationSettingsBody
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError
502 Bad Gateway Bad Gateway BadGateway

updateProviderSettings

Code samples

# You can also use wget
curl -X PATCH https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

PATCH https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings',
  method: 'patch',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "commitStatus": true,
  "pullRequestComment": true,
  "pullRequestSummary": true,
  "coverageSummary": true,
  "suggestions": true,
  "aiEnhancedComments": true
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.patch 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.patch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /organizations/{provider}/{remoteOrganizationName}/integrations/providerSettings

Create or update Git provider settings

Body parameter

{
  "commitStatus": true,
  "pullRequestComment": true,
  "pullRequestSummary": true,
  "coverageSummary": true,
  "suggestions": true,
  "aiEnhancedComments": true
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
body body ProviderIntegrationSettingsPatchBody true none

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError
502 Bad Gateway Bad Gateway BadGateway

listOrganizationRepositories

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/repositories

List an organization repositories for the authenticated user.

List an organization's repositories for the authenticated user. For Bitbucket you must URL encode the cursor before using it in subsequent API calls, as the pagination comes directly from the Git provider. This endpoint may return more results than those specified in the limit parameter. If this endpoint doesn't return your repositories after you've made recent changes to the permissions on your Git provider, use the endpoint cleanCache to force refreshing the list of repositories for the authenticated user.

Note: When applied to public repositories, this operation does not require authentication.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return
search query string false Filter the results searching by this string.
filter query string false RepositoryFilter
languages query string false Languages filter

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl
filter Synced
filter NotSynced
filter AllSynced

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "repositoryId": 45738,
      "provider": "gh",
      "owner": "codacy",
      "name": "codacy-eslint",
      "fullPath": "codacy/codacy-eslint",
      "visibility": "Private",
      "remoteIdentifier": "3",
      "lastUpdated": "2019-05-07T14:29:13.430Z",
      "permission": "admin",
      "problems": [
        {
          "message": "We can't analyze this repository because none of the committers are part of the organization.",
          "actions": [
            {
              "name": "Check our documentation",
              "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
            }
          ],
          "code": "failed_to_clone",
          "severity": "all_analysis"
        }
      ],
      "languages": [
        "Java",
        "Scala",
        "CSS"
      ],
      "defaultBranch": {
        "id": 1,
        "name": "master",
        "isDefault": true,
        "isEnabled": true,
        "lastUpdated": "2019-05-07T14:29:13.430Z",
        "branchType": "Branch",
        "lastCommit": "string"
      },
      "badges": {
        "grade": "https://app.codacy.com/project/badge/Grade/d992a862b1994805907ec277e16b0fda",
        "coverage": "https://app.codacy.com/project/badge/Coverage/d992a862b1994805907ec277e16b0fda"
      },
      "codingStandardId": 0,
      "codingStandardName": "string",
      "addedState": "Added",
      "gatePolicyId": 0,
      "gatePolicyName": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation RepositoryListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError
502 Bad Gateway Bad Gateway BadGateway

retrieveOrganizationOnboardingProgress

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/onboarding/organizations/{provider}/{remoteOrganizationName}/progress \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/onboarding/organizations/{provider}/{remoteOrganizationName}/progress HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/onboarding/organizations/{provider}/{remoteOrganizationName}/progress',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/onboarding/organizations/{provider}/{remoteOrganizationName}/progress',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/onboarding/organizations/{provider}/{remoteOrganizationName}/progress',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/onboarding/organizations/{provider}/{remoteOrganizationName}/progress', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/onboarding/organizations/{provider}/{remoteOrganizationName}/progress");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/onboarding/organizations/{provider}/{remoteOrganizationName}/progress", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /onboarding/organizations/{provider}/{remoteOrganizationName}/progress

Retrieves the onboarding progress of the organization

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "step": "addRepositories | enableStatusChecks",
      "isCompleted": true
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation OrganizationOnboardingProgressResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

patchOrganizationSettings

Code samples

# You can also use wget
curl -X PATCH https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/analysisConfigurationMinimumPermission \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

PATCH https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/analysisConfigurationMinimumPermission HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/analysisConfigurationMinimumPermission',
  method: 'patch',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "permission": "OrganizationOwner"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/analysisConfigurationMinimumPermission',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.patch 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/analysisConfigurationMinimumPermission',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.patch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/analysisConfigurationMinimumPermission', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/analysisConfigurationMinimumPermission");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/analysisConfigurationMinimumPermission", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /organizations/{provider}/{remoteOrganizationName}/analysisConfigurationMinimumPermission

Configure what your organization members can do across the Codacy platform

Define the lowest permission level that can configure patterns, configure which file extensions and branches are analyzed, and ignore issues and files

Body parameter

{
  "permission": "OrganizationOwner"
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
body body MembershipPrivilegesBody true New permission level

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

updateJoinMode

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/joinMode \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/joinMode HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/joinMode',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "joinMode": "auto"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/joinMode',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/joinMode',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/joinMode', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/joinMode");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/joinMode", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/joinMode

Update the join mode of an organization

Body parameter

{
  "joinMode": "auto"
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
body body JoinModeRequest true New join mode of the organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

checkIfUserCanLeave

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/leave/check \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/leave/check HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/leave/check',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/leave/check',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/leave/check',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/leave/check', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/leave/check");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/leave/check", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/people/leave/check

Check if the user can leave the organization

Check if the user can leave the organization or returns the reasons why they can not.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "canLeave": true,
  "message": "Since you are the last organization admin of $orgName, to leave this organization you need to delete it. Please, contact us through support.",
  "reason": {
    "actions": [
      {
        "name": "Check our documentation",
        "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
      }
    ],
    "code": "last_admin_credit"
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation LeaveOrgCheckResult
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listOrganizationJoinRequests

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/join

List requests to join an organization

Endpoint to list requests to join an organization by provider and organization name

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return
search query string false Filter the results searching by this string.

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "email": "mail@mail.com",
      "name": "a display name",
      "numberOfCommits": 0,
      "numberOfRepositories": 0,
      "lastActivity": "2020-01-06T14:29:13.430Z",
      "creationDate": "2020-01-06T14:29:13.430Z"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation ListRequestsToJoinResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

joinOrganization

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/join

Join an organization

Endpoint to join an organization by provider and name

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "organizationIdentifier": 0,
  "joinStatus": "member"
}

Responses

Status Meaning Description Schema
200 OK Successful operation JoinResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
402 Payment Required PaymentRequired PaymentRequired
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

declineRequestsToJoinOrganization

Code samples

# You can also use wget
curl -X DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '[
  "string"
]';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join',
{
  method: 'DELETE',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.delete 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.delete('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /organizations/{provider}/{remoteOrganizationName}/join

Decline Requests to join an organization

Endpoint to decline request to join an organization by provider, name and user emails to be rejected

Body parameter

[
  "string"
]

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
body body addPeopleToOrganizationEmaillist true List of emails

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

deleteOrganizationJoinRequest

Code samples

# You can also use wget
curl -X DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join/{accountIdentifier} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join/{accountIdentifier} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join/{accountIdentifier}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join/{accountIdentifier}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.delete 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join/{accountIdentifier}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.delete('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join/{accountIdentifier}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join/{accountIdentifier}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/join/{accountIdentifier}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /organizations/{provider}/{remoteOrganizationName}/join/{accountIdentifier}

Delete a request to join an organization

Endpoint to delete a request to join an organization by provider, name and user id

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
accountIdentifier path integer(int64) true Account Identifier

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

cleanCache

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/cache/clean \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/cache/clean HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/cache/clean',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/cache/clean',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/cache/clean',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/cache/clean', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/cache/clean");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/cache/clean", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/cache/clean

Clean organization cache for the authenticated user

Clean cached information regarding the authenticated user on the specified organization, such as the list of repositories in the organization.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

addOrganization

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "provider": "gh",
  "remoteIdentifier": "string",
  "name": "FooOrganization",
  "type": "Organization",
  "products": [
    "coverage"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations

Add an organization to Codacy

Add an organization from a Git provider to Codacy

Body parameter

{
  "provider": "gh",
  "remoteIdentifier": "string",
  "name": "FooOrganization",
  "type": "Organization",
  "products": [
    "coverage"
  ]
}

Parameters

Name In Type Required Description
body body AddOrganizationBody true Informations of the organization to add

Example responses

200 Response

{
  "organization": {
    "identifier": 0,
    "remoteIdentifier": "string",
    "name": "FooOrganization",
    "avatar": "someRandomLink.com",
    "created": "2019-05-07T14:29:13.430Z",
    "provider": "gh",
    "joinMode": "auto",
    "type": "Organization",
    "joinStatus": "member",
    "singleProviderLogin": true
  },
  "warnings": [
    "string"
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation AddOrganizationResponse
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
405 Method Not Allowed Method Not Allowed MethodNotAllowed
500 Internal Server Error Internal Server Error InternalServerError

syncOrganizationName

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/sync \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/sync HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/sync',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/sync',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/sync',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/sync', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/sync");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/sync", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/settings/sync

Synchronize Codacy organization name with the Git provider

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "name": "troubleshoot-codacy"
}

Responses

Status Meaning Description Schema
200 OK Successful operation SyncProviderSettingOrganizationResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

checkSubmodules

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/submodules/check \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/submodules/check HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/submodules/check',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/submodules/check',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/submodules/check',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/submodules/check', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/submodules/check");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/submodules/check", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/settings/submodules/check

Check if the submodules option is enabled for the organization

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": true
}

Responses

Status Meaning Description Schema
200 OK Successful operation CheckSubmodulesResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

createOrganizationHooks

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/hooks \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/hooks HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/hooks',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/hooks',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/hooks',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/hooks', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/hooks");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/settings/hooks", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/settings/hooks

Create organization hooks

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getJiraIntegration

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/integrations/jira

Return the Jira integration of the organization.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "organization_id": 867842577,
    "instance_id": "1324a887-45db-1bf4-1e99-ef0ff456d421",
    "instance_name": "codacy",
    "created_at": "2020-11-09T09:10:00Z",
    "updated_at": "2020-11-09T09:10:00Z"
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation JiraIntegrationResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError
502 Bad Gateway Bad Gateway BadGateway

createOrUpdateJiraIntegration

Code samples

# You can also use wget
curl -X PUT https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira?oauthCode=6nGtF5eij1YuEqQXr7L9OxA0RLHZ21tEQNZq1DZJzuY \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

PUT https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira?oauthCode=6nGtF5eij1YuEqQXr7L9OxA0RLHZ21tEQNZq1DZJzuY HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira',
  method: 'put',
  data: '?oauthCode=6nGtF5eij1YuEqQXr7L9OxA0RLHZ21tEQNZq1DZJzuY',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira?oauthCode=6nGtF5eij1YuEqQXr7L9OxA0RLHZ21tEQNZq1DZJzuY',
{
  method: 'PUT',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.put 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira',
  params: {
  'oauthCode' => 'string'
}, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.put('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira', params={
  'oauthCode': '6nGtF5eij1YuEqQXr7L9OxA0RLHZ21tEQNZq1DZJzuY'
}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira?oauthCode=6nGtF5eij1YuEqQXr7L9OxA0RLHZ21tEQNZq1DZJzuY");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PUT /organizations/{provider}/{remoteOrganizationName}/integrations/jira

Create or Update the Jira integration of the organization.

Parameters

Name In Type Required Description
oauthCode query string true The OAuth code to allow authentication as the user installing the Jira App.
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "organization_id": 867842577,
    "instance_id": "1324a887-45db-1bf4-1e99-ef0ff456d421",
    "instance_name": "codacy",
    "created_at": "2020-11-09T09:10:00Z",
    "updated_at": "2020-11-09T09:10:00Z"
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation JiraIntegrationResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
409 Conflict Conflict Conflict
500 Internal Server Error Internal Server Error InternalServerError
502 Bad Gateway Bad Gateway BadGateway

deleteJiraIntegration

Code samples

# You can also use wget
curl -X DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.delete 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.delete('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/jira", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /organizations/{provider}/{remoteOrganizationName}/integrations/jira

Delete the Jira integration of the organization and associated resources.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError
502 Bad Gateway Bad Gateway BadGateway

getSlackIntegration

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/integrations/slack

Return the Slack integration of the organization.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "organization_id": 867842577,
    "webhook_url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
    "created_at": "2020-11-09T09:10:00Z",
    "updated_at": "2020-11-09T09:10:00Z"
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation SlackIntegrationResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError
502 Bad Gateway Bad Gateway BadGateway

createOrUpdateSlackIntegration

Code samples

# You can also use wget
curl -X PUT https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

PUT https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "webhook_url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.put 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.put('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PUT /organizations/{provider}/{remoteOrganizationName}/integrations/slack

Create or update the Slack integration of the organization.

Body parameter

{
  "webhook_url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
body body SlackIntegrationRequest true none

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "organization_id": 867842577,
    "webhook_url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
    "created_at": "2020-11-09T09:10:00Z",
    "updated_at": "2020-11-09T09:10:00Z"
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation SlackIntegrationResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError
502 Bad Gateway Bad Gateway BadGateway

deleteSlackIntegration

Code samples

# You can also use wget
curl -X DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.delete 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.delete('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/integrations/slack", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /organizations/{provider}/{remoteOrganizationName}/integrations/slack

Delete the Slack integration of the organization and associated resources.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError
502 Bad Gateway Bad Gateway BadGateway

people

listPeopleFromOrganization

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/people

List people of an organization

List people of an organization

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return
search query string false Filter the results searching by this string.
onlyMembers query boolean false If true, returns only Codacy users. If false, returns also commit authors that aren't Codacy users.

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "name": "John Smith",
      "email": "johnsmith@emailprovider.com",
      "emails": [
        "johnsmith@emailprovider.com"
      ],
      "userId": 1234,
      "committerId": 1234,
      "lastLogin": "2020-11-05T15:39:13.430Z",
      "lastAnalysis": "2020-11-05T15:39:13.430Z",
      "isActive": true,
      "canBeRemoved": true,
      "lastCommitId": 2335557754,
      "providerId": "string",
      "providerLogin": "string",
      "isProviderRegistered": true
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation ListPeopleResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

addPeopleToOrganization

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '[
  "string"
]';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/people

Add people to organization

Add people to organization as members or committers (depending if they have a pending request already)

Body parameter

[
  "string"
]

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
body body addPeopleToOrganizationEmaillist true List of emails

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listPeopleFromOrganizationCsv

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/peopleCsv \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/peopleCsv HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/peopleCsv',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/peopleCsv',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/peopleCsv',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/peopleCsv', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/peopleCsv");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/peopleCsv", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/peopleCsv

Generate a CSV file listing the people of an organization

Generate a CSV file containing the name, email, lastLogin, and lastAnalysis of each person of the organization

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

"string"

Responses

Status Meaning Description Schema
200 OK Successful operation string
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

removePeopleFromOrganization

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/remove \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/remove HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/remove',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "emails": [
    "string"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/remove',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/remove',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/remove', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/remove");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/remove", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/people/remove

Remove people from an organization

Remove people from an organization

Body parameter

{
  "emails": [
    "string"
  ]
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
body body RemovePeopleBody true List of committers/members to remove

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "success": [
    {
      "email": "string",
      "error": "string"
    }
  ],
  "failed": [
    {
      "email": "string",
      "error": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Remove people response RemovePeopleResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

peopleSuggestionsForOrganization

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/suggestions \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/suggestions HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/suggestions',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/suggestions',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/suggestions',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/suggestions', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/suggestions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/people/suggestions", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/people/suggestions

List people suggestions for an organization

List people suggestions for an organization

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return
search query string false Filter the results searching by this string.

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "commitEmail": "string",
      "totalProjects": 0,
      "totalCommits": 0,
      "lastCommit": "2019-08-24T14:15:22Z",
      "projectCommitStats": [
        {
          "projectId": 0,
          "firstCommit": "2019-08-24T14:15:22Z",
          "lastCommit": "2019-08-24T14:15:22Z",
          "numberOfCommits": 0
        }
      ]
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK List people suggestions response SuggestedAuthorsResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

peopleSuggestionsForRepository

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/people/suggestions \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/people/suggestions HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/people/suggestions',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/people/suggestions',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/people/suggestions',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/people/suggestions', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/people/suggestions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/people/suggestions", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/people/suggestions

List people suggestions for a repository

List people suggestions for a repository

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return
search query string false Filter the results searching by this string.

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "commitEmail": "string",
      "projectCommitStat": {
        "projectId": 0,
        "firstCommit": "2019-08-24T14:15:22Z",
        "lastCommit": "2019-08-24T14:15:22Z",
        "numberOfCommits": 0
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK List people suggestions response RepositorySuggestedAuthorsResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

billing

deleteSubscription

Code samples

# You can also use wget
curl -X DELETE https://app.codacy.com/api/v3/billing/{provider}/{remoteOrganizationName}/subscription \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

DELETE https://app.codacy.com/api/v3/billing/{provider}/{remoteOrganizationName}/subscription HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/billing/{provider}/{remoteOrganizationName}/subscription',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "joinReason": {
    "title": "string",
    "notes": [
      "string"
    ]
  },
  "cancelReason": {
    "title": "string",
    "notes": [
      "string"
    ]
  }
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/billing/{provider}/{remoteOrganizationName}/subscription',
{
  method: 'DELETE',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.delete 'https://app.codacy.com/api/v3/billing/{provider}/{remoteOrganizationName}/subscription',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.delete('https://app.codacy.com/api/v3/billing/{provider}/{remoteOrganizationName}/subscription', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/billing/{provider}/{remoteOrganizationName}/subscription");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://app.codacy.com/api/v3/billing/{provider}/{remoteOrganizationName}/subscription", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /billing/{provider}/{remoteOrganizationName}/subscription

Delete billing subscription for organization

Delete billing subscription for organization

Body parameter

{
  "joinReason": {
    "title": "string",
    "notes": [
      "string"
    ]
  },
  "cancelReason": {
    "title": "string",
    "notes": [
      "string"
    ]
  }
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
body body ChurnFeedback false Reasons

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
409 Conflict Conflict Conflict
500 Internal Server Error Internal Server Error InternalServerError

integrations

listConfiguredLoginIntegrations

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/login/integrations \
  -H 'Accept: application/json'

GET https://app.codacy.com/api/v3/login/integrations HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/login/integrations',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://app.codacy.com/api/v3/login/integrations',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://app.codacy.com/api/v3/login/integrations',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://app.codacy.com/api/v3/login/integrations', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/login/integrations");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/login/integrations", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /login/integrations

List configured login providers on Codacy's platform

List configured login providers on Codacy's platform

Parameters

Name In Type Required Description
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "provider": "github",
      "loginUrl": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation ConfiguredLoginIntegrationListResponse
400 Bad Request Bad Request BadRequest
500 Internal Server Error Internal Server Error InternalServerError

listProviderIntegrations

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/provider/integrations \
  -H 'Accept: application/json'

GET https://app.codacy.com/api/v3/provider/integrations HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/provider/integrations',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://app.codacy.com/api/v3/provider/integrations',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://app.codacy.com/api/v3/provider/integrations',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://app.codacy.com/api/v3/provider/integrations', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/provider/integrations");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/provider/integrations", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /provider/integrations

List provider integrations existing on Codacy's platform

List provider integrations existing on Codacy's platform

Parameters

Name In Type Required Description
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "provider": "github",
      "redirectUrl": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation ProviderIntegrationListResponse
400 Bad Request Bad Request BadRequest
500 Internal Server Error Internal Server Error InternalServerError

configuration

getConfigurationStatus

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/configuration/status \
  -H 'Accept: application/json'

GET https://app.codacy.com/api/v3/configuration/status HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/configuration/status',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://app.codacy.com/api/v3/configuration/status',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://app.codacy.com/api/v3/configuration/status',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://app.codacy.com/api/v3/configuration/status', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/configuration/status");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/configuration/status", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /configuration/status

Get configuration status

Get configuration status

Example responses

200 Response

{
  "statuses": [
    {
      "title": "string",
      "category": "database",
      "errors": [
        "string"
      ],
      "link": "string"
    }
  ],
  "metadata": {
    "firstSignupDone": true
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation ConfigurationStatusResponse
500 Internal Server Error Internal Server Error InternalServerError

health

health

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/health \
  -H 'Accept: application/json'

GET https://app.codacy.com/api/v3/health HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/health',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://app.codacy.com/api/v3/health',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://app.codacy.com/api/v3/health',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://app.codacy.com/api/v3/health', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/health");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/health", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /health

Health check endpoint

Health check endpoint

Example responses

200 Response

{
  "data": {
    "message": "Hello, it's me"
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation HealthCheckResponse
500 Internal Server Error Internal Server Error InternalServerError

admin

generateLicense

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/admin/license \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/admin/license HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/admin/license',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "numberOfSeats": 100,
  "email": "name@domain.com",
  "expirationDate": "2019-05-07T14:29:13.430Z",
  "inactivityThreshold": 4,
  "autoAddAuthors": true,
  "allowSeatsOverflow": true
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/admin/license',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/admin/license',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/admin/license', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/admin/license");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/admin/license", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /admin/license

(non self-hosted admins only) Generates a license for self-hosted instances of Codacy

Body parameter

{
  "numberOfSeats": 100,
  "email": "name@domain.com",
  "expirationDate": "2019-05-07T14:29:13.430Z",
  "inactivityThreshold": 4,
  "autoAddAuthors": true,
  "allowSeatsOverflow": true
}

Parameters

Name In Type Required Description
body body License true none

Example responses

200 Response

{
  "data": "string"
}

Responses

Status Meaning Description Schema
200 OK Successful operation LicenseResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
500 Internal Server Error Internal Server Error InternalServerError

deleteDormantAccounts

Code samples

# You can also use wget
curl -X DELETE https://app.codacy.com/api/v3/admin/dormantAccounts \
  -H 'Content-Type: text/plain' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

DELETE https://app.codacy.com/api/v3/admin/dormantAccounts HTTP/1.1
Host: app.codacy.com
Content-Type: text/plain
Accept: application/json

var headers = {
  'Content-Type':'text/plain',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/admin/dormantAccounts',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = 'string';
const headers = {
  'Content-Type':'text/plain',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/admin/dormantAccounts',
{
  method: 'DELETE',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'text/plain',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.delete 'https://app.codacy.com/api/v3/admin/dormantAccounts',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'text/plain',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.delete('https://app.codacy.com/api/v3/admin/dormantAccounts', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/admin/dormantAccounts");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"text/plain"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://app.codacy.com/api/v3/admin/dormantAccounts", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /admin/dormantAccounts

(Codacy Self-hosted admins only) Delete Codacy users based on a CSV file exported by GitHub Enterprise

Body parameter

Parameters

Name In Type Required Description
body body string true CSV file containing email addresses of the users to delete in a column called "email"

Example responses

200 Response

{
  "data": [
    {
      "email": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation DeleteDormantAccountsResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
500 Internal Server Error Internal Server Error InternalServerError

uploadPenTestResultsCSV

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/admin/security/penTestResults \
  -H 'Content-Type: multipart/form-data' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/admin/security/penTestResults HTTP/1.1
Host: app.codacy.com
Content-Type: multipart/form-data
Accept: application/json

var headers = {
  'Content-Type':'multipart/form-data',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/admin/security/penTestResults',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "csvdata": "string",
  "provider": "bb",
  "organizationName": "string"
}';
const headers = {
  'Content-Type':'multipart/form-data',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/admin/security/penTestResults',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'multipart/form-data',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/admin/security/penTestResults',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'multipart/form-data',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/admin/security/penTestResults', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/admin/security/penTestResults");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"multipart/form-data"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/admin/security/penTestResults", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /admin/security/penTestResults

Internal, used by Codacy admins to upload pen test results for a given organization

Body parameter

csvdata: string
provider: bb
organizationName: string

Parameters

Name In Type Required Description
body body object false none
» csvdata body string(binary) true The CSV file containing pen test results
» provider body string true Git provider hosting the organization's repositories.
» organizationName body string true The name of the organization to which the results belong.

Enumerated Values

Parameter Value
» provider bb
» provider gh
» provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
202 Accepted Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

languages

listLanguagesWithTools

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/languages/tools \
  -H 'Accept: application/json'

GET https://app.codacy.com/api/v3/languages/tools HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/languages/tools',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://app.codacy.com/api/v3/languages/tools',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://app.codacy.com/api/v3/languages/tools',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://app.codacy.com/api/v3/languages/tools', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/languages/tools");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/languages/tools", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /languages/tools

Retrieves the list of languages of available tools

Lists the languages of the available tools in Codacy

Example responses

200 Response

{
  "data": [
    {
      "name": "Scala"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation LanguageListResponse
400 Bad Request Bad Request BadRequest
500 Internal Server Error Internal Server Error InternalServerError

tools

listTools

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/tools \
  -H 'Accept: application/json'

GET https://app.codacy.com/api/v3/tools HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/tools',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://app.codacy.com/api/v3/tools',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://app.codacy.com/api/v3/tools',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://app.codacy.com/api/v3/tools', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/tools");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/tools", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /tools

Retrieves the list of tools

Lists the available tools in Codacy

Parameters

Name In Type Required Description
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return

Example responses

200 Response

{
  "data": [
    {
      "uuid": "847feb32-9ff2-11ea-bb37-0242ac130002",
      "name": "ESLint",
      "version": "6.8.0",
      "shortName": "eslint",
      "documentationUrl": "http://eslint.org/docs/rules/",
      "sourceCodeUrl": "https://github.com/codacy/codacy-eslint",
      "prefix": "ESLint_",
      "needsCompilation": false,
      "configurationFilenames": [
        ".eslintrc.js",
        ".eslintrc.yaml"
      ],
      "description": "ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. In many ways, it is similar to JSLint and JSHint with a few exceptions",
      "dockerImage": "codacy/codacy-eslint:2.20.19",
      "languages": [
        "JavaScript"
      ],
      "clientSide": true,
      "standalone": true,
      "enabledByDefault": true,
      "configurable": true
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation ToolListResponse
400 Bad Request Bad Request BadRequest
500 Internal Server Error Internal Server Error InternalServerError

listPatterns

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/tools/{toolUuid}/patterns \
  -H 'Accept: application/json'

GET https://app.codacy.com/api/v3/tools/{toolUuid}/patterns HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/tools/{toolUuid}/patterns',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://app.codacy.com/api/v3/tools/{toolUuid}/patterns',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://app.codacy.com/api/v3/tools/{toolUuid}/patterns',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://app.codacy.com/api/v3/tools/{toolUuid}/patterns', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/tools/{toolUuid}/patterns");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/tools/{toolUuid}/patterns", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /tools/{toolUuid}/patterns

Retrieve the list of tool patterns

Lists the available patterns for the given tool

Parameters

Name In Type Required Description
toolUuid path string true Tool unique identifier
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return

Example responses

200 Response

{
  "data": [
    {
      "id": "accessor-pairs",
      "title": "string",
      "category": "Security",
      "subCategory": "XSS",
      "level": "Error",
      "severityLevel": "Error",
      "description": "Enforce getter and setter pairs in objects and classes",
      "explanation": "Accessor pairs description",
      "enabled": true,
      "languages": [
        "JavaScript"
      ],
      "timeToFix": 5,
      "parameters": [
        {
          "name": "getWithoutSet",
          "description": "getWithoutSet",
          "default": "true"
        }
      ]
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operations PatternListResponse
400 Bad Request Bad Request BadRequest
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getPattern

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/tools/{toolUuid}/patterns/{patternId} \
  -H 'Accept: application/json'

GET https://app.codacy.com/api/v3/tools/{toolUuid}/patterns/{patternId} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/tools/{toolUuid}/patterns/{patternId}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://app.codacy.com/api/v3/tools/{toolUuid}/patterns/{patternId}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://app.codacy.com/api/v3/tools/{toolUuid}/patterns/{patternId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://app.codacy.com/api/v3/tools/{toolUuid}/patterns/{patternId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/tools/{toolUuid}/patterns/{patternId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/tools/{toolUuid}/patterns/{patternId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /tools/{toolUuid}/patterns/{patternId}

Retrieve a tool pattern

Get the definition of a specific pattern

Parameters

Name In Type Required Description
toolUuid path string true Tool unique identifier
patternId path string true Pattern identifier

Example responses

200 Response

{
  "data": {
    "id": "accessor-pairs",
    "title": "string",
    "category": "Security",
    "subCategory": "XSS",
    "level": "Error",
    "severityLevel": "Error",
    "description": "Enforce getter and setter pairs in objects and classes",
    "explanation": "Accessor pairs description",
    "enabled": true,
    "languages": [
      "JavaScript"
    ],
    "timeToFix": 5,
    "parameters": [
      {
        "name": "getWithoutSet",
        "description": "getWithoutSet",
        "default": "true"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation PatternResponse
400 Bad Request Bad Request BadRequest
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listDuplicationTools

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/duplicationTools \
  -H 'Accept: application/json'

GET https://app.codacy.com/api/v3/duplicationTools HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/duplicationTools',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://app.codacy.com/api/v3/duplicationTools',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://app.codacy.com/api/v3/duplicationTools',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://app.codacy.com/api/v3/duplicationTools', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/duplicationTools");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/duplicationTools", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /duplicationTools

Retrieves the list of tools

Lists the available duplication tools in Codacy

Example responses

200 Response

{
  "data": [
    {
      "dockerImage": "codacy/codacy-duplication-pmdcpd:1.0.0",
      "languages": [
        "string"
      ]
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation DuplicationToolListResponse
500 Internal Server Error Internal Server Error InternalServerError

listMetricsTools

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/metricsTools \
  -H 'Accept: application/json'

GET https://app.codacy.com/api/v3/metricsTools HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/metricsTools',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://app.codacy.com/api/v3/metricsTools',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://app.codacy.com/api/v3/metricsTools',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://app.codacy.com/api/v3/metricsTools', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/metricsTools");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/metricsTools", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /metricsTools

Retrieves the list of tools

Lists the available metrics tools in Codacy

Example responses

200 Response

{
  "data": [
    {
      "dockerImage": "codacy/codacy-metrics-cloc:1.0.0",
      "languages": [
        "string"
      ]
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation MetricsToolListResponse
500 Internal Server Error Internal Server Error InternalServerError

coding standards

listCodingStandards

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/coding-standards

List the coding standards for an organization, including draft coding standards

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "id": 0,
      "name": "string",
      "isDraft": true,
      "isDefault": true,
      "languages": [
        "string"
      ],
      "meta": {
        "enabledToolsCount": 0,
        "enabledPatternsCount": 0,
        "linkedRepositoriesCount": 0
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK List of coding standards for an organization CodingStandardsListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

createCodingStandard

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "name": "Security best practices",
  "languages": [
    "Java",
    "Go"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/coding-standards

Create a draft coding standard for an organization. To promote the draft coding standard to effective coding standard, see promoteDraftCodingStandard

Body parameter

{
  "name": "Security best practices",
  "languages": [
    "Java",
    "Go"
  ]
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
sourceRepository query string false Name of a repository in the same organization to use as a template when creating the new coding standard
sourceCodingStandard query integer(int64) false Identifier of an existing coding standard to use as a template when creating a new coding standard, including the enabled repositories and default coding standard status
body body CreateCodingStandardBody true Details of the coding standard to create

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

201 Response

{
  "data": {
    "id": 0,
    "name": "string",
    "isDraft": true,
    "isDefault": true,
    "languages": [
      "string"
    ],
    "meta": {
      "enabledToolsCount": 0,
      "enabledPatternsCount": 0,
      "linkedRepositoriesCount": 0
    }
  }
}

Responses

Status Meaning Description Schema
201 Created Successfully created a coding standard CodingStandardResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
409 Conflict Conflict Conflict
422 Unprocessable Entity Unprocessable Entity UnprocessableEntity
500 Internal Server Error An unexpected error occurred while creating the coding standard InternalServerError

createCodingStandardPreset

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/presets-standards \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/presets-standards HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/presets-standards',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "name": "Security best practices",
  "isDefault": true,
  "presets": {
    "bugRisk": 1,
    "security": 1,
    "bestPractices": 1,
    "codeStyle": 1,
    "documentation": 1
  }
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/presets-standards',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/presets-standards',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/presets-standards', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/presets-standards");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/presets-standards", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/presets-standards

Create a coding standard for an organization choosing from a series of presets.

Body parameter

{
  "name": "Security best practices",
  "isDefault": true,
  "presets": {
    "bugRisk": 1,
    "security": 1,
    "bestPractices": 1,
    "codeStyle": 1,
    "documentation": 1
  }
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
body body CreateCodingStandardPresetBody true Details of the coding standard to create

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

201 Response

{
  "data": {
    "id": 0,
    "name": "string",
    "isDraft": true,
    "isDefault": true,
    "languages": [
      "string"
    ],
    "meta": {
      "enabledToolsCount": 0,
      "enabledPatternsCount": 0,
      "linkedRepositoriesCount": 0
    }
  }
}

Responses

Status Meaning Description Schema
201 Created Successfully created a coding standard CodingStandardResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
409 Conflict Conflict Conflict
422 Unprocessable Entity Unprocessable Entity UnprocessableEntity
500 Internal Server Error An unexpected error occurred while creating the coding standard InternalServerError

getCodingStandard

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}

Get a coding standard

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
codingStandardId path integer(int64) true Coding standard identifier

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "id": 0,
    "name": "string",
    "isDraft": true,
    "isDefault": true,
    "languages": [
      "string"
    ],
    "meta": {
      "enabledToolsCount": 0,
      "enabledPatternsCount": 0,
      "linkedRepositoriesCount": 0
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation CodingStandardResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

deleteCodingStandard

Code samples

# You can also use wget
curl -X DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.delete 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.delete('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}

Delete a coding standard

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
codingStandardId path integer(int64) true Coding standard identifier

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error An unexpected error occurred while deleting a coding standard InternalServerError

listCodingStandardTools

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools

List tools in a coding standard

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
codingStandardId path integer(int64) true Coding standard identifier

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "codingStandardId": 0,
      "uuid": "847feb32-9ff2-11ea-bb37-0242ac130002",
      "isEnabled": true
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation CodingStandardToolsListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error An unexpected error occurred while listing the tools of the coding standard InternalServerError

setDefaultCodingStandard

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/setDefault \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/setDefault HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/setDefault',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "isDefault": true
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/setDefault',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/setDefault',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/setDefault', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/setDefault");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/setDefault", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/setDefault

Set the default coding standard for an organization

Body parameter

{
  "isDefault": true
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
codingStandardId path integer(int64) true Coding standard identifier
body body SetDefaultCodingStandardBody true none

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
200 OK Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listCodingStandardPatterns

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}/patterns \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}/patterns HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}/patterns',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}/patterns',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}/patterns',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}/patterns', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}/patterns");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}/patterns", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}/patterns

List the code patterns configured for a tool in a coding standard

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
codingStandardId path integer(int64) true Coding standard identifier
toolUuid path string true Tool unique identifier
languages query string false Languages filter
categories query string false Filter by a comma separated list of code pattern categories. The allowed values are 'Security', 'ErrorProne', 'CodeStyle', 'Compatibility', 'UnusedCode', and 'Performance'
severityLevels query string false Filter by a comma separated list of code pattern severity levels. The allowed values are 'Error', 'Warning', and 'Info'
sort query string false Field used to sort the tool's code patterns. The allowed values are 'category', 'recommended', and 'severity'
direction query string false Sort direction. Possible values are 'asc' (ascending) or 'desc' (descending).
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "patternDefinition": {
        "id": "accessor-pairs",
        "title": "string",
        "category": "Security",
        "subCategory": "XSS",
        "level": "Error",
        "severityLevel": "Error",
        "description": "Enforce getter and setter pairs in objects and classes",
        "explanation": "Accessor pairs description",
        "enabled": true,
        "languages": [
          "JavaScript"
        ],
        "timeToFix": 5,
        "parameters": [
          {
            "name": "getWithoutSet",
            "description": "getWithoutSet",
            "default": "true"
          }
        ]
      },
      "enabled": true,
      "parameters": [
        {
          "name": "getWithoutSet",
          "value": "true"
        }
      ]
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "meta": {
    "totalEnabled": 35
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation CodingStandardPatternsListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

updateCodingStandardPatterns

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}/patterns/update \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}/patterns/update HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}/patterns/update',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "enabled": true
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}/patterns/update',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}/patterns/update',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}/patterns/update', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}/patterns/update");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}/patterns/update", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}/patterns/update

Bulk updates the code patterns of a tool in a coding standard.

Use filters to specify the code patterns to update, or omit the filters to update all code patterns.

Body parameter

{
  "enabled": true
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
codingStandardId path integer(int64) true Coding standard identifier
toolUuid path string true Tool unique identifier
languages query string false Languages filter
categories query string false Filter by a comma separated list of code pattern categories. The allowed values are 'Security', 'ErrorProne', 'CodeStyle', 'Compatibility', 'UnusedCode', and 'Performance'
severityLevels query string false Filter by a comma separated list of code pattern severity levels. The allowed values are 'Error', 'Warning', and 'Info'
body body UpdateCodingStandardPatternsBody true none

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
409 Conflict Conflict Conflict
500 Internal Server Error Internal Server Error InternalServerError

updateCodingStandardToolConfiguration

Code samples

# You can also use wget
curl -X PATCH https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

PATCH https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid} HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}',
  method: 'patch',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "enabled": true,
  "patterns": [
    {
      "id": "ESLint_@typescript-eslint_no-shadow",
      "enabled": true,
      "parameters": [
        {
          "name": "getWithoutSet",
          "value": "true"
        }
      ]
    }
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.patch 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.patch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/tools/{toolUuid}

Configure a tool in a draft coding standard.

Toggle a tool and configure its code patterns in a draft coding standard. Only the code patterns included in the body are updated, and if there are none only the enabled status of the tool is set. You can only update draft coding standards and configure a maximum of 1000 code patterns per call.

Body parameter

{
  "enabled": true,
  "patterns": [
    {
      "id": "ESLint_@typescript-eslint_no-shadow",
      "enabled": true,
      "parameters": [
        {
          "name": "getWithoutSet",
          "value": "true"
        }
      ]
    }
  ]
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
codingStandardId path integer(int64) true Coding standard identifier
toolUuid path string true Tool unique identifier
body body ToolConfiguration true Configuration of a tool and its code patterns

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
409 Conflict Conflict Conflict
500 Internal Server Error Internal Server Error InternalServerError

listCodingStandardRepositories

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/repositories \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/repositories HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/repositories',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/repositories',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/repositories',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/repositories', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/repositories");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/repositories", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/repositories

List the repositories that are using a coding standard

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
codingStandardId path integer(int64) true Coding standard identifier
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "repositoryId": 0,
      "name": "codacy-eslint"
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation CodingStandardRepositoriesListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

applyCodingStandardToRepositories

Code samples

# You can also use wget
curl -X PATCH https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/repositories \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

PATCH https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/repositories HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/repositories',
  method: 'patch',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "link": [
    "string"
  ],
  "unlink": [
    "string"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/repositories',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.patch 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/repositories',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.patch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/repositories', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/repositories");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/repositories", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/repositories

Apply a coding standard to a list of repositories

Link or unlink a coding standard to a list of repositories. If the coding standard is a draft, the changes will only be effective when promoting the draft coding standard.

Body parameter

{
  "link": [
    "string"
  ],
  "unlink": [
    "string"
  ]
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
codingStandardId path integer(int64) true Coding standard identifier
body body ApplyCodingStandardToRepositoriesBody true none

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "successful": [
      "string"
    ],
    "failed": [
      "string"
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation ApplyCodingStandardToRepositoriesResultResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

promoteDraftCodingStandard

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/promote \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/promote HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/promote',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/promote',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/promote',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/promote', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/promote");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/promote", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/coding-standards/{codingStandardId}/promote

Promote a draft coding standard to an effective coding standard. If the draft coding standard is marked as default, it becomes the new default coding standard

Returns the result of applying the coding standard to the repositories.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
codingStandardId path integer(int64) true Coding standard identifier

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "successful": [
      "string"
    ],
    "failed": [
      "string"
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation ApplyCodingStandardToRepositoriesResultResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
409 Conflict Conflict Conflict
500 Internal Server Error Internal Server Error InternalServerError

file

getFileExtensionsSettings

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/file-extensions \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/file-extensions HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/file-extensions',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/file-extensions',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/file-extensions',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/file-extensions', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/file-extensions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/file-extensions", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/file-extensions

Get the list of supported file extensions associated with each language in a repository

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "languagesExtensions": [
    {
      "name": "string",
      "codacyDefaults": [
        "string"
      ],
      "extensions": [
        "string"
      ]
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation FileExtensionsResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
409 Conflict Conflict Conflict
500 Internal Server Error Internal Server Error InternalServerError

patchFileExtensionsSettings

Code samples

# You can also use wget
curl -X PATCH https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/file-extensions \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

PATCH https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/file-extensions HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/file-extensions',
  method: 'patch',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "languagesExtensions": [
    {
      "name": "string",
      "extensions": [
        "string"
      ]
    }
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/file-extensions',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.patch 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/file-extensions',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.patch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/file-extensions', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/file-extensions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/file-extensions", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/file-extensions

Update the custom file extensions for a repository

Body parameter

{
  "languagesExtensions": [
    {
      "name": "string",
      "extensions": [
        "string"
      ]
    }
  ]
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
body body FileExtensionsBody true none

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
409 Conflict Conflict Conflict
500 Internal Server Error Internal Server Error InternalServerError

getCodeBlock

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}/source \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}/source HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}/source',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}/source',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}/source',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}/source', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}/source");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}/source", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}/source

Returns a code block from a file

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
fileId path integer(int64) true Identifier of a file in a specific commit
startLine query integer(int32) false Line number where the code block starts
endLine query integer(int32) false Line number where the code block ends

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "number": 0,
      "content": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation CodeBlockLineListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

coverage

getRepositoryPullRequestCoverage

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}

Get pull request coverage information from a repository

Note: When applied to public repositories, this operation does not require authentication.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
pullRequestNumber path integer(int32) true Pull request number

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "pullRequest": {
      "id": 1,
      "number": 1,
      "updated": "2019-05-07T14:29:13.430Z",
      "status": "open",
      "repository": "awesome-repository",
      "title": "Amazing pull request",
      "owner": {
        "name": "Foo",
        "avatarUrl": "https://example.com/foo",
        "username": "foo.bar",
        "email": "foobar@example.com"
      },
      "headCommitSha": "2957025d42e8daadf937d4044516f991d21deea4",
      "commonAncestorCommitSha": "3357025d42e8daadf937d4044516f991d21deea4",
      "originBranch": "feat-branch",
      "targetBranch": "master",
      "gitHref": "https://github.com/..."
    },
    "coverage": {
      "deltaCoverage": 71,
      "diffCoverage": {
        "value": 71,
        "coveredLines": 11,
        "coverableLines": 21,
        "cause": "NoCoverableLines"
      },
      "isUpToStandards": true,
      "resultReasons": [
        {
          "gate": "string",
          "expected": -1,
          "expectedThreshold": {
            "threshold": 0,
            "minimumSeverity": "Error"
          },
          "isUpToStandards": true
        }
      ]
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation PullRequestWithCoverageResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getRepositoryPullRequestFilesCoverage

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/files \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/files HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/files',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/files',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/files',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/files', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/files");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/files", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/files

Get pull request files coverage information from a repository

Note: When applied to public repositories, this operation does not require authentication.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
pullRequestNumber path integer(int32) true Pull request number

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "fileName": "string",
      "coverage": 0,
      "variation": 0,
      "diff": {
        "value": 71,
        "coveredLines": 11,
        "coverableLines": 21,
        "cause": "NoCoverableLines"
      },
      "diffLineHits": [
        {
          "lineNumber": "string",
          "hits": 0
        }
      ]
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation PullRequestFilesCoverageResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getPullRequestGitDiff

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/diff \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/diff HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/diff',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/diff',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/diff',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/diff', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/diff");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/diff", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /coverage/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/diff

Returns the human-readable Git diff of a pull request

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositoryName path string true Repository name on the Git provider organization
pullRequestNumber path integer(int32) true Pull request number

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "diff": "diff --git a/example.md b/example.md\nindex 9eeb703..777b981 100644\n--- a/example.md\n+++ b/example.md\n@@ -1 +1 @@\n-Edited line\n+Edited line (edit)\n"
}

Responses

Status Meaning Description Schema
200 OK Successful operation DiffResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
422 Unprocessable Entity Unprocessable Entity UnprocessableEntity
500 Internal Server Error Internal Server Error InternalServerError

security

listSecurityItems

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/security/items

Deprecated: use SearchSecurityItems instead. Returns a paginated list of security and risk management items for an organization. Repository filtering is limited to 100 names.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return
repositories query string false Deprecated, use SearchOrganizationRepositoriesWithAnalysis instead
status query array[string] false Security issue status to filter by. See SrmStatus for possible values.
priority query array[string] false Security issue priorities to filter by. See SrmPriority for possible values.
category query array[string] false Security categories to filter by. Use _other_ to search for issues that don't have a security category.

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl
status Overdue
status OnTrack
status DueSoon
status ClosedOnTime
status ClosedLate
priority Low
priority Medium
priority High
priority Critical

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "id": "ba7c836d-85f8-4617-9a95-ac6f00af1d30",
      "itemSource": "Codacy",
      "itemSourceId": "764334",
      "title": "Codacy quality - critical security issue 764334",
      "repository": "codacy-docs",
      "openedAt": "2017-07-21T17:32:28Z",
      "closedAt": "2017-08-21T17:32:28Z",
      "dueAt": "2017-07-21T17:32:28Z",
      "priority": "Critical",
      "status": "Overdue",
      "htmlUrl": "https://app.codacy.com/gh/test-org/test-repo/issues?resultDataId=12345",
      "projectKey": "PUL",
      "securityCategory": "Cryptography",
      "summary": "Modern web application design incorporates a Same-Origin Policy (SOP) in order to restrict interactions between scripts loaded on the origin and resources hosted on other origins.",
      "cvssScore": "0.42",
      "cvssVector": "CVSS:3.0/AV:A/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:L/E:U/MUI:N",
      "cwe": "CWE-122",
      "affectedTargets": "https://example.com",
      "likelihood": "Low",
      "effortToFix": "High",
      "remediation": "Always ensure that the 'Access-Control-Allow-Origin' only allows specific origins."
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Returns security and risk management items. SrmItemsResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getSecurityItem

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items/{srmItemId} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items/{srmItemId} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items/{srmItemId}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items/{srmItemId}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items/{srmItemId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items/{srmItemId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items/{srmItemId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items/{srmItemId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/security/items/{srmItemId}

Returns a single security and risk management finding.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
srmItemId path string(uuid) true Id of the security and risk management item.

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "id": "ba7c836d-85f8-4617-9a95-ac6f00af1d30",
    "itemSource": "Codacy",
    "itemSourceId": "764334",
    "title": "Codacy quality - critical security issue 764334",
    "repository": "codacy-docs",
    "openedAt": "2017-07-21T17:32:28Z",
    "closedAt": "2017-08-21T17:32:28Z",
    "dueAt": "2017-07-21T17:32:28Z",
    "priority": "Critical",
    "status": "Overdue",
    "htmlUrl": "https://app.codacy.com/gh/test-org/test-repo/issues?resultDataId=12345",
    "projectKey": "PUL",
    "securityCategory": "Cryptography",
    "summary": "Modern web application design incorporates a Same-Origin Policy (SOP) in order to restrict interactions between scripts loaded on the origin and resources hosted on other origins.",
    "cvssScore": "0.42",
    "cvssVector": "CVSS:3.0/AV:A/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:L/E:U/MUI:N",
    "cwe": "CWE-122",
    "affectedTargets": "https://example.com",
    "likelihood": "Low",
    "effortToFix": "High",
    "remediation": "Always ensure that the 'Access-Control-Allow-Origin' only allows specific origins."
  }
}

Responses

Status Meaning Description Schema
200 OK Returns security and risk management items. SrmItemResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

searchSecurityItems

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items/search \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items/search HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items/search',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "repositories": [
    "string"
  ],
  "priorities": [
    "string"
  ],
  "statuses": [
    "string"
  ],
  "categories": [
    "string"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items/search',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items/search',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items/search', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items/search");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/items/search", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/security/items/search

Returns a paginated list of security and risk management items for an organization.

Body parameter

{
  "repositories": [
    "string"
  ],
  "priorities": [
    "string"
  ],
  "statuses": [
    "string"
  ],
  "categories": [
    "string"
  ]
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return
sort query string false Field to sort SRM items by.
direction query string false Sort direction. Possible values are 'asc' (ascending) or 'desc' (descending).
body body SearchSRMItems false Request body with items filters.

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl
sort Status
sort DetectedAt

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "id": "ba7c836d-85f8-4617-9a95-ac6f00af1d30",
      "itemSource": "Codacy",
      "itemSourceId": "764334",
      "title": "Codacy quality - critical security issue 764334",
      "repository": "codacy-docs",
      "openedAt": "2017-07-21T17:32:28Z",
      "closedAt": "2017-08-21T17:32:28Z",
      "dueAt": "2017-07-21T17:32:28Z",
      "priority": "Critical",
      "status": "Overdue",
      "htmlUrl": "https://app.codacy.com/gh/test-org/test-repo/issues?resultDataId=12345",
      "projectKey": "PUL",
      "securityCategory": "Cryptography",
      "summary": "Modern web application design incorporates a Same-Origin Policy (SOP) in order to restrict interactions between scripts loaded on the origin and resources hosted on other origins.",
      "cvssScore": "0.42",
      "cvssVector": "CVSS:3.0/AV:A/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:L/E:U/MUI:N",
      "cwe": "CWE-122",
      "affectedTargets": "https://example.com",
      "likelihood": "Low",
      "effortToFix": "High",
      "remediation": "Always ensure that the 'Access-Control-Allow-Origin' only allows specific origins."
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Returns security and risk management items. SrmItemsResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

getSecurityDashboard

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/security/dashboard

Deprecated: use SearchSecurityDashboard instead. Returns the metrics for the security and risk management dashboard. Repository filtering is limited to 100 names.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
repositories query string false Deprecated, use SearchOrganizationRepositoriesWithAnalysis instead
priority query array[string] false Security issue priorities to filter by. See SrmPriority for possible values.
category query array[string] false Security categories to filter by. Use _other_ to search for issues that don't have a security category.

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl
priority Low
priority Medium
priority High
priority Critical

Example responses

200 Response

{
  "data": {
    "totalOpen": 0,
    "totalClosed": 0,
    "onTrack": 0,
    "dueSoon": 0,
    "overdue": 0,
    "closedOnTime": 0,
    "closedLate": 0,
    "openCritical": 0,
    "openHigh": 0,
    "openMedium": 0,
    "openLow": 0
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation SRMDashboardResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

searchSecurityDashboard

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "repositories": [
    "string"
  ],
  "priorities": [
    "Low"
  ],
  "categories": [
    "string"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/security/dashboard

Returns the metrics for the security and risk management dashboard.

Body parameter

{
  "repositories": [
    "string"
  ],
  "priorities": [
    "Low"
  ],
  "categories": [
    "string"
  ]
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
body body SearchSRMDashboard false Request body with dashboard filters.

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "totalOpen": 0,
    "totalClosed": 0,
    "onTrack": 0,
    "dueSoon": 0,
    "overdue": 0,
    "closedOnTime": 0,
    "closedLate": 0,
    "openCritical": 0,
    "openHigh": 0,
    "openMedium": 0,
    "openLow": 0
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation SRMDashboardResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

searchSecurityDashboardRepositories

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/repositories/search \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/repositories/search HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/repositories/search',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "repositories": [
    "string"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/repositories/search',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/repositories/search',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/repositories/search', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/repositories/search");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/repositories/search", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/security/dashboard/repositories/search

Returns a list of repositories with security findings. If no filter is specified, only the 10 repositories with the most findings are returned.

Body parameter

{
  "repositories": [
    "string"
  ]
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
body body SearchSRMDashboardRepositories false Request body with filters.

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "id": 0,
      "name": "important-repo",
      "critical": 0,
      "high": 0,
      "medium": 0,
      "low": 0
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation SRMDashboardRepositoriesResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

searchSecurityDashboardHistory

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/history/search \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/history/search HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/history/search',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "repositories": [
    "string"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/history/search',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/history/search',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/history/search', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/history/search");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/history/search", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/security/dashboard/history/search

Returns the evolution of security findings over time.

Body parameter

{
  "repositories": [
    "string"
  ]
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
body body SearchSRMDashboardHistory false Request body with filters.

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "since": "2024-04-16T00:28:07.143Z",
      "until": "2024-04-16T00:28:07.143Z",
      "newCritical": 0,
      "newHigh": 0,
      "newMedium": 0,
      "newLow": 0,
      "fixedCritical": 0,
      "fixedHigh": 0,
      "fixedMedium": 0,
      "fixedLow": 0,
      "openCritical": 0,
      "openHigh": 0,
      "openMedium": 0,
      "openLow": 0
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation SRMDashboardHistoryResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

searchSecurityDashboardCategories

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/categories/search \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/categories/search HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/categories/search',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "repositories": [
    "string"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/categories/search',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/categories/search',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/categories/search', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/categories/search");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/dashboard/categories/search", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/security/dashboard/categories/search

Returns a list of security categories with findings. If no filter is specified, only the 10 categories with the most findings are returned.

Body parameter

{
  "repositories": [
    "string"
  ]
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
body body SearchSRMDashboardCategories false Request body with filters.

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "name": "Cryptography",
      "total": 0
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation SRMDashboardCategoriesResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listSecurityManagers

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/security/managers

Returns a paginated list of organization admins and security managers.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "userId": 867842577,
      "name": "John Doe",
      "email": "example@codacy.com",
      "createdAt": "2017-07-21T17:32:28Z"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Returns security managers, including organization admins. SecurityManagersResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

postSecurityManager

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "userId": 867842577
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/security/managers

Assign the Security Manager role to an organization member.

Body parameter

{
  "userId": 867842577
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
body body SecurityManagerBody true User ID of the organization member to be promoted to security manager.

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

deleteSecurityManager

Code samples

# You can also use wget
curl -X DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers/{userId} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers/{userId} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers/{userId}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers/{userId}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.delete 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers/{userId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.delete('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers/{userId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers/{userId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/managers/{userId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /organizations/{provider}/{remoteOrganizationName}/security/managers/{userId}

Revoke the Security Manager role from an organization member.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
userId path integer(int64) true Identifier of the organization member

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listSecurityRepositories

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/repositories \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/repositories HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/repositories',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/repositories',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/repositories',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/repositories', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/repositories");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/repositories", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/security/repositories

Return a list of organization repositories that have security issues.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "repositoryId": 45738,
      "provider": "gh",
      "owner": "codacy",
      "name": "codacy-eslint"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation. SecurityRepositoriesResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

listSecurityCategories

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/categories \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/categories HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/categories',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/categories',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/categories',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/categories', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/categories");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/security/categories", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/security/categories

Return a list of security subcategories that have security issues.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    "Cryptography"
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation. SecurityCategoriesResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

app

gitProviderAppPermissions

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gitProviderAppPermissions \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gitProviderAppPermissions HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gitProviderAppPermissions',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gitProviderAppPermissions',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gitProviderAppPermissions',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gitProviderAppPermissions', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gitProviderAppPermissions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gitProviderAppPermissions", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/gitProviderAppPermissions

Returns the status of the permissions required by the Codacy Git provider App installed on the organization

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "contentPermission": true
}

Responses

Status Meaning Description Schema
200 OK Successful operation. i.e. we could determine permissions. GitProviderAppPermissions
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

gate policies

setDefaultGatePolicy

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/setDefault \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/setDefault HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/setDefault',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/setDefault',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/setDefault',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/setDefault', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/setDefault");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/setDefault", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/setDefault

Set the gate policy as the default for an organization

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
gatePolicyId path integer(int64) true Identifier of the gate policy

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

setCodacyDefault

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/setCodacyDefault \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/setCodacyDefault HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/setCodacyDefault',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/setCodacyDefault',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/setCodacyDefault',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/setCodacyDefault', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/setCodacyDefault");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/setCodacyDefault", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/gate-policies/setCodacyDefault

Set the built-in Codacy gate policy as the default for an organization

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

deleteGatePolicy

Code samples

# You can also use wget
curl -X DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

DELETE https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.delete 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.delete('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}

Delete a gate policy

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
gatePolicyId path integer(int64) true Identifier of the gate policy

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

Response Headers

Status Header Type Format Description
204 X-Maturity string Experimental API. Use at your own risk.

updateGatePolicy

Code samples

# You can also use wget
curl -X PATCH https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

PATCH https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId} HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}',
  method: 'patch',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "gatePolicyName": "string",
  "isDefault": true,
  "settings": {
    "issueThreshold": {
      "threshold": 1,
      "minimumSeverity": "Error"
    },
    "securityIssueThreshold": 1,
    "duplicationThreshold": 1,
    "coverageThreshold": 1,
    "coverageThresholdWithDecimals": -0.02,
    "diffCoverageThreshold": 70,
    "complexityThreshold": 1
  }
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.patch 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.patch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}

Update a gate policy

Body parameter

{
  "gatePolicyName": "string",
  "isDefault": true,
  "settings": {
    "issueThreshold": {
      "threshold": 1,
      "minimumSeverity": "Error"
    },
    "securityIssueThreshold": 1,
    "duplicationThreshold": 1,
    "coverageThreshold": 1,
    "coverageThresholdWithDecimals": -0.02,
    "diffCoverageThreshold": 70,
    "complexityThreshold": 1
  }
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
gatePolicyId path integer(int64) true Identifier of the gate policy
body body UpdateGatePolicyBody true The new value for the name, is default option, or quality gates of the gate policy

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "id": 1,
    "name": "policy-name",
    "isDefault": true,
    "readOnly": true,
    "settings": {
      "issueThreshold": {
        "threshold": 1,
        "minimumSeverity": "Error"
      },
      "securityIssueThreshold": 1,
      "duplicationThreshold": 1,
      "coverageThreshold": 1,
      "coverageThresholdWithDecimals": -0.02,
      "diffCoverageThreshold": 70,
      "complexityThreshold": 1
    },
    "meta": {
      "nrOfQualityGates": 10,
      "linkedRepositoriesCount": 10
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation GetGatePolicyResultResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
409 Conflict Conflict Conflict
500 Internal Server Error Internal Server Error InternalServerError

Response Headers

Status Header Type Format Description
200 X-Maturity string Experimental API. Use at your own risk.

getGatePolicy

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId} \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId} HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}

Get a gate policy

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
gatePolicyId path integer(int64) true Identifier of the gate policy

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "id": 1,
    "name": "policy-name",
    "isDefault": true,
    "readOnly": true,
    "settings": {
      "issueThreshold": {
        "threshold": 1,
        "minimumSeverity": "Error"
      },
      "securityIssueThreshold": 1,
      "duplicationThreshold": 1,
      "coverageThreshold": 1,
      "coverageThresholdWithDecimals": -0.02,
      "diffCoverageThreshold": 70,
      "complexityThreshold": 1
    },
    "meta": {
      "nrOfQualityGates": 10,
      "linkedRepositoriesCount": 10
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation GetGatePolicyResultResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

Response Headers

Status Header Type Format Description
200 X-Maturity string Experimental API. Use at your own risk.

createGatePolicy

Code samples

# You can also use wget
curl -X POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

POST https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "gatePolicyName": "gate-policy-name",
  "isDefault": true,
  "settings": {
    "issueThreshold": {
      "threshold": 1,
      "minimumSeverity": "Error"
    },
    "securityIssueThreshold": 1,
    "duplicationThreshold": 1,
    "coverageThreshold": 1,
    "coverageThresholdWithDecimals": -0.02,
    "diffCoverageThreshold": 70,
    "complexityThreshold": 1
  }
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.post 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.post('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{provider}/{remoteOrganizationName}/gate-policies

Create a gate policy

Body parameter

{
  "gatePolicyName": "gate-policy-name",
  "isDefault": true,
  "settings": {
    "issueThreshold": {
      "threshold": 1,
      "minimumSeverity": "Error"
    },
    "securityIssueThreshold": 1,
    "duplicationThreshold": 1,
    "coverageThreshold": 1,
    "coverageThresholdWithDecimals": -0.02,
    "diffCoverageThreshold": 70,
    "complexityThreshold": 1
  }
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
body body CreateGatePolicyBody true Details of the gate policy to create

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": {
    "id": 1,
    "name": "policy-name",
    "isDefault": true,
    "readOnly": true,
    "settings": {
      "issueThreshold": {
        "threshold": 1,
        "minimumSeverity": "Error"
      },
      "securityIssueThreshold": 1,
      "duplicationThreshold": 1,
      "coverageThreshold": 1,
      "coverageThresholdWithDecimals": -0.02,
      "diffCoverageThreshold": 70,
      "complexityThreshold": 1
    },
    "meta": {
      "nrOfQualityGates": 10,
      "linkedRepositoriesCount": 10
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation GetGatePolicyResultResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
409 Conflict Conflict Conflict
500 Internal Server Error Internal Server Error InternalServerError

Response Headers

Status Header Type Format Description
200 X-Maturity string Experimental API. Use at your own risk.

listGatePolicies

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/gate-policies

List the gate policies for an organization

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "id": 1,
      "name": "policy-name",
      "isDefault": true,
      "readOnly": true,
      "meta": {
        "nrOfQualityGates": 10,
        "linkedRepositoriesCount": 10
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation GatePoliciesListResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

Response Headers

Status Header Type Format Description
200 X-Maturity string Experimental API. Use at your own risk.

listRepositoriesFollowingGatePolicy

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/repositories \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/repositories HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/repositories',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/repositories',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/repositories',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/repositories', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/repositories");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/repositories", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/repositories

List all repositories following a gate policy

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
gatePolicyId path integer(int64) true Identifier of the gate policy
cursor query string false Cursor to specify a batch of results to request
limit query integer(int32) false Maximum number of items to return

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

{
  "data": [
    {
      "repositoryId": 0,
      "name": "codacy-eslint"
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation ListRepositoriesFollowingGatePolicyResultResponse
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

Response Headers

Status Header Type Format Description
200 X-Maturity string Experimental API. Use at your own risk.

applyGatePolicyToRepositories

Code samples

# You can also use wget
curl -X PUT https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/repositories \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

PUT https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/repositories HTTP/1.1
Host: app.codacy.com
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/repositories',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "link": [
    "string"
  ],
  "unlink": [
    "string"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/repositories',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.put 'https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/repositories',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.put('https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/repositories', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/repositories");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://app.codacy.com/api/v3/organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/repositories", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PUT /organizations/{provider}/{remoteOrganizationName}/gate-policies/{gatePolicyId}/repositories

Apply a gate policy to a list of repositories

Link or unlink a gate policy to a list of repositories.

Body parameter

{
  "link": [
    "string"
  ],
  "unlink": [
    "string"
  ]
}

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider
gatePolicyId path integer(int64) true Identifier of the gate policy
body body ApplyGatePolicyToRepositoriesBody true none

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

400 Response

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Responses

Status Meaning Description Schema
204 No Content Successful operation None
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

Response Headers

Status Header Type Format Description
204 X-Maturity string Experimental API. Use at your own risk.

reports

getReportSecurityItems

Code samples

# You can also use wget
curl -X GET https://app.codacy.com/api/v3/reports/organizations/{provider}/{remoteOrganizationName}/security/items \
  -H 'Accept: application/json' \
  -H 'api-token: API_KEY'

GET https://app.codacy.com/api/v3/reports/organizations/{provider}/{remoteOrganizationName}/security/items HTTP/1.1
Host: app.codacy.com
Accept: application/json

var headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

$.ajax({
  url: 'https://app.codacy.com/api/v3/reports/organizations/{provider}/{remoteOrganizationName}/security/items',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'api-token':'API_KEY'

};

fetch('https://app.codacy.com/api/v3/reports/organizations/{provider}/{remoteOrganizationName}/security/items',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-token' => 'API_KEY'
}

result = RestClient.get 'https://app.codacy.com/api/v3/reports/organizations/{provider}/{remoteOrganizationName}/security/items',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'api-token': 'API_KEY'
}

r = requests.get('https://app.codacy.com/api/v3/reports/organizations/{provider}/{remoteOrganizationName}/security/items', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://app.codacy.com/api/v3/reports/organizations/{provider}/{remoteOrganizationName}/security/items");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "api-token": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.codacy.com/api/v3/reports/organizations/{provider}/{remoteOrganizationName}/security/items", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /reports/organizations/{provider}/{remoteOrganizationName}/security/items

Generate a CSV file listing all security and risk management items for an organization.

Parameters

Name In Type Required Description
provider path string true Git provider
remoteOrganizationName path string true Organization name on the Git provider

Enumerated Values

Parameter Value
provider bb
provider gh
provider gl

Example responses

200 Response

"string"

Responses

Status Meaning Description Schema
200 OK CSV file containing the security and risk management items. string
400 Bad Request Bad Request BadRequest
401 Unauthorized Unauthorized Unauthorized
403 Forbidden Forbidden Forbidden
404 Not Found Not Found NotFound
500 Internal Server Error Internal Server Error InternalServerError

Response Headers

Status Header Type Format Description
200 Transfer-Encoding string See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding .
200 Content-Disposition string See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition .

Schemas

Version

{
  "data": "string"
}

Properties

Name Type Required Restrictions Description
data string true none none

Visibility

"Private"

Visibility of the repository

Properties

Name Type Required Restrictions Description
anonymous string false none Visibility of the repository

Enumerated Values

Property Value
anonymous Public
anonymous Private
anonymous LoginPublic

RepositoryFilter

"Synced"

*Filters where to fetch the repositories from:

Properties

Name Type Required Restrictions Description
anonymous string false none Filters where to fetch the repositories from: * AllSynced - All organization's repositories in Codacy. Requires Admin access * NotSynced - All organization's repositories fetched from provider. * Synced - All organization's repositories that the user has access.

Enumerated Values

Property Value
anonymous Synced
anonymous NotSynced
anonymous AllSynced

ConfigurationStatusCategory

"database"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous database
anonymous secrets
anonymous email
anonymous github
anonymous github-enterprise
anonymous bitbucket
anonymous bitbucket-server
anonymous gitlab
anonymous gitlab-enterprise
anonymous license

Provider

"gh"

Git provider hosting the repository

Properties

Name Type Required Restrictions Description
anonymous string false none Git provider hosting the repository

Enumerated Values

Property Value
anonymous bb
anonymous gh
anonymous gl

CodacyProduct

"coverage"

Codacy product

Properties

Name Type Required Restrictions Description
anonymous string false none Codacy product

Enumerated Values

Property Value
anonymous quality
anonymous coverage

AccountProvider

"github"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous github
anonymous google
anonymous bitbucket
anonymous gitlab

commitUuid

"string"

UUID or SHA string that identifies the commit

Properties

Name Type Required Restrictions Description
anonymous string false none UUID or SHA string that identifies the commit

CommitUuidRequest

{
  "commitUuid": "string"
}

Properties

Name Type Required Restrictions Description
commitUuid commitUuid true none UUID or SHA string that identifies the commit

JoinMode

"auto"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous auto
anonymous adminAuto
anonymous request

JoinModeRequest

{
  "joinMode": "auto"
}

Properties

Name Type Required Restrictions Description
joinMode JoinMode true none none

JoinStatus

"member"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous member
anonymous pendingMember
anonymous remoteMember

SeverityLevel

"Error"

Issue severity level. (These values map to our UI as follows: Info->Minor, Warning->Medium, Error->Critical)

Properties

Name Type Required Restrictions Description
anonymous string false none Issue severity level. (These values map to our UI as follows: Info->Minor, Warning->Medium, Error->Critical)

Enumerated Values

Property Value
anonymous Info
anonymous Warning
anonymous Error

JoinResponse

{
  "organizationIdentifier": 0,
  "joinStatus": "member"
}

Properties

Name Type Required Restrictions Description
organizationIdentifier integer(int64) true none none
joinStatus JoinStatus true none none

RequestToJoin

{
  "email": "mail@mail.com",
  "name": "a display name",
  "numberOfCommits": 0,
  "numberOfRepositories": 0,
  "lastActivity": "2020-01-06T14:29:13.430Z",
  "creationDate": "2020-01-06T14:29:13.430Z"
}

Properties

Name Type Required Restrictions Description
email string true none none
name string true none none
numberOfCommits integer(int32) false none none
numberOfRepositories integer(int32) false none none
lastActivity string(date-time) false none none
creationDate string(date-time) true none none

ListRequestsToJoinResponse

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "email": "mail@mail.com",
      "name": "a display name",
      "numberOfCommits": 0,
      "numberOfRepositories": 0,
      "lastActivity": "2020-01-06T14:29:13.430Z",
      "creationDate": "2020-01-06T14:29:13.430Z"
    }
  ]
}

Properties

Name Type Required Restrictions Description
pagination PaginationInfo false none Cursor-based pagination information to obtain more items
data [RequestToJoin] true none none

UserRole

"admin"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous admin
anonymous manager
anonymous member

Permission

"admin"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous admin
anonymous write
anonymous read

AnalysisAction

"clone"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous clone
anonymous createTasks
anonymous runMetrics
anonymous runPatterns
anonymous createOverviews

FirstAnalysisOverview

{
  "action": "clone",
  "complete": false
}

Properties

Name Type Required Restrictions Description
action AnalysisAction true none none
complete boolean true none none

FirstAnalysisOverviewResponse

{
  "data": [
    {
      "action": "clone",
      "complete": false
    }
  ]
}

Properties

Name Type Required Restrictions Description
data [FirstAnalysisOverview] true none none

OrganizationType

"Organization"

The type of Organization

Properties

Name Type Required Restrictions Description
anonymous string false none The type of Organization

Enumerated Values

Property Value
anonymous Account
anonymous Organization

HealthCheck

{
  "message": "Hello, it's me"
}

Properties

Name Type Required Restrictions Description
message string true none none

HealthCheckResponse

{
  "data": {
    "message": "Hello, it's me"
  }
}

Properties

Name Type Required Restrictions Description
data HealthCheck true none none

PaginationInfo

{
  "cursor": "string",
  "limit": 0,
  "total": 0
}

Cursor-based pagination information to obtain more items

Properties

Name Type Required Restrictions Description
cursor string false none Cursor to request the next batch of results
limit integer(int32) false none Maximum number of items returned
total integer(int32) false none Total number of items returned

PaymentProvider

"stripe"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous stripe
anonymous chargebee
anonymous direct
anonymous github

User

{
  "id": 0,
  "name": "Foo",
  "mainEmail": "main@codacy.com",
  "otherEmails": [
    "foo@bar.com"
  ],
  "isAdmin": false,
  "isActive": true,
  "created": "2019-05-07T14:29:13.430Z",
  "intercomHash": "userhash",
  "zendeskHash": "userzendeskhash",
  "shouldDoClientQualification": false
}

Properties

Name Type Required Restrictions Description
id integer(int64) true none none
name string false none none
mainEmail string true none none
otherEmails [string] true none none
isAdmin boolean true none none
isActive boolean true none none
created string(date-time) true none none
intercomHash string false none none
zendeskHash string false none none
shouldDoClientQualification boolean false none none

UserResponse

{
  "data": {
    "id": 0,
    "name": "Foo",
    "mainEmail": "main@codacy.com",
    "otherEmails": [
      "foo@bar.com"
    ],
    "isAdmin": false,
    "isActive": true,
    "created": "2019-05-07T14:29:13.430Z",
    "intercomHash": "userhash",
    "zendeskHash": "userzendeskhash",
    "shouldDoClientQualification": false
  }
}

Properties

Name Type Required Restrictions Description
data User true none none

UserBody

{
  "name": "Foo",
  "shouldDoClientQualification": false
}

Properties

Name Type Required Restrictions Description
name string false none none
shouldDoClientQualification boolean false none none

Organization

{
  "identifier": 0,
  "remoteIdentifier": "string",
  "name": "FooOrganization",
  "avatar": "someRandomLink.com",
  "created": "2019-05-07T14:29:13.430Z",
  "provider": "gh",
  "joinMode": "auto",
  "type": "Organization",
  "joinStatus": "member",
  "singleProviderLogin": true
}

Properties

Name Type Required Restrictions Description
identifier integer(int64) false none none
remoteIdentifier string true none none
name string true none none
avatar string false none none
created string(date-time) false none none
provider Provider true none Git provider hosting the repository
joinMode JoinMode false none none
type OrganizationType true none The type of Organization
joinStatus JoinStatus false none none
singleProviderLogin boolean true none none

AddOrganizationResponse

{
  "organization": {
    "identifier": 0,
    "remoteIdentifier": "string",
    "name": "FooOrganization",
    "avatar": "someRandomLink.com",
    "created": "2019-05-07T14:29:13.430Z",
    "provider": "gh",
    "joinMode": "auto",
    "type": "Organization",
    "joinStatus": "member",
    "singleProviderLogin": true
  },
  "warnings": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
organization Organization true none none
warnings [string] false none none

OrganizationListResponse

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "identifier": 0,
      "remoteIdentifier": "string",
      "name": "FooOrganization",
      "avatar": "someRandomLink.com",
      "created": "2019-05-07T14:29:13.430Z",
      "provider": "gh",
      "joinMode": "auto",
      "type": "Organization",
      "joinStatus": "member",
      "singleProviderLogin": true
    }
  ]
}

Properties

Name Type Required Restrictions Description
pagination PaginationInfo false none Cursor-based pagination information to obtain more items
data [Organization] true none none

OrganizationResponse

{
  "data": {
    "identifier": 0,
    "remoteIdentifier": "string",
    "name": "FooOrganization",
    "avatar": "someRandomLink.com",
    "created": "2019-05-07T14:29:13.430Z",
    "provider": "gh",
    "joinMode": "auto",
    "type": "Organization",
    "joinStatus": "member",
    "singleProviderLogin": true
  }
}

Properties

Name Type Required Restrictions Description
data Organization true none none

Membership

{
  "userRole": "admin"
}

Properties

Name Type Required Restrictions Description
userRole UserRole true none none

Billing

{
  "isPremium": true,
  "model": "Auto",
  "code": "trial",
  "monthly": true,
  "price": 1000,
  "pricedPerUser": true
}

Properties

Name Type Required Restrictions Description
isPremium boolean true none Deprecated, use subscriptions.plan.isPremium instead.
model string true none none
code string false none Deprecated, use subscriptions.plan.code instead.
monthly boolean false none none
price integer(int64) false none none
pricedPerUser boolean false none none

Enumerated Values

Property Value
model Auto
model Manual

OrganizationBillingInformation

{
  "numberOfSeats": 42,
  "numberOfPurchasedSeats": 100,
  "paymentPlan": {
    "isPremium": true,
    "model": "Auto",
    "code": "trial",
    "monthly": true,
    "price": 1000,
    "pricedPerUser": true
  },
  "paymentGateway": "stripe",
  "priceInCents": 12020,
  "pricePerSeatInCents": 1405,
  "nextPaymentDate": "2019-05-07T14:29:13.430Z",
  "invoiceDetails": {
    "address": "Av. João Crisóstomo, nº31 - 6º, 1050-125 Lisboa",
    "email": "codacy@codacy.com"
  },
  "taxes": [
    {
      "name": "string",
      "rate": 0
    }
  ],
  "subscriptions": [
    {
      "product": "coverage",
      "plan": {
        "isPremium": true,
        "model": "Auto",
        "code": "trial",
        "monthly": true,
        "price": 1000,
        "pricedPerUser": true
      }
    }
  ]
}

Properties

Name Type Required Restrictions Description
numberOfSeats integer(int32) true none none
numberOfPurchasedSeats integer(int32) true none none
paymentPlan Billing true none Deprecated, use subscriptions.plan instead
paymentGateway PaymentProvider false none none
priceInCents integer(int32) true none Final price paid in cents, containing all taxes if there are any. For example, 12020 represents $120.20.
pricePerSeatInCents integer(int32) false none Final price paid per seat in cents, containing all taxes if there are any. For example, 1405 represents $14.05.
nextPaymentDate string(date-time) false none Next payment date for the plan. This field is empty for plans that don't renew automatically.
invoiceDetails object false none none
» address string true none Invoice address
» email string(email) true none Invoice email address
taxes [Tax] true none Taxes included in the final price priceInCents.
subscriptions [OrganizationProductBillingPlan] true none none

OrganizationBillingInformationResponse

{
  "data": {
    "numberOfSeats": 42,
    "numberOfPurchasedSeats": 100,
    "paymentPlan": {
      "isPremium": true,
      "model": "Auto",
      "code": "trial",
      "monthly": true,
      "price": 1000,
      "pricedPerUser": true
    },
    "paymentGateway": "stripe",
    "priceInCents": 12020,
    "pricePerSeatInCents": 1405,
    "nextPaymentDate": "2019-05-07T14:29:13.430Z",
    "invoiceDetails": {
      "address": "Av. João Crisóstomo, nº31 - 6º, 1050-125 Lisboa",
      "email": "codacy@codacy.com"
    },
    "taxes": [
      {
        "name": "string",
        "rate": 0
      }
    ],
    "subscriptions": [
      {
        "product": "coverage",
        "plan": {
          "isPremium": true,
          "model": "Auto",
          "code": "trial",
          "monthly": true,
          "price": 1000,
          "pricedPerUser": true
        }
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
data OrganizationBillingInformation true none none

Tax

{
  "name": "string",
  "rate": 0
}

Properties

Name Type Required Restrictions Description
name string true none Name of the tax
rate number(double) true none Rate of the tax

OrganizationProductBillingPlan

{
  "product": "coverage",
  "plan": {
    "isPremium": true,
    "model": "Auto",
    "code": "trial",
    "monthly": true,
    "price": 1000,
    "pricedPerUser": true
  }
}

Properties

Name Type Required Restrictions Description
product CodacyProduct true none Codacy product
plan Billing false none none

OrganizationPaywall

{
  "organizationDashboard": true
}

Properties

Name Type Required Restrictions Description
organizationDashboard boolean true none none

ProductPaywall

{
  "securityDashboard": true
}

Properties

Name Type Required Restrictions Description
securityDashboard boolean true none none

Paywall

{
  "organizationDashboard": true,
  "securityDashboard": true
}

Deprecated, use ProductPaywall and OrganizationPaywall instead.

Properties

Name Type Required Restrictions Description
organizationDashboard boolean true none Deprecated, use OrganizationPaywall instead.
securityDashboard boolean true none Deprecated, use subscriptions.paywall.securityDashboard instead.

OrganizationWithMeta

{
  "organization": {
    "identifier": 0,
    "remoteIdentifier": "string",
    "name": "FooOrganization",
    "avatar": "someRandomLink.com",
    "created": "2019-05-07T14:29:13.430Z",
    "provider": "gh",
    "joinMode": "auto",
    "type": "Organization",
    "joinStatus": "member",
    "singleProviderLogin": true
  },
  "membership": {
    "userRole": "admin"
  },
  "billing": {
    "isPremium": true,
    "model": "Auto",
    "code": "trial",
    "monthly": true,
    "price": 1000,
    "pricedPerUser": true
  },
  "paywall": {
    "organizationDashboard": true,
    "securityDashboard": true
  },
  "organizationPayWall": {
    "organizationDashboard": true
  },
  "analysisConfigurationMinimumPermission": "admin",
  "subscriptions": [
    {
      "product": "coverage",
      "plan": {
        "isPremium": true,
        "code": "string"
      },
      "paywall": {
        "securityDashboard": true
      }
    }
  ]
}

Properties

Name Type Required Restrictions Description
organization Organization true none none
membership Membership true none none
billing Billing false none none
paywall Paywall false none Deprecated, use ProductPaywall and OrganizationPaywall instead.
organizationPayWall OrganizationPaywall false none none
analysisConfigurationMinimumPermission Permission true none none
subscriptions [ProductSubscription] true none none

ProductSubscription

{
  "product": "coverage",
  "plan": {
    "isPremium": true,
    "code": "string"
  },
  "paywall": {
    "securityDashboard": true
  }
}

Properties

Name Type Required Restrictions Description
product CodacyProduct true none Codacy product
plan OrganizationBillingPlan false none none
paywall ProductPaywall false none none

OrganizationBillingPlan

{
  "isPremium": true,
  "code": "string"
}

Properties

Name Type Required Restrictions Description
isPremium boolean true none none
code string true none none

OrganizationWithMetaResponse

{
  "data": {
    "organization": {
      "identifier": 0,
      "remoteIdentifier": "string",
      "name": "FooOrganization",
      "avatar": "someRandomLink.com",
      "created": "2019-05-07T14:29:13.430Z",
      "provider": "gh",
      "joinMode": "auto",
      "type": "Organization",
      "joinStatus": "member",
      "singleProviderLogin": true
    },
    "membership": {
      "userRole": "admin"
    },
    "billing": {
      "isPremium": true,
      "model": "Auto",
      "code": "trial",
      "monthly": true,
      "price": 1000,
      "pricedPerUser": true
    },
    "paywall": {
      "organizationDashboard": true,
      "securityDashboard": true
    },
    "organizationPayWall": {
      "organizationDashboard": true
    },
    "analysisConfigurationMinimumPermission": "admin",
    "subscriptions": [
      {
        "product": "coverage",
        "plan": {
          "isPremium": true,
          "code": "string"
        },
        "paywall": {
          "securityDashboard": true
        }
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
data OrganizationWithMeta true none none

Integration

{
  "provider": "github",
  "lastAuthenticated": "2019-05-07T14:29:13.430Z"
}

Properties

Name Type Required Restrictions Description
provider AccountProvider true none none
lastAuthenticated string(date-time) true none none

IntegrationListResponse

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "provider": "github",
      "lastAuthenticated": "2019-05-07T14:29:13.430Z"
    }
  ]
}

Properties

Name Type Required Restrictions Description
pagination PaginationInfo false none Cursor-based pagination information to obtain more items
data [Integration] true none none

RepositorySummary

{
  "repositoryId": 45738,
  "provider": "gh",
  "owner": "codacy",
  "name": "codacy-eslint"
}

Essential information to describe a repository.

Properties

Name Type Required Restrictions Description
repositoryId integer(int64) false none Codacy identifier for this repository.
provider Provider true none Git provider hosting the repository
owner string true none Name of the organization that owns the repository.
name string true none Name of the repository.

Repository

{
  "repositoryId": 45738,
  "provider": "gh",
  "owner": "codacy",
  "name": "codacy-eslint",
  "fullPath": "codacy/codacy-eslint",
  "visibility": "Private",
  "remoteIdentifier": "3",
  "lastUpdated": "2019-05-07T14:29:13.430Z",
  "permission": "admin",
  "problems": [
    {
      "message": "We can't analyze this repository because none of the committers are part of the organization.",
      "actions": [
        {
          "name": "Check our documentation",
          "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
        }
      ],
      "code": "failed_to_clone",
      "severity": "all_analysis"
    }
  ],
  "languages": [
    "Java",
    "Scala",
    "CSS"
  ],
  "defaultBranch": {
    "id": 1,
    "name": "master",
    "isDefault": true,
    "isEnabled": true,
    "lastUpdated": "2019-05-07T14:29:13.430Z",
    "branchType": "Branch",
    "lastCommit": "string"
  },
  "badges": {
    "grade": "https://app.codacy.com/project/badge/Grade/d992a862b1994805907ec277e16b0fda",
    "coverage": "https://app.codacy.com/project/badge/Coverage/d992a862b1994805907ec277e16b0fda"
  },
  "codingStandardId": 0,
  "codingStandardName": "string",
  "addedState": "Added",
  "gatePolicyId": 0,
  "gatePolicyName": "string"
}

Properties

allOf

Name Type Required Restrictions Description
anonymous RepositorySummary false none Essential information to describe a repository.

and

Name Type Required Restrictions Description
anonymous object false none none
» fullPath string false none Full path of the repository on the Git provider
» visibility Visibility true none Visibility of the repository
» remoteIdentifier string false none Unique identifier of the repository on the Git provider
» lastUpdated string(date-time) false none Timestamp when the repository was last updated, depending on the Git provider
» permission Permission false none none
» problems [RepositoryProblem] true none none
» languages [string] true none List of the languages in the repository
» defaultBranch Branch false none none
» badges Badges false none none
» codingStandardId integer(int64) false none Coding Standard identifier
» codingStandardName string false none Coding Standard name
» addedState AddedState true none Added state of the repository on Codacy. The possible values are NotAdded (the repository wasn't added to Codacy), Added (the repository was added to Codacy), or Following (the current user is following a repository added to Codacy).
» gatePolicyId integer(int64) false none Identifier of the gate policy the repository is following. If not defined, the repository doesn't follow a gate policy.
» gatePolicyName string false none Name of the gate policy the repository is following. Present only if the gatePolicyId is defined.

AddedState

"Added"

Added state of the repository on Codacy. The possible values are NotAdded (the repository wasn't added to Codacy), Added (the repository was added to Codacy), or Following (the current user is following a repository added to Codacy).

Properties

Name Type Required Restrictions Description
anonymous string false none Added state of the repository on Codacy. The possible values are NotAdded (the repository wasn't added to Codacy), Added (the repository was added to Codacy), or Following (the current user is following a repository added to Codacy).

Enumerated Values

Property Value
anonymous NotAdded
anonymous Added
anonymous Following

AddedStateResponse

{
  "data": "Added"
}

Properties

Name Type Required Restrictions Description
data AddedState true none Added state of the repository on Codacy. The possible values are NotAdded (the repository wasn't added to Codacy), Added (the repository was added to Codacy), or Following (the current user is following a repository added to Codacy).

Badges

{
  "grade": "https://app.codacy.com/project/badge/Grade/d992a862b1994805907ec277e16b0fda",
  "coverage": "https://app.codacy.com/project/badge/Coverage/d992a862b1994805907ec277e16b0fda"
}

Properties

Name Type Required Restrictions Description
grade string true none Repository grade badge URL
coverage string true none Repository coverage badge URL

RepositoryResponse

{
  "data": {
    "repositoryId": 45738,
    "provider": "gh",
    "owner": "codacy",
    "name": "codacy-eslint",
    "fullPath": "codacy/codacy-eslint",
    "visibility": "Private",
    "remoteIdentifier": "3",
    "lastUpdated": "2019-05-07T14:29:13.430Z",
    "permission": "admin",
    "problems": [
      {
        "message": "We can't analyze this repository because none of the committers are part of the organization.",
        "actions": [
          {
            "name": "Check our documentation",
            "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
          }
        ],
        "code": "failed_to_clone",
        "severity": "all_analysis"
      }
    ],
    "languages": [
      "Java",
      "Scala",
      "CSS"
    ],
    "defaultBranch": {
      "id": 1,
      "name": "master",
      "isDefault": true,
      "isEnabled": true,
      "lastUpdated": "2019-05-07T14:29:13.430Z",
      "branchType": "Branch",
      "lastCommit": "string"
    },
    "badges": {
      "grade": "https://app.codacy.com/project/badge/Grade/d992a862b1994805907ec277e16b0fda",
      "coverage": "https://app.codacy.com/project/badge/Coverage/d992a862b1994805907ec277e16b0fda"
    },
    "codingStandardId": 0,
    "codingStandardName": "string",
    "addedState": "Added",
    "gatePolicyId": 0,
    "gatePolicyName": "string"
  }
}

Properties

Name Type Required Restrictions Description
data Repository true none none

Commit

{
  "sha": "string",
  "id": 1,
  "commitTimestamp": "2019-05-07T14:29:13.430Z",
  "authorName": "string",
  "authorEmail": "string",
  "message": "string",
  "startedAnalysis": "2022-01-07T14:29:13.430Z",
  "endedAnalysis": "2022-01-07T14:29:13.430Z",
  "isMergeCommit": false,
  "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
  "parents": [
    "string"
  ]
}

Properties

allOf

Name Type Required Restrictions Description
anonymous CommitIdentification false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» id integer(int64) true none Internal commit identifier
» commitTimestamp string(date-time) true none Timestamp when the commit was created
» authorName string false none Name of the commit author
» authorEmail string false none Email address of the commit author
» message string false none Commit message
» startedAnalysis string(date-time) false none Timestamp when Codacy started the last analysis of the commit
» endedAnalysis string(date-time) false none Timestamp when Codacy finished the last analysis of the commit
» isMergeCommit boolean false none True if the commit is a merge commit
» gitHref string false none URL to the commit on the Git provider
» parents [string] false none none

CommitWithAnalysis

{
  "commit": {
    "sha": "string",
    "id": 1,
    "commitTimestamp": "2019-05-07T14:29:13.430Z",
    "authorName": "string",
    "authorEmail": "string",
    "message": "string",
    "startedAnalysis": "2022-01-07T14:29:13.430Z",
    "endedAnalysis": "2022-01-07T14:29:13.430Z",
    "isMergeCommit": false,
    "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
    "parents": [
      "string"
    ]
  },
  "coverage": {
    "totalCoveragePercentage": 93.23,
    "deltaCoveragePercentage": 15.25,
    "isUpToStandards": true,
    "resultReasons": [
      {
        "gate": "string",
        "expected": -1,
        "expectedThreshold": {
          "threshold": 0,
          "minimumSeverity": "Error"
        },
        "isUpToStandards": true
      }
    ]
  },
  "quality": {
    "newIssues": 1,
    "fixedIssues": 1,
    "deltaComplexity": 1,
    "deltaClonesCount": 1,
    "isUpToStandards": true,
    "resultReasons": [
      {
        "gate": "string",
        "expected": -1,
        "expectedThreshold": {
          "threshold": 0,
          "minimumSeverity": "Error"
        },
        "isUpToStandards": true
      }
    ]
  },
  "meta": {
    "analyzable": true,
    "reason": "string"
  }
}

Properties

Name Type Required Restrictions Description
commit Commit true none none
coverage CoverageAnalysis false none none
quality QualityAnalysis false none none
meta AnalysisMeta true none Commit analysis information

CommitWithAnalysisListResponse

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "commit": {
        "sha": "string",
        "id": 1,
        "commitTimestamp": "2019-05-07T14:29:13.430Z",
        "authorName": "string",
        "authorEmail": "string",
        "message": "string",
        "startedAnalysis": "2022-01-07T14:29:13.430Z",
        "endedAnalysis": "2022-01-07T14:29:13.430Z",
        "isMergeCommit": false,
        "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
        "parents": [
          "string"
        ]
      },
      "coverage": {
        "totalCoveragePercentage": 93.23,
        "deltaCoveragePercentage": 15.25,
        "isUpToStandards": true,
        "resultReasons": [
          {
            "gate": "string",
            "expected": -1,
            "expectedThreshold": {
              "threshold": 0,
              "minimumSeverity": "Error"
            },
            "isUpToStandards": true
          }
        ]
      },
      "quality": {
        "newIssues": 1,
        "fixedIssues": 1,
        "deltaComplexity": 1,
        "deltaClonesCount": 1,
        "isUpToStandards": true,
        "resultReasons": [
          {
            "gate": "string",
            "expected": -1,
            "expectedThreshold": {
              "threshold": 0,
              "minimumSeverity": "Error"
            },
            "isUpToStandards": true
          }
        ]
      },
      "meta": {
        "analyzable": true,
        "reason": "string"
      }
    }
  ]
}

Properties

Name Type Required Restrictions Description
pagination PaginationInfo false none Cursor-based pagination information to obtain more items
data [CommitWithAnalysis] true none none

CommitWithBranches

{
  "sha": "string",
  "id": 1,
  "commitTimestamp": "2019-05-07T14:29:13.430Z",
  "authorName": "string",
  "authorEmail": "string",
  "message": "string",
  "startedAnalysis": "2022-01-07T14:29:13.430Z",
  "endedAnalysis": "2022-01-07T14:29:13.430Z",
  "isMergeCommit": false,
  "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
  "parents": [
    "string"
  ],
  "branches": [
    {
      "id": 1,
      "name": "master",
      "isDefault": true,
      "isEnabled": true,
      "lastUpdated": "2019-05-07T14:29:13.430Z",
      "branchType": "Branch",
      "lastCommit": "string"
    }
  ]
}

Properties

allOf

Name Type Required Restrictions Description
anonymous Commit false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» branches [Branch] false none List of branches containing the commit

FileAnalysisListResponse

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "file": {
        "branchId": 1,
        "commitId": 1,
        "commitSha": "string",
        "fileId": 1,
        "fileDataId": 1,
        "path": "/src/test.go",
        "language": "Go",
        "gitProviderUrl": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2"
      },
      "coverage": {
        "deltaCoverage": -2.35,
        "totalCoverage": -2.35
      },
      "quality": {
        "deltaNewIssues": 1,
        "deltaFixedIssues": 1,
        "deltaComplexity": 1,
        "deltaClonesCount": 1
      },
      "comparedWithCommit": {
        "commitId": 1,
        "coverage": {
          "totalCoverage": 82.35
        }
      }
    }
  ]
}

List of files with analysis results changes between two commits

Properties

Name Type Required Restrictions Description
pagination PaginationInfo false none Cursor-based pagination information to obtain more items
data [FileDeltaAnalysis] false none [File with analysis results changes between two commits]

FileDeltaAnalysis

{
  "file": {
    "branchId": 1,
    "commitId": 1,
    "commitSha": "string",
    "fileId": 1,
    "fileDataId": 1,
    "path": "/src/test.go",
    "language": "Go",
    "gitProviderUrl": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2"
  },
  "coverage": {
    "deltaCoverage": -2.35,
    "totalCoverage": -2.35
  },
  "quality": {
    "deltaNewIssues": 1,
    "deltaFixedIssues": 1,
    "deltaComplexity": 1,
    "deltaClonesCount": 1
  },
  "comparedWithCommit": {
    "commitId": 1,
    "coverage": {
      "totalCoverage": 82.35
    }
  }
}

File with analysis results changes between two commits

Properties

Name Type Required Restrictions Description
file FileMetadata true none Metadata for a file in a repository
coverage FileDeltaCoverageAnalysis false none Coverage changes for a file between two commits
quality FileDeltaQualityAnalysis false none Quality changes for a file between two commits
comparedWithCommit object false none Original analysis results for the file
» commitId integer(int64) true none none
» coverage object false none none
»» totalCoverage number(double) false none Total coverage of the commit

FileDeltaCoverageAnalysis

{
  "deltaCoverage": -2.35,
  "totalCoverage": -2.35
}

Coverage changes for a file between two commits

Properties

Name Type Required Restrictions Description
deltaCoverage number(double) false none Difference in code coverage percentage when compared to the parent commit
totalCoverage number(double) false none The total coverage percentage for a given commit

FileDeltaQualityAnalysis

{
  "deltaNewIssues": 1,
  "deltaFixedIssues": 1,
  "deltaComplexity": 1,
  "deltaClonesCount": 1
}

Quality changes for a file between two commits

Properties

Name Type Required Restrictions Description
deltaNewIssues integer(int32) true none Number of issues introduced by the commit
deltaFixedIssues integer(int32) true none Number of issues fixed by the commit
deltaComplexity integer(int32) false none Difference in cyclomatic complexity introduced by the commit
deltaClonesCount integer(int32) false none Difference in number of duplicated blocks of code introduced by the commit

RepositoryListResponse

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "repositoryId": 45738,
      "provider": "gh",
      "owner": "codacy",
      "name": "codacy-eslint",
      "fullPath": "codacy/codacy-eslint",
      "visibility": "Private",
      "remoteIdentifier": "3",
      "lastUpdated": "2019-05-07T14:29:13.430Z",
      "permission": "admin",
      "problems": [
        {
          "message": "We can't analyze this repository because none of the committers are part of the organization.",
          "actions": [
            {
              "name": "Check our documentation",
              "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
            }
          ],
          "code": "failed_to_clone",
          "severity": "all_analysis"
        }
      ],
      "languages": [
        "Java",
        "Scala",
        "CSS"
      ],
      "defaultBranch": {
        "id": 1,
        "name": "master",
        "isDefault": true,
        "isEnabled": true,
        "lastUpdated": "2019-05-07T14:29:13.430Z",
        "branchType": "Branch",
        "lastCommit": "string"
      },
      "badges": {
        "grade": "https://app.codacy.com/project/badge/Grade/d992a862b1994805907ec277e16b0fda",
        "coverage": "https://app.codacy.com/project/badge/Coverage/d992a862b1994805907ec277e16b0fda"
      },
      "codingStandardId": 0,
      "codingStandardName": "string",
      "addedState": "Added",
      "gatePolicyId": 0,
      "gatePolicyName": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
pagination PaginationInfo false none Cursor-based pagination information to obtain more items
data [Repository] true none none

OrganizationOnboardingStep

{
  "step": "addRepositories | enableStatusChecks",
  "isCompleted": true
}

Properties

Name Type Required Restrictions Description
step string true none Identifier of the onboarding step
isCompleted boolean true none none

OrganizationOnboardingProgressResponse

{
  "data": [
    {
      "step": "addRepositories | enableStatusChecks",
      "isCompleted": true
    }
  ]
}

Properties

Name Type Required Restrictions Description
data [OrganizationOnboardingStep] true none Completeness status of each onboarding step

{
  "name": "Check our documentation",
  "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
}

Properties

Name Type Required Restrictions Description
name string true none none
url string true none none

RepositoryProblem

{
  "message": "We can't analyze this repository because none of the committers are part of the organization.",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "code": "failed_to_clone",
  "severity": "all_analysis"
}

Properties

Name Type Required Restrictions Description
message string true none none
actions [ProblemLink] true none none
code string true none A stable identifier for a problem.
severity string true none The extent to which this problem affects the repository in terms of analysis execution.

RepositoryWithAnalysis

{
  "lastAnalysedCommit": {
    "sha": "string",
    "id": 1,
    "commitTimestamp": "2019-05-07T14:29:13.430Z",
    "authorName": "string",
    "authorEmail": "string",
    "message": "string",
    "startedAnalysis": "2022-01-07T14:29:13.430Z",
    "endedAnalysis": "2022-01-07T14:29:13.430Z",
    "isMergeCommit": false,
    "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
    "parents": [
      "string"
    ]
  },
  "grade": 74,
  "gradeLetter": "A",
  "issuesPercentage": 1,
  "complexFilesPercentage": 1,
  "duplicationPercentage": 1,
  "repository": {
    "repositoryId": 45738,
    "provider": "gh",
    "owner": "codacy",
    "name": "codacy-eslint",
    "fullPath": "codacy/codacy-eslint",
    "visibility": "Private",
    "remoteIdentifier": "3",
    "lastUpdated": "2019-05-07T14:29:13.430Z",
    "permission": "admin",
    "problems": [
      {
        "message": "We can't analyze this repository because none of the committers are part of the organization.",
        "actions": [
          {
            "name": "Check our documentation",
            "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
          }
        ],
        "code": "failed_to_clone",
        "severity": "all_analysis"
      }
    ],
    "languages": [
      "Java",
      "Scala",
      "CSS"
    ],
    "defaultBranch": {
      "id": 1,
      "name": "master",
      "isDefault": true,
      "isEnabled": true,
      "lastUpdated": "2019-05-07T14:29:13.430Z",
      "branchType": "Branch",
      "lastCommit": "string"
    },
    "badges": {
      "grade": "https://app.codacy.com/project/badge/Grade/d992a862b1994805907ec277e16b0fda",
      "coverage": "https://app.codacy.com/project/badge/Coverage/d992a862b1994805907ec277e16b0fda"
    },
    "codingStandardId": 0,
    "codingStandardName": "string",
    "addedState": "Added",
    "gatePolicyId": 0,
    "gatePolicyName": "string"
  },
  "branch": {
    "id": 1,
    "name": "master",
    "isDefault": true,
    "isEnabled": true,
    "lastUpdated": "2019-05-07T14:29:13.430Z",
    "branchType": "Branch",
    "lastCommit": "string"
  },
  "selectedBranch": {
    "id": 1,
    "name": "master",
    "isDefault": true,
    "isEnabled": true,
    "lastUpdated": "2019-05-07T14:29:13.430Z",
    "branchType": "Branch",
    "lastCommit": "string"
  },
  "coverage": {
    "filesUncovered": 1,
    "filesWithLowCoverage": 1,
    "coveragePercentage": 1,
    "coveragePercentageWithDecimals": 15.25,
    "numberTotalFiles": 1,
    "numberCoveredLines": 1,
    "numberCoverableLines": 1
  }
}

Properties

Name Type Required Restrictions Description
lastAnalysedCommit Commit false none none
grade integer(int32) false none Quality grade of the file as a number between 100 (highest grade) and 0 (lowest grade)
gradeLetter string false none Quality grade of the file as a letter between A (highest grade) and F (lowest grade)
issuesPercentage integer(int64) false none none
complexFilesPercentage integer(int64) false none none
duplicationPercentage integer(int64) false none none
repository Repository true none none
branch Branch false none none
selectedBranch Branch false none none
coverage Coverage false none none

RepositoryWithAnalysisResponse

{
  "data": {
    "lastAnalysedCommit": {
      "sha": "string",
      "id": 1,
      "commitTimestamp": "2019-05-07T14:29:13.430Z",
      "authorName": "string",
      "authorEmail": "string",
      "message": "string",
      "startedAnalysis": "2022-01-07T14:29:13.430Z",
      "endedAnalysis": "2022-01-07T14:29:13.430Z",
      "isMergeCommit": false,
      "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
      "parents": [
        "string"
      ]
    },
    "grade": 74,
    "gradeLetter": "A",
    "issuesPercentage": 1,
    "complexFilesPercentage": 1,
    "duplicationPercentage": 1,
    "repository": {
      "repositoryId": 45738,
      "provider": "gh",
      "owner": "codacy",
      "name": "codacy-eslint",
      "fullPath": "codacy/codacy-eslint",
      "visibility": "Private",
      "remoteIdentifier": "3",
      "lastUpdated": "2019-05-07T14:29:13.430Z",
      "permission": "admin",
      "problems": [
        {
          "message": "We can't analyze this repository because none of the committers are part of the organization.",
          "actions": [
            {
              "name": "Check our documentation",
              "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
            }
          ],
          "code": "failed_to_clone",
          "severity": "all_analysis"
        }
      ],
      "languages": [
        "Java",
        "Scala",
        "CSS"
      ],
      "defaultBranch": {
        "id": 1,
        "name": "master",
        "isDefault": true,
        "isEnabled": true,
        "lastUpdated": "2019-05-07T14:29:13.430Z",
        "branchType": "Branch",
        "lastCommit": "string"
      },
      "badges": {
        "grade": "https://app.codacy.com/project/badge/Grade/d992a862b1994805907ec277e16b0fda",
        "coverage": "https://app.codacy.com/project/badge/Coverage/d992a862b1994805907ec277e16b0fda"
      },
      "codingStandardId": 0,
      "codingStandardName": "string",
      "addedState": "Added",
      "gatePolicyId": 0,
      "gatePolicyName": "string"
    },
    "branch": {
      "id": 1,
      "name": "master",
      "isDefault": true,
      "isEnabled": true,
      "lastUpdated": "2019-05-07T14:29:13.430Z",
      "branchType": "Branch",
      "lastCommit": "string"
    },
    "selectedBranch": {
      "id": 1,
      "name": "master",
      "isDefault": true,
      "isEnabled": true,
      "lastUpdated": "2019-05-07T14:29:13.430Z",
      "branchType": "Branch",
      "lastCommit": "string"
    },
    "coverage": {
      "filesUncovered": 1,
      "filesWithLowCoverage": 1,
      "coveragePercentage": 1,
      "coveragePercentageWithDecimals": 15.25,
      "numberTotalFiles": 1,
      "numberCoveredLines": 1,
      "numberCoverableLines": 1
    }
  }
}

Properties

Name Type Required Restrictions Description
data RepositoryWithAnalysis true none none

RepositoryWithAnalysisListResponse

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "lastAnalysedCommit": {
        "sha": "string",
        "id": 1,
        "commitTimestamp": "2019-05-07T14:29:13.430Z",
        "authorName": "string",
        "authorEmail": "string",
        "message": "string",
        "startedAnalysis": "2022-01-07T14:29:13.430Z",
        "endedAnalysis": "2022-01-07T14:29:13.430Z",
        "isMergeCommit": false,
        "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
        "parents": [
          "string"
        ]
      },
      "grade": 74,
      "gradeLetter": "A",
      "issuesPercentage": 1,
      "complexFilesPercentage": 1,
      "duplicationPercentage": 1,
      "repository": {
        "repositoryId": 45738,
        "provider": "gh",
        "owner": "codacy",
        "name": "codacy-eslint",
        "fullPath": "codacy/codacy-eslint",
        "visibility": "Private",
        "remoteIdentifier": "3",
        "lastUpdated": "2019-05-07T14:29:13.430Z",
        "permission": "admin",
        "problems": [
          {
            "message": "We can't analyze this repository because none of the committers are part of the organization.",
            "actions": [
              {
                "name": "Check our documentation",
                "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
              }
            ],
            "code": "failed_to_clone",
            "severity": "all_analysis"
          }
        ],
        "languages": [
          "Java",
          "Scala",
          "CSS"
        ],
        "defaultBranch": {
          "id": 1,
          "name": "master",
          "isDefault": true,
          "isEnabled": true,
          "lastUpdated": "2019-05-07T14:29:13.430Z",
          "branchType": "Branch",
          "lastCommit": "string"
        },
        "badges": {
          "grade": "https://app.codacy.com/project/badge/Grade/d992a862b1994805907ec277e16b0fda",
          "coverage": "https://app.codacy.com/project/badge/Coverage/d992a862b1994805907ec277e16b0fda"
        },
        "codingStandardId": 0,
        "codingStandardName": "string",
        "addedState": "Added",
        "gatePolicyId": 0,
        "gatePolicyName": "string"
      },
      "branch": {
        "id": 1,
        "name": "master",
        "isDefault": true,
        "isEnabled": true,
        "lastUpdated": "2019-05-07T14:29:13.430Z",
        "branchType": "Branch",
        "lastCommit": "string"
      },
      "selectedBranch": {
        "id": 1,
        "name": "master",
        "isDefault": true,
        "isEnabled": true,
        "lastUpdated": "2019-05-07T14:29:13.430Z",
        "branchType": "Branch",
        "lastCommit": "string"
      },
      "coverage": {
        "filesUncovered": 1,
        "filesWithLowCoverage": 1,
        "coveragePercentage": 1,
        "coveragePercentageWithDecimals": 15.25,
        "numberTotalFiles": 1,
        "numberCoveredLines": 1,
        "numberCoverableLines": 1
      }
    }
  ]
}

Properties

Name Type Required Restrictions Description
pagination PaginationInfo false none Cursor-based pagination information to obtain more items
data [RepositoryWithAnalysis] true none none

PullRequestOwner

{
  "name": "Foo",
  "avatarUrl": "https://example.com/foo",
  "username": "foo.bar",
  "email": "foobar@example.com"
}

Properties

Name Type Required Restrictions Description
name string true none none
avatarUrl string false none none
username string false none none
email string false none none

PullRequest

{
  "id": 1,
  "number": 1,
  "updated": "2019-05-07T14:29:13.430Z",
  "status": "open",
  "repository": "awesome-repository",
  "title": "Amazing pull request",
  "owner": {
    "name": "Foo",
    "avatarUrl": "https://example.com/foo",
    "username": "foo.bar",
    "email": "foobar@example.com"
  },
  "headCommitSha": "2957025d42e8daadf937d4044516f991d21deea4",
  "commonAncestorCommitSha": "3357025d42e8daadf937d4044516f991d21deea4",
  "originBranch": "feat-branch",
  "targetBranch": "master",
  "gitHref": "https://github.com/..."
}

Properties

Name Type Required Restrictions Description
id integer(int64) true none none
number integer(int32) true none none
updated string(date-time) true none none
status string true none Pull request status
repository string true none none
title string true none none
owner PullRequestOwner true none none
headCommitSha string true none none
commonAncestorCommitSha string true none none
originBranch string false none none
targetBranch string false none none
gitHref string true none URL to the pull request on the Git provider

DiffCoverage

{
  "value": 71,
  "coveredLines": 11,
  "coverableLines": 21,
  "cause": "NoCoverableLines"
}

Properties

Name Type Required Restrictions Description
value number(double) false none Coverage value of the lines added or modified by the pull request
coveredLines integer(int32) false none Number of covered lines from the lines added or modified by the pull request
coverableLines integer(int32) false none Number of coverable lines from the lines added or modified by the pull request
cause string true none Rationale for diffCoverage value interpretation

Enumerated Values

Property Value
cause ValueIsPresent
cause NoCoverableLines
cause MissingRequirements

AnalysisMeta

{
  "analyzable": true,
  "reason": "string"
}

Properties

Name Type Required Restrictions Description
analyzable boolean true none none
reason string false none none

QualityAnalysis

{
  "newIssues": 1,
  "fixedIssues": 1,
  "deltaComplexity": 1,
  "deltaClonesCount": 1,
  "isUpToStandards": true,
  "resultReasons": [
    {
      "gate": "string",
      "expected": -1,
      "expectedThreshold": {
        "threshold": 0,
        "minimumSeverity": "Error"
      },
      "isUpToStandards": true
    }
  ]
}

Properties

Name Type Required Restrictions Description
newIssues integer(int32) false none Number of issues introduced by the pull request or commit
fixedIssues integer(int32) false none Number of issues fixed by the pull request or commit
deltaComplexity integer(int32) false none Difference in cyclomatic complexity introduced by the pull request or commit
deltaClonesCount integer(int32) false none Difference in number of duplicated blocks of code introduced by the pull request or commit
isUpToStandards boolean false none True if metrics are at or above gate thresholds
resultReasons [AnalysisResultReason] false none Reasons for the results of quality analysis

PullRequestCoverage

{
  "deltaCoverage": 71,
  "diffCoverage": {
    "value": 71,
    "coveredLines": 11,
    "coverableLines": 21,
    "cause": "NoCoverableLines"
  },
  "isUpToStandards": true,
  "resultReasons": [
    {
      "gate": "string",
      "expected": -1,
      "expectedThreshold": {
        "threshold": 0,
        "minimumSeverity": "Error"
      },
      "isUpToStandards": true
    }
  ]
}

Properties

Name Type Required Restrictions Description
deltaCoverage number(double) false none Difference between the coverage of the head commit and common ancestor commit of the pull request
diffCoverage DiffCoverage false none Coverage of the lines added or modified by the pull request
isUpToStandards boolean false none True if coverage metrics are at or above gate thresholds
resultReasons [AnalysisResultReason] false none Reasons for the results of coverage analysis

PullRequestWithCoverageResponse

{
  "data": {
    "pullRequest": {
      "id": 1,
      "number": 1,
      "updated": "2019-05-07T14:29:13.430Z",
      "status": "open",
      "repository": "awesome-repository",
      "title": "Amazing pull request",
      "owner": {
        "name": "Foo",
        "avatarUrl": "https://example.com/foo",
        "username": "foo.bar",
        "email": "foobar@example.com"
      },
      "headCommitSha": "2957025d42e8daadf937d4044516f991d21deea4",
      "commonAncestorCommitSha": "3357025d42e8daadf937d4044516f991d21deea4",
      "originBranch": "feat-branch",
      "targetBranch": "master",
      "gitHref": "https://github.com/..."
    },
    "coverage": {
      "deltaCoverage": 71,
      "diffCoverage": {
        "value": 71,
        "coveredLines": 11,
        "coverableLines": 21,
        "cause": "NoCoverableLines"
      },
      "isUpToStandards": true,
      "resultReasons": [
        {
          "gate": "string",
          "expected": -1,
          "expectedThreshold": {
            "threshold": 0,
            "minimumSeverity": "Error"
          },
          "isUpToStandards": true
        }
      ]
    }
  }
}

Properties

Name Type Required Restrictions Description
data PullRequestWithCoverage true none none

PullRequestWithCoverage

{
  "pullRequest": {
    "id": 1,
    "number": 1,
    "updated": "2019-05-07T14:29:13.430Z",
    "status": "open",
    "repository": "awesome-repository",
    "title": "Amazing pull request",
    "owner": {
      "name": "Foo",
      "avatarUrl": "https://example.com/foo",
      "username": "foo.bar",
      "email": "foobar@example.com"
    },
    "headCommitSha": "2957025d42e8daadf937d4044516f991d21deea4",
    "commonAncestorCommitSha": "3357025d42e8daadf937d4044516f991d21deea4",
    "originBranch": "feat-branch",
    "targetBranch": "master",
    "gitHref": "https://github.com/..."
  },
  "coverage": {
    "deltaCoverage": 71,
    "diffCoverage": {
      "value": 71,
      "coveredLines": 11,
      "coverableLines": 21,
      "cause": "NoCoverableLines"
    },
    "isUpToStandards": true,
    "resultReasons": [
      {
        "gate": "string",
        "expected": -1,
        "expectedThreshold": {
          "threshold": 0,
          "minimumSeverity": "Error"
        },
        "isUpToStandards": true
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
pullRequest PullRequest true none none
coverage PullRequestCoverage true none Coverage information for a pull request

PullRequestFilesCoverageResponse

{
  "data": [
    {
      "fileName": "string",
      "coverage": 0,
      "variation": 0,
      "diff": {
        "value": 71,
        "coveredLines": 11,
        "coverableLines": 21,
        "cause": "NoCoverableLines"
      },
      "diffLineHits": [
        {
          "lineNumber": "string",
          "hits": 0
        }
      ]
    }
  ]
}

Properties

Name Type Required Restrictions Description
data [FileDiffCoverage] true none none

FileDiffCoverage

{
  "fileName": "string",
  "coverage": 0,
  "variation": 0,
  "diff": {
    "value": 71,
    "coveredLines": 11,
    "coverableLines": 21,
    "cause": "NoCoverableLines"
  },
  "diffLineHits": [
    {
      "lineNumber": "string",
      "hits": 0
    }
  ]
}

Properties

Name Type Required Restrictions Description
fileName string true none none
coverage number true none none
variation number false none none
diff DiffCoverage false none none
diffLineHits [DiffLineHit] true none none

DiffLineHit

{
  "lineNumber": "string",
  "hits": 0
}

Properties

Name Type Required Restrictions Description
lineNumber string true none none
hits integer(int64) true none none

PullRequestWithAnalysis

{
  "isUpToStandards": true,
  "isAnalysing": false,
  "pullRequest": {
    "id": 1,
    "number": 1,
    "updated": "2019-05-07T14:29:13.430Z",
    "status": "open",
    "repository": "awesome-repository",
    "title": "Amazing pull request",
    "owner": {
      "name": "Foo",
      "avatarUrl": "https://example.com/foo",
      "username": "foo.bar",
      "email": "foobar@example.com"
    },
    "headCommitSha": "2957025d42e8daadf937d4044516f991d21deea4",
    "commonAncestorCommitSha": "3357025d42e8daadf937d4044516f991d21deea4",
    "originBranch": "feat-branch",
    "targetBranch": "master",
    "gitHref": "https://github.com/..."
  },
  "newIssues": 1,
  "fixedIssues": 1,
  "deltaComplexity": 1,
  "deltaClonesCount": 1,
  "deltaCoverageWithDecimals": 71,
  "deltaCoverage": 1,
  "diffCoverage": 71,
  "coverage": {
    "deltaCoverage": 71,
    "diffCoverage": {
      "value": 71,
      "coveredLines": 11,
      "coverableLines": 21,
      "cause": "NoCoverableLines"
    },
    "isUpToStandards": true,
    "resultReasons": [
      {
        "gate": "string",
        "expected": -1,
        "expectedThreshold": {
          "threshold": 0,
          "minimumSeverity": "Error"
        },
        "isUpToStandards": true
      }
    ]
  },
  "quality": {
    "newIssues": 1,
    "fixedIssues": 1,
    "deltaComplexity": 1,
    "deltaClonesCount": 1,
    "isUpToStandards": true,
    "resultReasons": [
      {
        "gate": "string",
        "expected": -1,
        "expectedThreshold": {
          "threshold": 0,
          "minimumSeverity": "Error"
        },
        "isUpToStandards": true
      }
    ]
  },
  "meta": {
    "analyzable": true,
    "reason": "string"
  }
}

Properties

Name Type Required Restrictions Description
isUpToStandards boolean false none True if metrics are at or above gate thresholds
isAnalysing boolean true none none
pullRequest PullRequest true none none
newIssues integer(int32) false none Number of issues introduced by the pull request
fixedIssues integer(int32) false none Number of issues fixed by the pull request
deltaComplexity integer(int32) false none Difference in cyclomatic complexity introduced by the pull request
deltaClonesCount integer(int32) false none Difference in number of duplicated blocks of code introduced by the pull request
deltaCoverageWithDecimals number(double) false none Deprecated, use coverage instead
deltaCoverage integer(int32) false none Deprecated, use coverage instead
diffCoverage number(double) false none Deprecated, use coverage instead
coverage PullRequestCoverage false none Coverage information for a pull request
quality QualityAnalysis false none Quality information for a pull request
meta AnalysisMeta true none Pull Request analysis information

PullRequestWithAnalysisListResponse

{
  "data": [
    {
      "isUpToStandards": true,
      "isAnalysing": false,
      "pullRequest": {
        "id": 1,
        "number": 1,
        "updated": "2019-05-07T14:29:13.430Z",
        "status": "open",
        "repository": "awesome-repository",
        "title": "Amazing pull request",
        "owner": {
          "name": "Foo",
          "avatarUrl": "https://example.com/foo",
          "username": "foo.bar",
          "email": "foobar@example.com"
        },
        "headCommitSha": "2957025d42e8daadf937d4044516f991d21deea4",
        "commonAncestorCommitSha": "3357025d42e8daadf937d4044516f991d21deea4",
        "originBranch": "feat-branch",
        "targetBranch": "master",
        "gitHref": "https://github.com/..."
      },
      "newIssues": 1,
      "fixedIssues": 1,
      "deltaComplexity": 1,
      "deltaClonesCount": 1,
      "deltaCoverageWithDecimals": 71,
      "deltaCoverage": 1,
      "diffCoverage": 71,
      "coverage": {
        "deltaCoverage": 71,
        "diffCoverage": {
          "value": 71,
          "coveredLines": 11,
          "coverableLines": 21,
          "cause": "NoCoverableLines"
        },
        "isUpToStandards": true,
        "resultReasons": [
          {
            "gate": "string",
            "expected": -1,
            "expectedThreshold": {
              "threshold": 0,
              "minimumSeverity": "Error"
            },
            "isUpToStandards": true
          }
        ]
      },
      "quality": {
        "newIssues": 1,
        "fixedIssues": 1,
        "deltaComplexity": 1,
        "deltaClonesCount": 1,
        "isUpToStandards": true,
        "resultReasons": [
          {
            "gate": "string",
            "expected": -1,
            "expectedThreshold": {
              "threshold": 0,
              "minimumSeverity": "Error"
            },
            "isUpToStandards": true
          }
        ]
      },
      "meta": {
        "analyzable": true,
        "reason": "string"
      }
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Properties

Name Type Required Restrictions Description
data [PullRequestWithAnalysis] true none none
pagination PaginationInfo false none Cursor-based pagination information to obtain more items

CategoryIssues

{
  "categoryId": 1,
  "numberOfIssues": 100
}

Properties

Name Type Required Restrictions Description
categoryId integer(int64) true none none
numberOfIssues integer(int64) true none none

CommitAnalysisStats

{
  "repositoryId": 1,
  "commitId": 1,
  "numberIssues": 1,
  "numberLoc": 1,
  "issuesPerCategory": [
    {
      "categoryId": 1,
      "numberOfIssues": 100
    }
  ],
  "issuePercentage": 1,
  "totalComplexity": 1,
  "numberComplexFiles": 1,
  "complexFilesPercentage": 1,
  "filesChangedToIncreaseComplexity": 1,
  "numberDuplicatedLines": 1,
  "duplicationPercentage": 1,
  "coveragePercentage": 1,
  "coveragePercentageWithDecimals": 15.25,
  "numberFilesUncovered": 1,
  "techDebt": 1,
  "totalFilesAdded": 1,
  "totalFilesRemoved": 1,
  "totalFilesChanged": 1,
  "commitTimestamp": "2019-05-07T14:29:13.430Z",
  "commitAuthorName": "Mike The Developer",
  "commitShortUUID": "00d3079ed"
}

Properties

Name Type Required Restrictions Description
repositoryId integer(int64) true none none
commitId integer(int64) true none none
numberIssues integer(int64) true none none
numberLoc integer(int64) true none none
issuesPerCategory [CategoryIssues] true none none
issuePercentage integer(int64) true none none
totalComplexity integer(int64) false none none
numberComplexFiles integer(int64) false none none
complexFilesPercentage integer(int64) false none none
filesChangedToIncreaseComplexity integer(int64) false none none
numberDuplicatedLines integer(int64) false none none
duplicationPercentage integer(int64) false none none
coveragePercentage integer(int64) false none Test coverage percentage, truncated. Present only if a coverage report was processed for this commit.
coveragePercentageWithDecimals number(double) false none Test coverage percentage. Present only if a coverage report was processed for this commit.
numberFilesUncovered integer(int64) false none none
techDebt integer(int64) true none none
totalFilesAdded integer(int64) true none none
totalFilesRemoved integer(int64) true none none
totalFilesChanged integer(int64) true none none
commitTimestamp string(date-time) true none none
commitAuthorName string true none none
commitShortUUID string true none none

CommitAnalysisStatsListResponse

{
  "data": [
    {
      "repositoryId": 1,
      "commitId": 1,
      "numberIssues": 1,
      "numberLoc": 1,
      "issuesPerCategory": [
        {
          "categoryId": 1,
          "numberOfIssues": 100
        }
      ],
      "issuePercentage": 1,
      "totalComplexity": 1,
      "numberComplexFiles": 1,
      "complexFilesPercentage": 1,
      "filesChangedToIncreaseComplexity": 1,
      "numberDuplicatedLines": 1,
      "duplicationPercentage": 1,
      "coveragePercentage": 1,
      "coveragePercentageWithDecimals": 15.25,
      "numberFilesUncovered": 1,
      "techDebt": 1,
      "totalFilesAdded": 1,
      "totalFilesRemoved": 1,
      "totalFilesChanged": 1,
      "commitTimestamp": "2019-05-07T14:29:13.430Z",
      "commitAuthorName": "Mike The Developer",
      "commitShortUUID": "00d3079ed"
    }
  ]
}

Properties

Name Type Required Restrictions Description
data [CommitAnalysisStats] true none none

PatternDetails

{
  "id": "accessor-pairs",
  "title": "string",
  "category": "Security",
  "subCategory": "XSS",
  "level": "Error",
  "severityLevel": "Error"
}

Details of the pattern that was identified in the issue

Properties

Name Type Required Restrictions Description
id string true none Pattern identifier (unique per tool)
title string false none Pattern title
category string true none Pattern category
subCategory string false none Pattern subcategory (optional since some patterns might not have a subcategory)
level string true none Deprecated, use severityLevel instead
severityLevel SeverityLevel true none Issue severity level. (These values map to our UI as follows: Info->Minor, Warning->Medium, Error->Critical)

Enumerated Values

Property Value
level Info
level Warning
level Error

ToolReference

{
  "uuid": "847feb32-9ff2-11ea-bb37-0242ac130002",
  "name": "ESLint"
}

Details of the tool that found the issue

Properties

Name Type Required Restrictions Description
uuid string true none Tool unique identifier
name string true none Name of the tool

CommitIdentification

{
  "sha": "string"
}

Properties

Name Type Required Restrictions Description
sha string true none Commit SHA

CommitReference

{
  "sha": "string",
  "commiter": "string",
  "commiterName": "string",
  "timestamp": "2019-05-07T14:29:13.430Z"
}

Details of the commit that introduced the issue or null if the issue was introduced in a commit that Codacy didn't analyze

Properties

allOf

Name Type Required Restrictions Description
anonymous CommitIdentification false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» commiter string false none Email address of the author of the commit
» commiterName string false none Name of the author of the commit
» timestamp string(date-time) false none Time and date of the commit

CommitIssue

{
  "issueId": "string",
  "resultDataId": 0,
  "filePath": "string",
  "fileId": 0,
  "patternInfo": {
    "id": "accessor-pairs",
    "title": "string",
    "category": "Security",
    "subCategory": "XSS",
    "level": "Error",
    "severityLevel": "Error"
  },
  "toolInfo": {
    "uuid": "847feb32-9ff2-11ea-bb37-0242ac130002",
    "name": "ESLint"
  },
  "lineNumber": 0,
  "message": "string",
  "suggestion": "string",
  "language": "string",
  "lineText": "string",
  "commitInfo": {
    "sha": "string",
    "commiter": "string",
    "commiterName": "string",
    "timestamp": "2019-05-07T14:29:13.430Z"
  }
}

Issue details including the commit that originated the issue

Properties

Name Type Required Restrictions Description
issueId string true none ID of the Issue
resultDataId integer(int64) true none Stable ID for the issue.
filePath string true none Path of the file where the issue was found
fileId integer(int64) true none none
patternInfo PatternDetails true none Details of the pattern that was identified in the issue
toolInfo ToolReference true none Details of the tool that found the issue
lineNumber integer(int64) true none Line where the issue was found
message string true none Detailed cause of the issue
suggestion string false none The suggested fix for the issue
language string true none Language of the file where the issue was found
lineText string true none Contents of the line where the issue was found
commitInfo CommitReference false none Details of the commit that introduced the issue or null if the issue was introduced in a commit that Codacy didn't analyze

DeltaType

"Added"

Specifies if the issue was added or fixed by the commit

Properties

Name Type Required Restrictions Description
anonymous string false none Specifies if the issue was added or fixed by the commit

Enumerated Values

Property Value
anonymous Added
anonymous Fixed

CommitDeltaIssue

{
  "commitIssue": {
    "issueId": "string",
    "resultDataId": 0,
    "filePath": "string",
    "fileId": 0,
    "patternInfo": {
      "id": "accessor-pairs",
      "title": "string",
      "category": "Security",
      "subCategory": "XSS",
      "level": "Error",
      "severityLevel": "Error"
    },
    "toolInfo": {
      "uuid": "847feb32-9ff2-11ea-bb37-0242ac130002",
      "name": "ESLint"
    },
    "lineNumber": 0,
    "message": "string",
    "suggestion": "string",
    "language": "string",
    "lineText": "string",
    "commitInfo": {
      "sha": "string",
      "commiter": "string",
      "commiterName": "string",
      "timestamp": "2019-05-07T14:29:13.430Z"
    }
  },
  "deltaType": "Added"
}

Details of an issue that was added or fixed by a commit

Properties

Name Type Required Restrictions Description
commitIssue CommitIssue true none Issue details including the commit that originated the issue
deltaType DeltaType true none Specifies if the issue was added or fixed by the commit

CommitDeltaIssuesResponse

{
  "analyzed": true,
  "data": [
    {
      "commitIssue": {
        "issueId": "string",
        "resultDataId": 0,
        "filePath": "string",
        "fileId": 0,
        "patternInfo": {
          "id": "accessor-pairs",
          "title": "string",
          "category": "Security",
          "subCategory": "XSS",
          "level": "Error",
          "severityLevel": "Error"
        },
        "toolInfo": {
          "uuid": "847feb32-9ff2-11ea-bb37-0242ac130002",
          "name": "ESLint"
        },
        "lineNumber": 0,
        "message": "string",
        "suggestion": "string",
        "language": "string",
        "lineText": "string",
        "commitInfo": {
          "sha": "string",
          "commiter": "string",
          "commiterName": "string",
          "timestamp": "2019-05-07T14:29:13.430Z"
        }
      },
      "deltaType": "Added"
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

List of issues added or fixed on a commit

Properties

Name Type Required Restrictions Description
analyzed boolean true none True if Codacy already analyzed the commit
data [CommitDeltaIssue] true none List of issues added or fixed on a commit or an empty list if Codacy didn't analyze the commit yet.
pagination PaginationInfo false none Cursor-based pagination information to obtain more items

IssueStatus

"all"

Issue resolution status

Properties

Name Type Required Restrictions Description
anonymous string false none Issue resolution status

Enumerated Values

Property Value
anonymous all
anonymous new
anonymous fixed

IgnoredIssue

{
  "issueId": "string",
  "filePath": "string",
  "fileId": 0,
  "patternInfo": {
    "id": "accessor-pairs",
    "title": "string",
    "category": "Security",
    "subCategory": "XSS",
    "level": "Error",
    "severityLevel": "Error"
  },
  "toolInfo": {
    "uuid": "847feb32-9ff2-11ea-bb37-0242ac130002",
    "name": "ESLint"
  },
  "lineNumber": 0,
  "message": "string",
  "language": "string",
  "lineText": "string",
  "commitInfo": {
    "sha": "string",
    "commiter": "string",
    "commiterName": "string",
    "timestamp": "2019-05-07T14:29:13.430Z"
  }
}

Ignored issue details including the commit that originated the issue

Properties

Name Type Required Restrictions Description
issueId string true none ID of the Issue
filePath string true none Path of the file where the issue was found and ignored
fileId integer(int64) false none none
patternInfo PatternDetails true none Details of the pattern that was identified in the issue
toolInfo ToolReference true none Details of the tool that found the issue
lineNumber integer(int64) false none Line where the issue was found
message string true none Detailed cause of the ignored issue
language string true none Language of the file where the ignored issue was found
lineText string true none Contents of the line where the ignored issue was found
commitInfo CommitReference false none Details of the commit that introduced the issue or null if the issue was introduced in a commit that Codacy didn't analyze

IgnoredIssuesListResponse

{
  "data": [
    {
      "issueId": "string",
      "filePath": "string",
      "fileId": 0,
      "patternInfo": {
        "id": "accessor-pairs",
        "title": "string",
        "category": "Security",
        "subCategory": "XSS",
        "level": "Error",
        "severityLevel": "Error"
      },
      "toolInfo": {
        "uuid": "847feb32-9ff2-11ea-bb37-0242ac130002",
        "name": "ESLint"
      },
      "lineNumber": 0,
      "message": "string",
      "language": "string",
      "lineText": "string",
      "commitInfo": {
        "sha": "string",
        "commiter": "string",
        "commiterName": "string",
        "timestamp": "2019-05-07T14:29:13.430Z"
      }
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Properties

Name Type Required Restrictions Description
data [IgnoredIssue] true none [Ignored issue details including the commit that originated the issue]
pagination PaginationInfo false none Cursor-based pagination information to obtain more items

SearchRepositoryIssuesListResponse

{
  "data": [
    {
      "issueId": "string",
      "resultDataId": 0,
      "filePath": "string",
      "fileId": 0,
      "patternInfo": {
        "id": "accessor-pairs",
        "title": "string",
        "category": "Security",
        "subCategory": "XSS",
        "level": "Error",
        "severityLevel": "Error"
      },
      "toolInfo": {
        "uuid": "847feb32-9ff2-11ea-bb37-0242ac130002",
        "name": "ESLint"
      },
      "lineNumber": 0,
      "message": "string",
      "suggestion": "string",
      "language": "string",
      "lineText": "string",
      "commitInfo": {
        "sha": "string",
        "commiter": "string",
        "commiterName": "string",
        "timestamp": "2019-05-07T14:29:13.430Z"
      }
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Properties

Name Type Required Restrictions Description
data [CommitIssue] true none [Issue details including the commit that originated the issue]
pagination PaginationInfo false none Cursor-based pagination information to obtain more items

GetIssueResponse

{
  "data": {
    "issueId": "string",
    "resultDataId": 0,
    "filePath": "string",
    "fileId": 0,
    "patternInfo": {
      "id": "accessor-pairs",
      "title": "string",
      "category": "Security",
      "subCategory": "XSS",
      "level": "Error",
      "severityLevel": "Error"
    },
    "toolInfo": {
      "uuid": "847feb32-9ff2-11ea-bb37-0242ac130002",
      "name": "ESLint"
    },
    "lineNumber": 0,
    "message": "string",
    "suggestion": "string",
    "language": "string",
    "lineText": "string",
    "commitInfo": {
      "sha": "string",
      "commiter": "string",
      "commiterName": "string",
      "timestamp": "2019-05-07T14:29:13.430Z"
    }
  }
}

Properties

Name Type Required Restrictions Description
data CommitIssue true none Issue details including the commit that originated the issue

CommitDeltaStatistics

{
  "commitUuid": "string",
  "newIssues": 0,
  "fixedIssues": 0,
  "deltaComplexity": 0,
  "deltaCoverage": 0,
  "deltaCoverageWithDecimals": 71,
  "deltaClonesCount": 0,
  "analyzed": true
}

Delta quality metrics for a commit

Properties

Name Type Required Restrictions Description
commitUuid string true none Unique identifier of the commit
newIssues integer(int32) true none Number of issues introduced by the commit
fixedIssues integer(int32) true none Number of issues fixed by the commit
deltaComplexity integer(int32) false none Difference in cyclomatic complexity when compared to the previous commit
deltaCoverage integer(int32) false none Difference in code coverage percentage when compared to the previous commit
deltaCoverageWithDecimals number(double) false none Difference in code coverage with decimals percentage when compared to the previous commit
deltaClonesCount integer(int32) false none Difference in number of duplicated blocks of code when compared to the previous commit
analyzed boolean true none True if the commit was already analyzed by Codacy

IssuesOverviewResponse

{
  "data": {
    "counts": {
      "categories": [
        {
          "name": "string",
          "total": 0
        }
      ],
      "languages": [
        {
          "name": "string",
          "total": 0
        }
      ],
      "levels": [
        {
          "name": "string",
          "total": 0
        }
      ],
      "patterns": [
        {
          "id": "string",
          "title": "string",
          "total": 0
        }
      ],
      "authors": [
        {
          "name": "string",
          "total": 0
        }
      ]
    }
  }
}

Properties

Name Type Required Restrictions Description
data IssuesOverview true none Overview of the issues in a repository

IssuesOverview

{
  "counts": {
    "categories": [
      {
        "name": "string",
        "total": 0
      }
    ],
    "languages": [
      {
        "name": "string",
        "total": 0
      }
    ],
    "levels": [
      {
        "name": "string",
        "total": 0
      }
    ],
    "patterns": [
      {
        "id": "string",
        "title": "string",
        "total": 0
      }
    ],
    "authors": [
      {
        "name": "string",
        "total": 0
      }
    ]
  }
}

Overview of the issues in a repository

Properties

Name Type Required Restrictions Description
counts IssuesOverviewCounts true none Overview of the issues in a repository

IssuesOverviewCounts

{
  "categories": [
    {
      "name": "string",
      "total": 0
    }
  ],
  "languages": [
    {
      "name": "string",
      "total": 0
    }
  ],
  "levels": [
    {
      "name": "string",
      "total": 0
    }
  ],
  "patterns": [
    {
      "id": "string",
      "title": "string",
      "total": 0
    }
  ],
  "authors": [
    {
      "name": "string",
      "total": 0
    }
  ]
}

Overview of the issues in a repository

Properties

Name Type Required Restrictions Description
categories [Count] true none Number of issues per category
languages [Count] true none Number of issues per language
levels [Count] true none Number of issues per severity level
patterns [PatternsCount] true none Number of issues per code pattern
authors [Count] true none Number of issues per commit author

Count

{
  "name": "string",
  "total": 0
}

Properties

Name Type Required Restrictions Description
name string true none none
total integer(int32) true none none

PatternsCount

{
  "id": "string",
  "title": "string",
  "total": 0
}

Number of issues detected by a code pattern

Properties

Name Type Required Restrictions Description
id string true none Identifier of the code pattern
title string true none Title of the code pattern
total integer(int32) true none Number of issues detected by the code pattern

Branch

{
  "id": 1,
  "name": "master",
  "isDefault": true,
  "isEnabled": true,
  "lastUpdated": "2019-05-07T14:29:13.430Z",
  "branchType": "Branch",
  "lastCommit": "string"
}

Properties

Name Type Required Restrictions Description
id integer(int64) true none none
name string true none none
isDefault boolean true none none
isEnabled boolean true none none
lastUpdated string(date-time) false none none
branchType string true none none
lastCommit string false none none

Enumerated Values

Property Value
branchType Branch
branchType PullRequest

BranchListResponse

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "id": 1,
      "name": "master",
      "isDefault": true,
      "isEnabled": true,
      "lastUpdated": "2019-05-07T14:29:13.430Z",
      "branchType": "Branch",
      "lastCommit": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
pagination PaginationInfo false none Cursor-based pagination information to obtain more items
data [Branch] true none none

UpdateRepositoryBranchConfigurationBody

{
  "isEnabled": true
}

Configuration of a repository branch

Properties

Name Type Required Restrictions Description
isEnabled boolean false none True if Codacy should analyze the branch

Coverage

{
  "filesUncovered": 1,
  "filesWithLowCoverage": 1,
  "coveragePercentage": 1,
  "coveragePercentageWithDecimals": 15.25,
  "numberTotalFiles": 1,
  "numberCoveredLines": 1,
  "numberCoverableLines": 1
}

Properties

Name Type Required Restrictions Description
filesUncovered integer(int64) false none none
filesWithLowCoverage integer(int64) false none none
coveragePercentage integer(int64) false none Test coverage percentage, truncated. Present only if a coverage report was processed for the most recent commit on the relevant branch.
coveragePercentageWithDecimals number(double) false none Test coverage percentage. Present only if a coverage report was processed for the most recent commit on the relevant branch.
numberTotalFiles integer(int32) false none none
numberCoveredLines integer(int32) false none none
numberCoverableLines integer(int32) false none none

CoverageAnalysis

{
  "totalCoveragePercentage": 93.23,
  "deltaCoveragePercentage": 15.25,
  "isUpToStandards": true,
  "resultReasons": [
    {
      "gate": "string",
      "expected": -1,
      "expectedThreshold": {
        "threshold": 0,
        "minimumSeverity": "Error"
      },
      "isUpToStandards": true
    }
  ]
}

Properties

Name Type Required Restrictions Description
totalCoveragePercentage number(double) false none Total coverage percentage at the requested commit
deltaCoveragePercentage number(double) false none Difference in coverage between two commits, expressed in percentage points
isUpToStandards boolean false none True if coverage metrics are at or above gate thresholds
resultReasons [AnalysisResultReason] false none Reasons for the results of coverage analysis

AnalysisExpectedThreshold

{
  "threshold": 0,
  "minimumSeverity": "Error"
}

Expected threshold for the given gate

Properties

Name Type Required Restrictions Description
threshold number true none Threshold configured for the given gate
minimumSeverity SeverityLevel false none Issue severity level. (These values map to our UI as follows: Info->Minor, Warning->Medium, Error->Critical)

AnalysisResultReason

{
  "gate": "string",
  "expected": -1,
  "expectedThreshold": {
    "threshold": 0,
    "minimumSeverity": "Error"
  },
  "isUpToStandards": true
}

Reason for an analysis result for a quality gate

Properties

Name Type Required Restrictions Description
gate string true none Name of the quality gate
expected number false none Deprecated, use expectedThreshold instead. It is the threshold value configured for the quality gate
expectedThreshold AnalysisExpectedThreshold true none Expected threshold for the given gate
isUpToStandards boolean true none True if the value passes the quality gate

UpdateGatePolicyBody

{
  "gatePolicyName": "string",
  "isDefault": true,
  "settings": {
    "issueThreshold": {
      "threshold": 1,
      "minimumSeverity": "Error"
    },
    "securityIssueThreshold": 1,
    "duplicationThreshold": 1,
    "coverageThreshold": 1,
    "coverageThresholdWithDecimals": -0.02,
    "diffCoverageThreshold": 70,
    "complexityThreshold": 1
  }
}

Properties

Name Type Required Restrictions Description
gatePolicyName string false none Name of the gate policy
isDefault boolean false none True if the gate policy is the default for the organization
settings QualityGate false none none

QualityGate

{
  "issueThreshold": {
    "threshold": 1,
    "minimumSeverity": "Error"
  },
  "securityIssueThreshold": 1,
  "duplicationThreshold": 1,
  "coverageThreshold": 1,
  "coverageThresholdWithDecimals": -0.02,
  "diffCoverageThreshold": 70,
  "complexityThreshold": 1
}

Properties

Name Type Required Restrictions Description
issueThreshold object false none The quality gate will fail if there are new issues of the specified severity over this threshold (if no severity is specified all severity levels are considered). This value cannot be negative
» threshold integer(int32) true none none
» minimumSeverity SeverityLevel false none Issue severity level. (These values map to our UI as follows: Info->Minor, Warning->Medium, Error->Critical)
securityIssueThreshold integer(int32) false none The quality gate will fail if the number of new security issues is over this threshold. This value cannot be negative
duplicationThreshold integer(int32) false none The quality gate will fail if there are new duplicated blocks over this threshold
coverageThreshold integer(int32) false none Deprecated, use coverageThresholdWithDecimals instead
coverageThresholdWithDecimals number(double) false none The quality gate will fail if coverage percentage varies less than this threshold. This value should be at most 1.00
diffCoverageThreshold integer(int32) false none The quality gate will fail if diff coverage is under this threshold. This value should be at least 0 and at most 100
complexityThreshold integer(int32) false none The quality gate will fail if the complexity value is over this threshold. This value cannot be negative

RepositoryGatePolicy

{
  "id": 0,
  "name": "string"
}

Gate policy the repository is following.

Properties

Name Type Required Restrictions Description
id integer(int64) true none Identifier of the gate policy
name string true none Name of the gate policy

QualitySettingsResponse

{
  "data": {
    "qualityGate": {
      "issueThreshold": {
        "threshold": 1,
        "minimumSeverity": "Error"
      },
      "securityIssueThreshold": 1,
      "duplicationThreshold": 1,
      "coverageThreshold": 1,
      "coverageThresholdWithDecimals": -0.02,
      "diffCoverageThreshold": 70,
      "complexityThreshold": 1
    },
    "repositoryGatePolicyInfo": {
      "id": 0,
      "name": "string"
    }
  }
}

Properties

Name Type Required Restrictions Description
data QualitySettingsWithGatePolicy true none none

QualitySettingsWithGatePolicy

{
  "qualityGate": {
    "issueThreshold": {
      "threshold": 1,
      "minimumSeverity": "Error"
    },
    "securityIssueThreshold": 1,
    "duplicationThreshold": 1,
    "coverageThreshold": 1,
    "coverageThresholdWithDecimals": -0.02,
    "diffCoverageThreshold": 70,
    "complexityThreshold": 1
  },
  "repositoryGatePolicyInfo": {
    "id": 0,
    "name": "string"
  }
}

Properties

Name Type Required Restrictions Description
qualityGate QualityGate true none none
repositoryGatePolicyInfo RepositoryGatePolicy false none Gate policy the repository is following.

BuildServerAnalysisSettingRequest

{
  "buildServerAnalysisSetting": true
}

Properties

Name Type Required Restrictions Description
buildServerAnalysisSetting boolean true none If true, Codacy waits for your build server to upload the results of the local analysis before resuming the analysis of your commits. If false, Codacy analyzes your commits directly on its cloud infrastructure.

BuildServerAnalysisSettingResponse

{
  "buildServerAnalysisSetting": true
}

Properties

Name Type Required Restrictions Description
buildServerAnalysisSetting boolean true none If true, Codacy waits for your build server to upload the results of the local analysis before resuming the analysis of your commits. If false, Codacy analyzes your commits directly on its cloud infrastructure.

CheckSubmodulesResponse

{
  "data": true
}

Properties

Name Type Required Restrictions Description
data boolean true none True if the submodules option is enabled for the organization, false otherwise.

SyncProviderSettingResponse

{
  "name": "codacy-eslint",
  "visibility": "Private"
}

Properties

Name Type Required Restrictions Description
name string true none Name of the repository
visibility Visibility true none Visibility of the repository

SyncProviderSettingOrganizationResponse

{
  "name": "troubleshoot-codacy"
}

Properties

Name Type Required Restrictions Description
name string true none Synced name of the organization

SshKeySettingResponse

{
  "publicSshKey": "string"
}

Properties

Name Type Required Restrictions Description
publicSshKey string true none Public SSH key

DeprecatedRepositoryQualitySettings

{
  "issueThreshold": 1,
  "duplicationThreshold": 1,
  "coverageThreshold": 1,
  "complexityThreshold": 1,
  "fileDuplicationThreshold": 1,
  "fileComplexityThreshold": 1
}

Properties

Name Type Required Restrictions Description
issueThreshold integer(int32) false none The repository will be considered unhealthy if the percentage of issues is over this threshold
duplicationThreshold integer(int32) false none The repository will be considered unhealthy if the percentage of duplication of files is over this threshold
coverageThreshold integer(int32) false none The repository will be considered unhealthy if the coverage percentage is under this threshold
complexityThreshold integer(int32) false none The repository will be considered unhealthy if the percentage of complexity of files is over this threshold
fileDuplicationThreshold integer(int32) false none A file in this repository will be considered duplicated when the number of cloned blocks is over this threshold
fileComplexityThreshold integer(int32) false none A file in this repository will be considered complex when its complexity value is over this threshold

RepositoryQualitySettings

{
  "maxIssuePercentage": 1,
  "maxDuplicatedFilesPercentage": 1,
  "minCoveragePercentage": 1,
  "maxComplexFilesPercentage": 1,
  "fileDuplicationBlockThreshold": 1,
  "fileComplexityValueThreshold": 1
}

Properties

Name Type Required Restrictions Description
maxIssuePercentage integer(int32) false none The repository will be considered unhealthy if the percentage of issues is over this threshold
maxDuplicatedFilesPercentage integer(int32) false none The repository will be considered unhealthy if the percentage of duplication of files is over this threshold
minCoveragePercentage integer(int32) false none The repository will be considered unhealthy if the coverage percentage is under this threshold
maxComplexFilesPercentage integer(int32) false none The repository will be considered unhealthy if the percentage of complexity of files is over this threshold
fileDuplicationBlockThreshold integer(int32) false none A file in this repository will be considered duplicated when the number of cloned blocks is over this threshold. This value cannot be negative
fileComplexityValueThreshold integer(int32) false none A file in this repository will be considered complex when its complexity value is over this threshold. This value cannot be negative

DeprecatedRepositoryQualitySettingsResponse

{
  "data": {
    "issueThreshold": 1,
    "duplicationThreshold": 1,
    "coverageThreshold": 1,
    "complexityThreshold": 1,
    "fileDuplicationThreshold": 1,
    "fileComplexityThreshold": 1
  }
}

Properties

Name Type Required Restrictions Description
data DeprecatedRepositoryQualitySettings true none none

RepositoryQualitySettingsResponse

{
  "data": {
    "maxIssuePercentage": 1,
    "maxDuplicatedFilesPercentage": 1,
    "minCoveragePercentage": 1,
    "maxComplexFilesPercentage": 1,
    "fileDuplicationBlockThreshold": 1,
    "fileComplexityValueThreshold": 1
  }
}

Properties

Name Type Required Restrictions Description
data RepositoryQualitySettings true none none

ApiToken

{
  "id": 0,
  "token": "string"
}

API token string value and ID

Properties

Name Type Required Restrictions Description
id integer(int64) true none none
token string true none none

ApiTokenResponse

{
  "data": {
    "id": 0,
    "token": "string"
  }
}

Properties

Name Type Required Restrictions Description
data ApiToken true none API token string value and ID

ApiTokenListResponse

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "id": 0,
      "token": "string"
    }
  ]
}

List of API tokens

Properties

Name Type Required Restrictions Description
pagination PaginationInfo false none Cursor-based pagination information to obtain more items
data [ApiToken] true none [API token string value and ID]

ProviderIntegration

{
  "provider": "github",
  "redirectUrl": "string"
}

Properties

Name Type Required Restrictions Description
provider AccountProvider true none none
redirectUrl string true none none

ProviderIntegrationListResponse

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "provider": "github",
      "redirectUrl": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
pagination PaginationInfo false none Cursor-based pagination information to obtain more items
data [ProviderIntegration] true none none

ConfiguredLoginIntegration

{
  "provider": "github",
  "loginUrl": "string"
}

Properties

Name Type Required Restrictions Description
provider AccountProvider true none none
loginUrl string true none none

ConfiguredLoginIntegrationListResponse

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "provider": "github",
      "loginUrl": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
pagination PaginationInfo false none Cursor-based pagination information to obtain more items
data [ConfiguredLoginIntegration] true none none

ConfigurationStatus

{
  "title": "string",
  "category": "database",
  "errors": [
    "string"
  ],
  "link": "string"
}

Properties

Name Type Required Restrictions Description
title string true none none
category ConfigurationStatusCategory true none none
errors [string] true none none
link string false none none

ConfigurationStatusResponse

{
  "statuses": [
    {
      "title": "string",
      "category": "database",
      "errors": [
        "string"
      ],
      "link": "string"
    }
  ],
  "metadata": {
    "firstSignupDone": true
  }
}

Properties

Name Type Required Restrictions Description
statuses [ConfigurationStatus] true none none
metadata object true none none
» firstSignupDone boolean true none none

Reason

{
  "title": "string",
  "notes": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
title string true none none
notes [string] true none none

ChurnFeedback

{
  "joinReason": {
    "title": "string",
    "notes": [
      "string"
    ]
  },
  "cancelReason": {
    "title": "string",
    "notes": [
      "string"
    ]
  }
}

Properties

Name Type Required Restrictions Description
joinReason Reason true none none
cancelReason Reason true none none

Category

{
  "categoryType": "string",
  "name": "string",
  "description": "string"
}

Properties

Name Type Required Restrictions Description
categoryType string true none none
name string true none none
description string true none none

CategoryOverview

{
  "commitId": 1,
  "category": {
    "categoryType": "string",
    "name": "string",
    "description": "string"
  },
  "percentage": 1.6,
  "totalResults": 1
}

Properties

Name Type Required Restrictions Description
commitId integer(int64) true none none
category Category true none none
percentage number(double) true none none
totalResults integer(int64) true none none

CategoryOverviewListResponse

{
  "data": [
    {
      "commitId": 1,
      "category": {
        "categoryType": "string",
        "name": "string",
        "description": "string"
      },
      "percentage": 1.6,
      "totalResults": 1
    }
  ]
}

Properties

Name Type Required Restrictions Description
data [CategoryOverview] true none none

License

{
  "numberOfSeats": 100,
  "email": "name@domain.com",
  "expirationDate": "2019-05-07T14:29:13.430Z",
  "inactivityThreshold": 4,
  "autoAddAuthors": true,
  "allowSeatsOverflow": true
}

Properties

Name Type Required Restrictions Description
numberOfSeats integer(int32) true none none
email string true none none
expirationDate string(date-time) true none none
inactivityThreshold integer(int32) false none none
autoAddAuthors boolean false none none
allowSeatsOverflow boolean false none none

LicenseResponse

{
  "data": "string"
}

Properties

Name Type Required Restrictions Description
data string true none none

DormantAccountInfo

{
  "email": "string"
}

Properties

Name Type Required Restrictions Description
email string true none Email address of the deleted account

DeleteDormantAccountsResponse

{
  "data": [
    {
      "email": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
data [DormantAccountInfo] true none none

AddRepositoryBody

{
  "repositoryFullPath": "codacy/codacy-analysis-cli",
  "provider": "gh"
}

Properties

Name Type Required Restrictions Description
repositoryFullPath string true none Full path of the repository on the Git provider, starting at the organization. Separate each segment of the path with a slash (/).
provider Provider true none Git provider hosting the repository

AddOrganizationBody

{
  "provider": "gh",
  "remoteIdentifier": "string",
  "name": "FooOrganization",
  "type": "Organization",
  "products": [
    "coverage"
  ]
}

Properties

Name Type Required Restrictions Description
provider Provider true none Git provider hosting the repository
remoteIdentifier string true none none
name string true none none
type OrganizationType true none The type of Organization
products [CodacyProduct] false none [Codacy product]

RemovePeopleBody

{
  "emails": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
emails [string] true none List of emails to add

SearchRepositoryIssuesBody

{
  "branchName": "a-feature-branch-name",
  "patternIds": [
    "ESLint_@typescript-eslint_consistent-indexed-object-style",
    "ESLint_@typescript-eslint_no-redeclare"
  ],
  "languages": [
    "Java",
    "Scala",
    "CSS",
    "ObjectiveC"
  ],
  "categories": [
    "Security",
    "CodeStyle"
  ],
  "levels": [
    "Error",
    "Warning"
  ],
  "authorEmails": [
    "example@mail.com",
    "another@mail.com"
  ]
}

Search parameters to filter the list of issues in a repository

Properties

Name Type Required Restrictions Description
branchName string false none Name of a repository branch enabled on Codacy, as returned by the endpoint listRepositoryBranches. By default, uses the main branch defined on the Codacy repository settings.
patternIds [string] false none Set of code pattern identifiers, as returned by the endpoint listPatterns
languages [string] false none Set of language names, without spaces
categories [string] false none Set of issue categories
levels [SeverityLevel] false none Set of issue severity levels
authorEmails [string] false none Set of commit author email addresses

RemovePeopleEmailStatus

{
  "email": "string",
  "error": "string"
}

Properties

Name Type Required Restrictions Description
email string true none none
error string false none none

RemovePeopleResponse

{
  "success": [
    {
      "email": "string",
      "error": "string"
    }
  ],
  "failed": [
    {
      "email": "string",
      "error": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
success [RemovePeopleEmailStatus] false none none
failed [RemovePeopleEmailStatus] false none none

SuggestedAuthorsResponse

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "commitEmail": "string",
      "totalProjects": 0,
      "totalCommits": 0,
      "lastCommit": "2019-08-24T14:15:22Z",
      "projectCommitStats": [
        {
          "projectId": 0,
          "firstCommit": "2019-08-24T14:15:22Z",
          "lastCommit": "2019-08-24T14:15:22Z",
          "numberOfCommits": 0
        }
      ]
    }
  ]
}

Properties

Name Type Required Restrictions Description
pagination PaginationInfo false none Cursor-based pagination information to obtain more items
data [SuggestedAuthor] true none none

RepositorySuggestedAuthorsResponse

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "commitEmail": "string",
      "projectCommitStat": {
        "projectId": 0,
        "firstCommit": "2019-08-24T14:15:22Z",
        "lastCommit": "2019-08-24T14:15:22Z",
        "numberOfCommits": 0
      }
    }
  ]
}

Properties

Name Type Required Restrictions Description
pagination PaginationInfo false none Cursor-based pagination information to obtain more items
data [RepositorySuggestedAuthor] true none none

SuggestedAuthor

{
  "commitEmail": "string",
  "totalProjects": 0,
  "totalCommits": 0,
  "lastCommit": "2019-08-24T14:15:22Z",
  "projectCommitStats": [
    {
      "projectId": 0,
      "firstCommit": "2019-08-24T14:15:22Z",
      "lastCommit": "2019-08-24T14:15:22Z",
      "numberOfCommits": 0
    }
  ]
}

Properties

Name Type Required Restrictions Description
commitEmail string true none none
totalProjects integer(int64) true none none
totalCommits integer(int64) true none none
lastCommit string(date-time) false none none
projectCommitStats [ProjectCommitStat] true none none

RepositorySuggestedAuthor

{
  "commitEmail": "string",
  "projectCommitStat": {
    "projectId": 0,
    "firstCommit": "2019-08-24T14:15:22Z",
    "lastCommit": "2019-08-24T14:15:22Z",
    "numberOfCommits": 0
  }
}

Properties

Name Type Required Restrictions Description
commitEmail string true none none
projectCommitStat ProjectCommitStat true none none

ProjectCommitStat

{
  "projectId": 0,
  "firstCommit": "2019-08-24T14:15:22Z",
  "lastCommit": "2019-08-24T14:15:22Z",
  "numberOfCommits": 0
}

Properties

Name Type Required Restrictions Description
projectId integer(int64) true none none
firstCommit string(date-time) false none none
lastCommit string(date-time) false none none
numberOfCommits integer(int64) true none none

AnalysisTool

{
  "name": "string",
  "isClientSide": true,
  "settings": {
    "name": "string",
    "isEnabled": true,
    "usesConfigurationFile": true
  }
}

Properties

Name Type Required Restrictions Description
name string true none none
isClientSide boolean true none none
settings AnalysisToolSettings true none none

AnalysisToolSettings

{
  "name": "string",
  "isEnabled": true,
  "usesConfigurationFile": true
}

Properties

Name Type Required Restrictions Description
name string false none none
isEnabled boolean true none none
usesConfigurationFile boolean true none none

CoverageReport

{
  "targetCommitSha": "string",
  "commit": {
    "sha": "string",
    "id": 1,
    "commitTimestamp": "2019-05-07T14:29:13.430Z",
    "authorName": "string",
    "authorEmail": "string",
    "message": "string",
    "startedAnalysis": "2022-01-07T14:29:13.430Z",
    "endedAnalysis": "2022-01-07T14:29:13.430Z",
    "isMergeCommit": false,
    "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
    "parents": [
      "string"
    ],
    "branches": [
      {
        "id": 1,
        "name": "master",
        "isDefault": true,
        "isEnabled": true,
        "lastUpdated": "2019-05-07T14:29:13.430Z",
        "branchType": "Branch",
        "lastCommit": "string"
      }
    ]
  },
  "language": "string",
  "createdAt": "2019-08-24T14:15:22Z",
  "status": "Pending"
}

Status and details of a coverage report

Properties

Name Type Required Restrictions Description
targetCommitSha string true none Commit SHA that was referenced as the target for this report
commit CommitWithBranches false none none
language string false none Programming language associated with the coverage report
createdAt string(date-time) true none Report creation date
status string true none Coverage status

Enumerated Values

Property Value
status Pending
status Processed
status CommitNotAnalysed
status CommitNotFound
status BranchNotEnabled
status MissingFinal

CoverageReportResponse

{
  "data": {
    "hasCoverageOverview": true,
    "lastReports": [
      {
        "targetCommitSha": "string",
        "commit": {
          "sha": "string",
          "id": 1,
          "commitTimestamp": "2019-05-07T14:29:13.430Z",
          "authorName": "string",
          "authorEmail": "string",
          "message": "string",
          "startedAnalysis": "2022-01-07T14:29:13.430Z",
          "endedAnalysis": "2022-01-07T14:29:13.430Z",
          "isMergeCommit": false,
          "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
          "parents": [
            "string"
          ],
          "branches": [
            {
              "id": 1,
              "name": "master",
              "isDefault": true,
              "isEnabled": true,
              "lastUpdated": "2019-05-07T14:29:13.430Z",
              "branchType": "Branch",
              "lastCommit": "string"
            }
          ]
        },
        "language": "string",
        "createdAt": "2019-08-24T14:15:22Z",
        "status": "Pending"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
data object true none none
» hasCoverageOverview boolean false none True if the Quality evolution chart of the repository includes coverage information
» lastReports [CoverageReport] false none [Status and details of a coverage report]

PullRequestCoverageReport

{
  "targetCommitSha": "string",
  "commit": {
    "sha": "string",
    "id": 1,
    "commitTimestamp": "2019-05-07T14:29:13.430Z",
    "authorName": "string",
    "authorEmail": "string",
    "message": "string",
    "startedAnalysis": "2022-01-07T14:29:13.430Z",
    "endedAnalysis": "2022-01-07T14:29:13.430Z",
    "isMergeCommit": false,
    "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
    "parents": [
      "string"
    ],
    "branches": [
      {
        "id": 1,
        "name": "master",
        "isDefault": true,
        "isEnabled": true,
        "lastUpdated": "2019-05-07T14:29:13.430Z",
        "branchType": "Branch",
        "lastCommit": "string"
      }
    ]
  },
  "language": "string",
  "createdAt": "2019-08-24T14:15:22Z",
  "status": "Pending"
}

Status and details of a pull request coverage report

Properties

Name Type Required Restrictions Description
targetCommitSha string true none Commit SHA that was referenced as the target for this report
commit CommitWithBranches false none none
language string false none Programming language associated with the coverage report
createdAt string(date-time) true none Report creation date
status string true none Coverage status

Enumerated Values

Property Value
status Pending
status Processed
status CommitNotAnalysed
status CommitNotFound
status BranchNotEnabled
status MissingFinal

CoveragePullRequestCommitDetail

{
  "commitId": 1,
  "commitSha": "string",
  "reports": [
    {
      "targetCommitSha": "string",
      "commit": {
        "sha": "string",
        "id": 1,
        "commitTimestamp": "2019-05-07T14:29:13.430Z",
        "authorName": "string",
        "authorEmail": "string",
        "message": "string",
        "startedAnalysis": "2022-01-07T14:29:13.430Z",
        "endedAnalysis": "2022-01-07T14:29:13.430Z",
        "isMergeCommit": false,
        "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
        "parents": [
          "string"
        ],
        "branches": [
          {
            "id": 1,
            "name": "master",
            "isDefault": true,
            "isEnabled": true,
            "lastUpdated": "2019-05-07T14:29:13.430Z",
            "branchType": "Branch",
            "lastCommit": "string"
          }
        ]
      },
      "language": "string",
      "createdAt": "2019-08-24T14:15:22Z",
      "status": "Pending"
    }
  ]
}

Status and details of the coverage reports received for a pull request commit

Properties

Name Type Required Restrictions Description
commitId integer(int64) true none none
commitSha string true none none
reports [PullRequestCoverageReport] true none [Status and details of a pull request coverage report]

CoveragePullRequestResponse

{
  "data": {
    "headCommit": {
      "commitId": 1,
      "commitSha": "string",
      "reports": [
        {
          "targetCommitSha": "string",
          "commit": {
            "sha": "string",
            "id": 1,
            "commitTimestamp": "2019-05-07T14:29:13.430Z",
            "authorName": "string",
            "authorEmail": "string",
            "message": "string",
            "startedAnalysis": "2022-01-07T14:29:13.430Z",
            "endedAnalysis": "2022-01-07T14:29:13.430Z",
            "isMergeCommit": false,
            "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
            "parents": [
              "string"
            ],
            "branches": [
              {
                "id": 1,
                "name": "master",
                "isDefault": true,
                "isEnabled": true,
                "lastUpdated": "2019-05-07T14:29:13.430Z",
                "branchType": "Branch",
                "lastCommit": "string"
              }
            ]
          },
          "language": "string",
          "createdAt": "2019-08-24T14:15:22Z",
          "status": "Pending"
        }
      ]
    },
    "commonAncestorCommit": {
      "commitId": 1,
      "commitSha": "string",
      "reports": [
        {
          "targetCommitSha": "string",
          "commit": {
            "sha": "string",
            "id": 1,
            "commitTimestamp": "2019-05-07T14:29:13.430Z",
            "authorName": "string",
            "authorEmail": "string",
            "message": "string",
            "startedAnalysis": "2022-01-07T14:29:13.430Z",
            "endedAnalysis": "2022-01-07T14:29:13.430Z",
            "isMergeCommit": false,
            "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
            "parents": [
              "string"
            ],
            "branches": [
              {
                "id": 1,
                "name": "master",
                "isDefault": true,
                "isEnabled": true,
                "lastUpdated": "2019-05-07T14:29:13.430Z",
                "branchType": "Branch",
                "lastCommit": "string"
              }
            ]
          },
          "language": "string",
          "createdAt": "2019-08-24T14:15:22Z",
          "status": "Pending"
        }
      ]
    },
    "origin": {
      "commitId": 1,
      "commitSha": "string",
      "reports": [
        {
          "targetCommitSha": "string",
          "commit": {
            "sha": "string",
            "id": 1,
            "commitTimestamp": "2019-05-07T14:29:13.430Z",
            "authorName": "string",
            "authorEmail": "string",
            "message": "string",
            "startedAnalysis": "2022-01-07T14:29:13.430Z",
            "endedAnalysis": "2022-01-07T14:29:13.430Z",
            "isMergeCommit": false,
            "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
            "parents": [
              "string"
            ],
            "branches": [
              {
                "id": 1,
                "name": "master",
                "isDefault": true,
                "isEnabled": true,
                "lastUpdated": "2019-05-07T14:29:13.430Z",
                "branchType": "Branch",
                "lastCommit": "string"
              }
            ]
          },
          "language": "string",
          "createdAt": "2019-08-24T14:15:22Z",
          "status": "Pending"
        }
      ]
    },
    "target": {
      "commitId": 1,
      "commitSha": "string",
      "reports": [
        {
          "targetCommitSha": "string",
          "commit": {
            "sha": "string",
            "id": 1,
            "commitTimestamp": "2019-05-07T14:29:13.430Z",
            "authorName": "string",
            "authorEmail": "string",
            "message": "string",
            "startedAnalysis": "2022-01-07T14:29:13.430Z",
            "endedAnalysis": "2022-01-07T14:29:13.430Z",
            "isMergeCommit": false,
            "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
            "parents": [
              "string"
            ],
            "branches": [
              {
                "id": 1,
                "name": "master",
                "isDefault": true,
                "isEnabled": true,
                "lastUpdated": "2019-05-07T14:29:13.430Z",
                "branchType": "Branch",
                "lastCommit": "string"
              }
            ]
          },
          "language": "string",
          "createdAt": "2019-08-24T14:15:22Z",
          "status": "Pending"
        }
      ]
    }
  }
}

*Status and details about the coverage reports uploaded for the head commit and common ancestor commit of the pull request. *

Properties

Name Type Required Restrictions Description
data object true none none
» headCommit CoveragePullRequestCommitDetail true none Status and details of the coverage reports received for a pull request commit
» commonAncestorCommit CoveragePullRequestCommitDetail true none Status and details of the coverage reports received for a pull request commit
» origin CoveragePullRequestCommitDetail true none Deprecated, use headCommit instead
» target CoveragePullRequestCommitDetail true none Deprecated, use commonAncestorCommit instead

PullRequestIssuesResponse

{
  "analyzed": true,
  "data": [
    {
      "commitIssue": {
        "issueId": "string",
        "resultDataId": 0,
        "filePath": "string",
        "fileId": 0,
        "patternInfo": {
          "id": "accessor-pairs",
          "title": "string",
          "category": "Security",
          "subCategory": "XSS",
          "level": "Error",
          "severityLevel": "Error"
        },
        "toolInfo": {
          "uuid": "847feb32-9ff2-11ea-bb37-0242ac130002",
          "name": "ESLint"
        },
        "lineNumber": 0,
        "message": "string",
        "suggestion": "string",
        "language": "string",
        "lineText": "string",
        "commitInfo": {
          "sha": "string",
          "commiter": "string",
          "commiterName": "string",
          "timestamp": "2019-05-07T14:29:13.430Z"
        }
      },
      "deltaType": "Added"
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

List of issues added or fixed on a pull request

Properties

Name Type Required Restrictions Description
analyzed boolean true none True if Codacy already analyzed the latest commit
data [CommitDeltaIssue] true none List of issues added or fixed on a pull request or an empty list if Codacy didn't analyze the latest commit yet.
pagination PaginationInfo false none Cursor-based pagination information to obtain more items

AnalysisStepExecutionMetrics

{
  "title": "string",
  "start": "2019-08-24T14:15:22Z",
  "end": "2019-08-24T14:15:22Z",
  "activeExecutionTime": 0,
  "totalExecutionTime": 0,
  "stackTrace": "string",
  "status": "success"
}

Execution metrics for a step of the analysis process

Properties

Name Type Required Restrictions Description
title string true none none
start string(date-time) true none none
end string(date-time) true none none
activeExecutionTime integer(int64) true none none
totalExecutionTime integer(int64) true none none
stackTrace string false none none
status string true none none

Enumerated Values

Property Value
status success
status error

LogsResponse

{
  "data": {
    "headCommitSha": "string",
    "commonAncestorCommitSha": "string",
    "start": "2019-08-24T14:15:22Z",
    "end": "2019-08-24T14:15:22Z",
    "totalAnalysisTime": 0,
    "steps": [
      {
        "title": "string",
        "start": "2019-08-24T14:15:22Z",
        "end": "2019-08-24T14:15:22Z",
        "activeExecutionTime": 0,
        "totalExecutionTime": 0,
        "stackTrace": "string",
        "status": "success"
      }
    ]
  }
}

Analysis logs response for a commit or pull request

Properties

Name Type Required Restrictions Description
data object true none Analysis logs data for a commit or pull request
» headCommitSha string true none none
» commonAncestorCommitSha string false none none
» start string(date-time) true none none
» end string(date-time) true none none
» totalAnalysisTime integer(int64) true none none
» steps [AnalysisStepExecutionMetrics] true none [Execution metrics for a step of the analysis process]

ClonesResponse

{
  "data": [
    {
      "id": 0,
      "status": "Added",
      "clones": [
        {
          "path": "string",
          "fileId": 0,
          "fileDataId": 0,
          "fromLine": 0,
          "toLine": 0
        }
      ]
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

List of duplicate code blocks added or removed in a commit or pull request

Properties

Name Type Required Restrictions Description
data [CommitFileClone] true none List of duplicate code blocks added or removed in a commit or pull request, or an empty list if Codacy hasn't analyzed the latest commit yet.
pagination PaginationInfo false none Cursor-based pagination information to obtain more items

CommitFileClone

{
  "id": 0,
  "status": "Added",
  "clones": [
    {
      "path": "string",
      "fileId": 0,
      "fileDataId": 0,
      "fromLine": 0,
      "toLine": 0
    }
  ]
}

A duplicated code block with references to duplicate instances

Properties

Name Type Required Restrictions Description
id integer(int64) true none none
status DeltaType true none Specifies if the issue was added or fixed by the commit
clones [CloneDuplicationBlock] true none none

CloneDuplicationBlock

{
  "path": "string",
  "fileId": 0,
  "fileDataId": 0,
  "fromLine": 0,
  "toLine": 0
}

Properties

Name Type Required Restrictions Description
path string true none none
fileId integer(int64) true none none
fileDataId integer(int64) true none none
fromLine integer(int64) true none none
toLine integer(int64) true none none

DiffResponse

{
  "diff": "diff --git a/example.md b/example.md\nindex 9eeb703..777b981 100644\n--- a/example.md\n+++ b/example.md\n@@ -1 +1 @@\n-Edited line\n+Edited line (edit)\n"
}

Human-readable Git diff of a commit or pull request, matching the output format of the git diff command

Properties

Name Type Required Restrictions Description
diff string true none none

SecurityDashboardMetrics

{
  "12_month": 0,
  "30_day_variation": {
    "absolute": 0,
    "percentage": 0
  }
}

Properties

Name Type Required Restrictions Description
12_month integer(int32) true none none
30_day_variation object true none none
» absolute integer(int32) true none none
» percentage number(double) true none none

SecurityDashboardResponse

{
  "items_overdue": {
    "12_month": 0,
    "30_day_variation": {
      "absolute": 0,
      "percentage": 0
    }
  },
  "items_due_soon": {
    "12_month": 0,
    "30_day_variation": {
      "absolute": 0,
      "percentage": 0
    }
  },
  "past_sla_misses": {
    "12_month": 0,
    "30_day_variation": {
      "absolute": 0,
      "percentage": 0
    }
  },
  "past_sla_on_time": {
    "12_month": 0,
    "30_day_variation": {
      "absolute": 0,
      "percentage": 0
    }
  }
}

*Brief security metrics for a security dashboard. *

Properties

Name Type Required Restrictions Description
items_overdue SecurityDashboardMetrics true none none
items_due_soon SecurityDashboardMetrics true none none
past_sla_misses SecurityDashboardMetrics true none none
past_sla_on_time SecurityDashboardMetrics true none none

SRMDashboard

{
  "totalOpen": 0,
  "totalClosed": 0,
  "onTrack": 0,
  "dueSoon": 0,
  "overdue": 0,
  "closedOnTime": 0,
  "closedLate": 0,
  "openCritical": 0,
  "openHigh": 0,
  "openMedium": 0,
  "openLow": 0
}

Metrics for the security and risk management dashboard.

Properties

Name Type Required Restrictions Description
totalOpen integer(int32) true none none
totalClosed integer(int32) true none none
onTrack integer(int32) true none none
dueSoon integer(int32) true none none
overdue integer(int32) true none none
closedOnTime integer(int32) true none none
closedLate integer(int32) true none none
openCritical integer(int32) true none Number of open security issues with Critical severity.
openHigh integer(int32) true none Number of open security issues with High severity.
openMedium integer(int32) true none Number of open security issues with Medium severity.
openLow integer(int32) true none Number of open security issues with Low severity.

SRMDashboardResponse

{
  "data": {
    "totalOpen": 0,
    "totalClosed": 0,
    "onTrack": 0,
    "dueSoon": 0,
    "overdue": 0,
    "closedOnTime": 0,
    "closedLate": 0,
    "openCritical": 0,
    "openHigh": 0,
    "openMedium": 0,
    "openLow": 0
  }
}

Metrics for the security and risk management dashboard.

Properties

Name Type Required Restrictions Description
data SRMDashboard true none Metrics for the security and risk management dashboard.

SRMRepositoryIssueCount

{
  "id": 0,
  "name": "important-repo",
  "critical": 0,
  "high": 0,
  "medium": 0,
  "low": 0
}

Open issue counts for a repository, aggregated by severity.

Properties

Name Type Required Restrictions Description
id integer(int64) true none Codacy repository id.
name string true none Repository name.
critical integer(int32) true none Number of open issues with 'Critical' severity.
high integer(int32) true none Number of open issues with 'High' severity.
medium integer(int32) true none Number of open issues with 'Medium' severity.
low integer(int32) true none Number of open issues with 'Low' severity.

SRMDashboardRepositoriesResponse

{
  "data": [
    {
      "id": 0,
      "name": "important-repo",
      "critical": 0,
      "high": 0,
      "medium": 0,
      "low": 0
    }
  ]
}

List of repositories with their respective issue count.

Properties

Name Type Required Restrictions Description
data [SRMRepositoryIssueCount] true none [Open issue counts for a repository, aggregated by severity.]

SRMCategoryIssueCount

{
  "name": "Cryptography",
  "total": 0
}

Open issue counts for a security category.

Properties

Name Type Required Restrictions Description
name string true none Security category name.
total integer(int32) true none Total number of open issues for the given security category.

SRMDashboardCategoriesResponse

{
  "data": [
    {
      "name": "Cryptography",
      "total": 0
    }
  ]
}

List of security categories with their respective issue count.

Properties

Name Type Required Restrictions Description
data [SRMCategoryIssueCount] true none [Open issue counts for a security category.]

SRMHistoryDataPoint

{
  "since": "2024-04-16T00:28:07.219Z",
  "until": "2024-04-16T00:28:07.219Z",
  "newCritical": 0,
  "newHigh": 0,
  "newMedium": 0,
  "newLow": 0,
  "fixedCritical": 0,
  "fixedHigh": 0,
  "fixedMedium": 0,
  "fixedLow": 0,
  "openCritical": 0,
  "openHigh": 0,
  "openMedium": 0,
  "openLow": 0
}

Totals for open, new and fixed security findings during the given time interval.

Properties

Name Type Required Restrictions Description
since string(date-time) true none Beginning of the time interval (inclusive).
until string(date-time) true none End of the time interval (exclusive).
newCritical integer(int32) true none Number of security findings with Critical severity, introduced during the time interval.
newHigh integer(int32) true none Number of security findings with High severity, introduced during the time interval.
newMedium integer(int32) true none Number of security findings with Medium severity, introduced during the time interval.
newLow integer(int32) true none Number of security findings with Low severity, introduced during the time interval.
fixedCritical integer(int32) true none Number of security findings with Critical severity, fixed during the time interval.
fixedHigh integer(int32) true none Number of security findings with High severity, fixed during the time interval.
fixedMedium integer(int32) true none Number of security findings with Medium severity, fixed during the time interval.
fixedLow integer(int32) true none Number of security findings with Low severity, fixed during the time interval.
openCritical integer(int32) true none Number of open security findings with Critical severity, at the beginning of the time interval.
openHigh integer(int32) true none Number of open security findings with High severity, at the beginning of the time interval.
openMedium integer(int32) true none Number of open security findings with Medium severity, at the beginning of the time interval.
openLow integer(int32) true none Number of open security findings with Low severity, at the beginning of the time interval.

SRMDashboardHistoryResponse

{
  "data": [
    {
      "since": "2024-04-16T00:28:07.219Z",
      "until": "2024-04-16T00:28:07.219Z",
      "newCritical": 0,
      "newHigh": 0,
      "newMedium": 0,
      "newLow": 0,
      "fixedCritical": 0,
      "fixedHigh": 0,
      "fixedMedium": 0,
      "fixedLow": 0,
      "openCritical": 0,
      "openHigh": 0,
      "openMedium": 0,
      "openLow": 0
    }
  ]
}

Evolution of security findings over time.

Properties

Name Type Required Restrictions Description
data [SRMHistoryDataPoint] true none [Totals for open, new and fixed security findings during the given time interval.]

SecurityComponent

{
  "total": 0,
  "ok": 0
}

*Two part metric, the purpose of which is described by the property it's used in. *

Properties

Name Type Required Restrictions Description
total integer(int32) true none none
ok integer(int32) true none none

SecurityComponentsResponse

{
  "items": [
    {
      "repositories": {
        "total": 0,
        "ok": 0
      },
      "infrastructure": {
        "total": 0,
        "ok": 0
      },
      "people": {
        "total": 0,
        "ok": 0
      },
      "tickets": {
        "total": 0,
        "ok": 0
      }
    }
  ]
}

*Aggregate of various metrics. *

Properties

Name Type Required Restrictions Description
items [object] true none none
» repositories SecurityComponent true none Two part metric, the purpose of which is described by the property it's used in.
» infrastructure SecurityComponent true none Two part metric, the purpose of which is described by the property it's used in.
» people SecurityComponent true none Two part metric, the purpose of which is described by the property it's used in.
» tickets SecurityComponent true none Two part metric, the purpose of which is described by the property it's used in.

ApiError

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ]
}

Properties

Name Type Required Restrictions Description
message string true none none
innerMessage string false none none
actions [ProblemLink] true none none

BadRequest

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadRequest"
}

Properties

allOf

Name Type Required Restrictions Description
anonymous ApiError false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» error string true none none

Unauthorized

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "Unauthorized",
  "code": "Unauthorized"
}

Properties

allOf

Name Type Required Restrictions Description
anonymous ApiError false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» error string true none none
» code string true none none

PaymentRequired

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "PaymentRequired"
}

Properties

allOf

Name Type Required Restrictions Description
anonymous ApiError false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» error string true none none

Forbidden

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "Forbidden"
}

Properties

allOf

Name Type Required Restrictions Description
anonymous ApiError false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» error string true none none

NotFound

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "NotFound"
}

Properties

allOf

Name Type Required Restrictions Description
anonymous ApiError false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» error string true none none

MethodNotAllowed

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "MethodNotAllowed"
}

Properties

allOf

Name Type Required Restrictions Description
anonymous ApiError false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» error string true none none

Conflict

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "Conflict"
}

Properties

allOf

Name Type Required Restrictions Description
anonymous ApiError false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» error string true none none

UnprocessableEntity

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "UnprocessableEntity"
}

Properties

allOf

Name Type Required Restrictions Description
anonymous ApiError false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» error string true none none

InternalServerError

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "InternalServerError"
}

Properties

allOf

Name Type Required Restrictions Description
anonymous ApiError false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» error string true none none

NotImplemented

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "NotImplemented"
}

Properties

allOf

Name Type Required Restrictions Description
anonymous ApiError false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» error string true none none

BadGateway

{
  "message": "string",
  "innerMessage": "string",
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "error": "BadGateway"
}

Properties

allOf

Name Type Required Restrictions Description
anonymous ApiError false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» error string true none none

Tool

{
  "uuid": "847feb32-9ff2-11ea-bb37-0242ac130002",
  "name": "ESLint",
  "version": "6.8.0",
  "shortName": "eslint",
  "documentationUrl": "http://eslint.org/docs/rules/",
  "sourceCodeUrl": "https://github.com/codacy/codacy-eslint",
  "prefix": "ESLint_",
  "needsCompilation": false,
  "configurationFilenames": [
    ".eslintrc.js",
    ".eslintrc.yaml"
  ],
  "description": "ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. In many ways, it is similar to JSLint and JSHint with a few exceptions",
  "dockerImage": "codacy/codacy-eslint:2.20.19",
  "languages": [
    "JavaScript"
  ],
  "clientSide": true,
  "standalone": true,
  "enabledByDefault": true,
  "configurable": true
}

Codacy tool that can flag patterns/issues on projects

Properties

allOf

Name Type Required Restrictions Description
anonymous ToolReference false none Details of the tool that found the issue

and

Name Type Required Restrictions Description
anonymous object false none none
» version string true none Original tool version used by the Codacy tool wrapper
» shortName string true none Tool unique short name, must contain alphanumeric characters only and no spaces
» documentationUrl string false none Original tool documentation URL
» sourceCodeUrl string false none Codacy tool wrapper source code URL
» prefix string false none Tool prefix used to ensure pattern names are unique
» needsCompilation boolean true none Tool requires compilation to run
» configurationFilenames [string] true none Tool configuration filename
» description string false none Tool description
» dockerImage string true none Docker image used to launch tool
» languages [string] true none List of languages that the tool supports
» clientSide boolean true none True if the tool is supposed to run on the client's machine and the results sent to Codacy
» standalone boolean true none True if the client-side tool runs stand-alone outside of the CLI
» enabledByDefault boolean true none True if the tool is enabled by default for new projects (not required)
» configurable boolean true none True if the tool is configurable on Codacy's UI

ToolListResponse

{
  "data": [
    {
      "uuid": "847feb32-9ff2-11ea-bb37-0242ac130002",
      "name": "ESLint",
      "version": "6.8.0",
      "shortName": "eslint",
      "documentationUrl": "http://eslint.org/docs/rules/",
      "sourceCodeUrl": "https://github.com/codacy/codacy-eslint",
      "prefix": "ESLint_",
      "needsCompilation": false,
      "configurationFilenames": [
        ".eslintrc.js",
        ".eslintrc.yaml"
      ],
      "description": "ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. In many ways, it is similar to JSLint and JSHint with a few exceptions",
      "dockerImage": "codacy/codacy-eslint:2.20.19",
      "languages": [
        "JavaScript"
      ],
      "clientSide": true,
      "standalone": true,
      "enabledByDefault": true,
      "configurable": true
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Properties

Name Type Required Restrictions Description
data [Tool] true none [Codacy tool that can flag patterns/issues on projects]
pagination PaginationInfo false none Cursor-based pagination information to obtain more items

DuplicationTool

{
  "dockerImage": "codacy/codacy-duplication-pmdcpd:1.0.0",
  "languages": [
    "string"
  ]
}

Codacy tool that can detect duplication on projects

Properties

Name Type Required Restrictions Description
dockerImage string true none Docker image used to launch tool
languages [string] true none List of languages that the tool supports

DuplicationToolListResponse

{
  "data": [
    {
      "dockerImage": "codacy/codacy-duplication-pmdcpd:1.0.0",
      "languages": [
        "string"
      ]
    }
  ]
}

Properties

Name Type Required Restrictions Description
data [DuplicationTool] true none [Codacy tool that can detect duplication on projects]

MetricsTool

{
  "dockerImage": "codacy/codacy-metrics-cloc:1.0.0",
  "languages": [
    "string"
  ]
}

Codacy tool that calculates metrics on projects

Properties

Name Type Required Restrictions Description
dockerImage string true none Docker image used to launch tool
languages [string] true none List of languages that the tool supports

MetricsToolListResponse

{
  "data": [
    {
      "dockerImage": "codacy/codacy-metrics-cloc:1.0.0",
      "languages": [
        "string"
      ]
    }
  ]
}

Properties

Name Type Required Restrictions Description
data [MetricsTool] true none [Codacy tool that calculates metrics on projects]

AnalysisToolsResponse

{
  "data": [
    {
      "name": "string",
      "isClientSide": true,
      "settings": {
        "name": "string",
        "isEnabled": true,
        "usesConfigurationFile": true
      }
    }
  ]
}

Properties

Name Type Required Restrictions Description
data [AnalysisTool] true none none

Pattern

{
  "id": "accessor-pairs",
  "title": "string",
  "category": "Security",
  "subCategory": "XSS",
  "level": "Error",
  "severityLevel": "Error",
  "description": "Enforce getter and setter pairs in objects and classes",
  "explanation": "Accessor pairs description",
  "enabled": true,
  "languages": [
    "JavaScript"
  ],
  "timeToFix": 5,
  "parameters": [
    {
      "name": "getWithoutSet",
      "description": "getWithoutSet",
      "default": "true"
    }
  ]
}

Code pattern that a Codacy tool can use to find issues

Properties

allOf

Name Type Required Restrictions Description
anonymous PatternDetails false none Details of the pattern that was identified in the issue

and

Name Type Required Restrictions Description
anonymous object false none none
» description string false none Short description of the code pattern
» explanation string false none Full description of the code pattern, in CommonMark
» enabled boolean true none True if the code pattern is on by default for new repositories
» languages [string] false none List of languages that the code pattern supports
» timeToFix integer(int32) false none Average time to fix an issue detected by the code pattern, in minutes
» parameters ParameterList true none none

PatternListResponse

{
  "data": [
    {
      "id": "accessor-pairs",
      "title": "string",
      "category": "Security",
      "subCategory": "XSS",
      "level": "Error",
      "severityLevel": "Error",
      "description": "Enforce getter and setter pairs in objects and classes",
      "explanation": "Accessor pairs description",
      "enabled": true,
      "languages": [
        "JavaScript"
      ],
      "timeToFix": 5,
      "parameters": [
        {
          "name": "getWithoutSet",
          "description": "getWithoutSet",
          "default": "true"
        }
      ]
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Properties

Name Type Required Restrictions Description
data [Pattern] true none [Code pattern that a Codacy tool can use to find issues]
pagination PaginationInfo false none Cursor-based pagination information to obtain more items

PatternResponse

{
  "data": {
    "id": "accessor-pairs",
    "title": "string",
    "category": "Security",
    "subCategory": "XSS",
    "level": "Error",
    "severityLevel": "Error",
    "description": "Enforce getter and setter pairs in objects and classes",
    "explanation": "Accessor pairs description",
    "enabled": true,
    "languages": [
      "JavaScript"
    ],
    "timeToFix": 5,
    "parameters": [
      {
        "name": "getWithoutSet",
        "description": "getWithoutSet",
        "default": "true"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
data Pattern true none Code pattern that a Codacy tool can use to find issues

Parameter

{
  "name": "getWithoutSet",
  "description": "getWithoutSet",
  "default": "true"
}

Parameter to configure a code pattern

Properties

Name Type Required Restrictions Description
name string true none Name of the parameter
description string false none Description of the parameter
default string true none Default value of the parameter

ParameterList

[
  {
    "name": "getWithoutSet",
    "description": "getWithoutSet",
    "default": "true"
  }
]

Properties

Name Type Required Restrictions Description
anonymous [Parameter] false none [Parameter to configure a code pattern]

Person

{
  "name": "John Smith",
  "email": "johnsmith@emailprovider.com",
  "emails": [
    "johnsmith@emailprovider.com"
  ],
  "userId": 1234,
  "committerId": 1234,
  "lastLogin": "2020-11-05T15:39:13.430Z",
  "lastAnalysis": "2020-11-05T15:39:13.430Z",
  "isActive": true,
  "canBeRemoved": true,
  "lastCommitId": 2335557754,
  "providerId": "string",
  "providerLogin": "string",
  "isProviderRegistered": true
}

Representation of a person that belongs to an organization

Properties

Name Type Required Restrictions Description
name string false none The name of the person
email string true none [deprecated: use emails instead] The email of the person
emails [string] true none The emails of the person
userId integer(int64) false none User ID internal to Codacy.
committerId integer(int64) false none Commit author ID
lastLogin string(date-time) false none none
lastAnalysis string(date-time) false none Date and time when Codacy last analyzed a commit from this person.
isActive boolean false none Whether the person is active on Codacy or not
canBeRemoved boolean true none Whether the person can be removed from the organization or not
lastCommitId integer(int64) false none none
providerId string false none ID of the person on the Git provider
providerLogin string false none Username of the person on the Git provider
isProviderRegistered boolean false none True if the person is registered on the Git provider

ListPeopleResponse

{
  "data": [
    {
      "name": "John Smith",
      "email": "johnsmith@emailprovider.com",
      "emails": [
        "johnsmith@emailprovider.com"
      ],
      "userId": 1234,
      "committerId": 1234,
      "lastLogin": "2020-11-05T15:39:13.430Z",
      "lastAnalysis": "2020-11-05T15:39:13.430Z",
      "isActive": true,
      "canBeRemoved": true,
      "lastCommitId": 2335557754,
      "providerId": "string",
      "providerLogin": "string",
      "isProviderRegistered": true
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Properties

Name Type Required Restrictions Description
data [Person] true none [Representation of a person that belongs to an organization]
pagination PaginationInfo false none Cursor-based pagination information to obtain more items

LeaveOrgProblem

{
  "actions": [
    {
      "name": "Check our documentation",
      "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
    }
  ],
  "code": "last_admin_credit"
}

Properties

Name Type Required Restrictions Description
actions [ProblemLink] true none none
code string true none A stable identifier for a problem.

LeaveOrgCheckResult

{
  "canLeave": true,
  "message": "Since you are the last organization admin of $orgName, to leave this organization you need to delete it. Please, contact us through support.",
  "reason": {
    "actions": [
      {
        "name": "Check our documentation",
        "url": "https://docs.codacy.com/faq/troubleshooting/why-isnt-my-public-repository-being-analyzed/"
      }
    ],
    "code": "last_admin_credit"
  }
}

Informs if the user can leave the organization and if not, why.

Properties

Name Type Required Restrictions Description
canLeave boolean true none True if user can leave the organization
message string true none none
reason LeaveOrgProblem false none none

FileCoverageAnalysis

{
  "coverage": 71,
  "coverableLines": 2,
  "coveredLines": 1
}

Coverage analysis metrics for a file

Properties

Name Type Required Restrictions Description
coverage number(double) true none Coverage percentage of the file with decimals
coverableLines integer(int64) true none Coverable lines of the file (lines that can be covered by tests)
coveredLines integer(int64) true none Covered lines of the file (lines that are covered by tests)

FileMetadata

{
  "branchId": 1,
  "commitId": 1,
  "commitSha": "string",
  "fileId": 1,
  "fileDataId": 1,
  "path": "/src/test.go",
  "language": "Go",
  "gitProviderUrl": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2"
}

Metadata for a file in a repository

Properties

Name Type Required Restrictions Description
branchId integer(int64) false none Identifier for the branch the file belongs to
commitId integer(int64) true none none
commitSha string true none Commit SHA
fileId integer(int64) true none Identifier for file in any branch of a specific commit
fileDataId integer(int64) true none Identifier for file
path string true none Relative path of the file in the repository
language string true none Language of the file
gitProviderUrl string true none URL to the commit on the Git provider

FileMetrics

{
  "linesOfCode": 123,
  "commentedLinesOfCode": 123,
  "numberOfMethods": 123,
  "numberOfClasses": 123
}

Metadata for a file

Properties

Name Type Required Restrictions Description
linesOfCode integer(int32) false none Lines of code in the file
commentedLinesOfCode integer(int64) false none Commented lines of code in the file
numberOfMethods integer(int32) false none Number of methods in the file
numberOfClasses integer(int32) false none Number of classes in the file

FileInformationWithAnalysis

{
  "file": {
    "branchId": 1,
    "commitId": 1,
    "commitSha": "string",
    "fileId": 1,
    "fileDataId": 1,
    "path": "/src/test.go",
    "language": "Go",
    "gitProviderUrl": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2"
  },
  "metrics": {
    "linesOfCode": 123,
    "commentedLinesOfCode": 123,
    "numberOfMethods": 123,
    "numberOfClasses": 123
  },
  "coverage": {
    "coverage": 71,
    "coverableLines": 2,
    "coveredLines": 1
  }
}

Properties

Name Type Required Restrictions Description
file FileMetadata true none Metadata for a file in a repository
metrics FileMetrics false none Metadata for a file
coverage FileCoverageAnalysis false none Coverage analysis metrics for a file

FileWithAnalysisInfo

{
  "fileId": 2,
  "branchId": 3,
  "path": "/src/test.go",
  "totalIssues": 42,
  "complexity": 3,
  "grade": 74,
  "gradeLetter": "A",
  "coverage": 71,
  "coverageWithDecimals": 71,
  "duplication": 7,
  "linesOfCode": 123,
  "sourceLinesOfCode": 90,
  "numberOfMethods": 12,
  "numberOfClones": 5
}

File with analysis information

Properties

Name Type Required Restrictions Description
fileId integer(int64) true none Identifier of the file in a specific branch and commit
branchId integer(int64) true none Identifier for the branch the file belongs to
path string true none Relative path of the file in the repository
totalIssues integer(int32) true none Number of issues in the file
complexity integer(int32) false none Complexity level of the file
grade integer(int32) true none Quality grade of the file as a number between 100 (highest grade) and 0 (lowest grade)
gradeLetter string true none Quality grade of the file as a letter between A (highest grade) and F (lowest grade)
coverage integer(int32) false none Deprecated, use coverageWithDecimals instead
coverageWithDecimals number(double) false none Test coverage percentage of the file with decimals
duplication integer(int32) false none Number of duplicated lines in the file
linesOfCode integer(int32) false none Lines of code in the file
sourceLinesOfCode integer(int32) false none Coverable lines of code in the file
numberOfMethods integer(int32) true none Number of methods in the file
numberOfClones integer(int32) false none Number of cloned blocks of code in the file

FileListResponse

{
  "data": [
    {
      "fileId": 2,
      "branchId": 3,
      "path": "/src/test.go",
      "totalIssues": 42,
      "complexity": 3,
      "grade": 74,
      "gradeLetter": "A",
      "coverage": 71,
      "coverageWithDecimals": 71,
      "duplication": 7,
      "linesOfCode": 123,
      "sourceLinesOfCode": 90,
      "numberOfMethods": 12,
      "numberOfClones": 5
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Properties

Name Type Required Restrictions Description
data [FileWithAnalysisInfo] true none [File with analysis information]
pagination PaginationInfo false none Cursor-based pagination information to obtain more items

FileCoverage

{
  "line": 2,
  "hits": 3
}

Coverage information for a file

Properties

Name Type Required Restrictions Description
line integer(int32) true none Line number
hits integer(int32) true none Number of test hits for the line

GetFileCoverageResponse

{
  "data": [
    {
      "line": 2,
      "hits": 3
    }
  ]
}

Properties

Name Type Required Restrictions Description
data [FileCoverage] true none [Coverage information for a file]

Language

{
  "name": "Scala"
}

Language information

Properties

Name Type Required Restrictions Description
name string true none name of the language

LanguageListResponse

{
  "data": [
    {
      "name": "Scala"
    }
  ]
}

Properties

Name Type Required Restrictions Description
data [Language] true none [Language information]

CreateCodingStandardBody

{
  "name": "Security best practices",
  "languages": [
    "Java",
    "Go"
  ]
}

Details of a new coding standard

Properties

Name Type Required Restrictions Description
name string true none Name of the new coding standard
languages [string] true none List of programming languages supported by the new coding standard

CodingStandardCategoriesPresets

{
  "bugRisk": 1,
  "security": 1,
  "bestPractices": 1,
  "codeStyle": 1,
  "documentation": 1
}

Settings to create a new coding standard from a series of presets

Properties

Name Type Required Restrictions Description
bugRisk integer(int32) true none none
security integer(int32) true none none
bestPractices integer(int32) true none none
codeStyle integer(int32) true none none
documentation integer(int32) true none none

CreateCodingStandardPresetBody

{
  "name": "Security best practices",
  "isDefault": true,
  "presets": {
    "bugRisk": 1,
    "security": 1,
    "bestPractices": 1,
    "codeStyle": 1,
    "documentation": 1
  }
}

Details of a new coding standard. Uses presets to streamline the creation of the new coding standard

Properties

Name Type Required Restrictions Description
name string false none Name of the new coding standard
isDefault boolean true none If true, the new coding standard becomes the default coding standard for the organization
presets CodingStandardCategoriesPresets true none Settings to create a new coding standard based on a series of presets

SetDefaultCodingStandardBody

{
  "isDefault": true
}

Toggle the default coding standard for an organization

Properties

Name Type Required Restrictions Description
isDefault boolean true none If true, sets the coding standard as the default coding standard for the organization

ProviderIntegrationSettingsBody

{
  "commitStatus": true,
  "pullRequestComment": true,
  "pullRequestSummary": true,
  "coverageSummary": true,
  "suggestions": true,
  "aiEnhancedComments": true
}

Default settings for Git provider integrations

Properties

Name Type Required Restrictions Description
commitStatus boolean true none Toggle the feature "Status checks"
pullRequestComment boolean true none Toggle the feature "Issue annotations"
pullRequestSummary boolean true none Toggle the feature "Issue summaries"
coverageSummary boolean false none Toggle the feature "Coverage summary" (GitHub only)
suggestions boolean false none Toggle the feature "Suggested fixes" (GitHub only)
aiEnhancedComments boolean true none Toggle the feature "AI-enhanced comments". If "Suggested fixes" (GitHub only) is also enabled, then the AI-enhanced comments also provide suggested fixes. This is an experimental feature.

RepositoryIntegrationSettings

{
  "settings": {
    "commitStatus": true,
    "pullRequestComment": true,
    "pullRequestSummary": true,
    "coverageSummary": true,
    "suggestions": true,
    "aiEnhancedComments": true
  },
  "integratedBy": "example@codacy.com"
}

Settings for Git provider integrations

Properties

Name Type Required Restrictions Description
settings ProviderIntegrationSettingsBody true none Settings for Git provider integration
integratedBy string false none none

ProviderIntegrationSettingsPatchBody

{
  "commitStatus": true,
  "pullRequestComment": true,
  "pullRequestSummary": true,
  "coverageSummary": true,
  "suggestions": true,
  "aiEnhancedComments": true
}

Default settings for Git provider integrations

Properties

Name Type Required Restrictions Description
commitStatus boolean false none Toggle the feature "Status checks"
pullRequestComment boolean false none Toggle the feature "Issue annotations"
pullRequestSummary boolean false none Toggle the feature "Issue summaries"
coverageSummary boolean false none Toggle the feature "Coverage summary" (GitHub only)
suggestions boolean false none Toggle the feature "Suggested fixes" (GitHub only)
aiEnhancedComments boolean false none Toggle the feature "AI-enhanced comments". If "Suggested fixes" (GitHub only) is also enabled, then the AI-enhanced comments also provide suggested fixes.

ApplyCodingStandardToRepositoriesBody

{
  "link": [
    "string"
  ],
  "unlink": [
    "string"
  ]
}

Names of the repositories to link or unlink from a coding standard

Properties

Name Type Required Restrictions Description
link [string] true none Names of the repositories to link to a coding standard
unlink [string] true none Names of the repositories to unlink from a coding standard

ApplyGatePolicyToRepositoriesBody

{
  "link": [
    "string"
  ],
  "unlink": [
    "string"
  ]
}

Names of the repositories to link or unlink from a gate policy

Properties

Name Type Required Restrictions Description
link [string] true none Names of the repositories to link to a gate policy
unlink [string] true none Names of the repositories to unlink from a gate policy

UpdateCodingStandardPatternsBody

{
  "enabled": true
}

Specifies the update to apply to the code patterns of a tool in a coding standard

Properties

Name Type Required Restrictions Description
enabled boolean true none True enables the code patterns, and False disables them.

CodingStandardMeta

{
  "enabledToolsCount": 0,
  "enabledPatternsCount": 0,
  "linkedRepositoriesCount": 0
}

Meta information about a coding standard

Properties

Name Type Required Restrictions Description
enabledToolsCount integer(int32) true none Number of tools that are enabled in the coding standard
enabledPatternsCount integer(int32) true none Number of code patterns that are enabled in the coding standard
linkedRepositoriesCount integer(int32) true none Number of repositories using the coding standard

CodingStandard

{
  "id": 0,
  "name": "string",
  "isDraft": true,
  "isDefault": true,
  "languages": [
    "string"
  ],
  "meta": {
    "enabledToolsCount": 0,
    "enabledPatternsCount": 0,
    "linkedRepositoriesCount": 0
  }
}

Coding standard for an organization

Properties

Name Type Required Restrictions Description
id integer(int64) true none Identifier of the coding standard
name string true none Name of the coding standard
isDraft boolean true none True if the coding standard is a draft
isDefault boolean true none True if the coding standard is the default for the organization
languages [string] true none List of programming languages supported by the coding standard
meta CodingStandardMeta true none Meta information about a coding standard

CodingStandardTool

{
  "codingStandardId": 0,
  "uuid": "847feb32-9ff2-11ea-bb37-0242ac130002",
  "isEnabled": true
}

Information about a tool in a coding standard

Properties

Name Type Required Restrictions Description
codingStandardId integer(int64) true none Coding standard identifier
uuid string true none Unique identifier of the tool
isEnabled boolean true none True if the tool is enabled in the coding standard

CodingStandardResponse

{
  "data": {
    "id": 0,
    "name": "string",
    "isDraft": true,
    "isDefault": true,
    "languages": [
      "string"
    ],
    "meta": {
      "enabledToolsCount": 0,
      "enabledPatternsCount": 0,
      "linkedRepositoriesCount": 0
    }
  }
}

Properties

Name Type Required Restrictions Description
data CodingStandard true none Coding standard for an organization

CodingStandardsListResponse

{
  "data": [
    {
      "id": 0,
      "name": "string",
      "isDraft": true,
      "isDefault": true,
      "languages": [
        "string"
      ],
      "meta": {
        "enabledToolsCount": 0,
        "enabledPatternsCount": 0,
        "linkedRepositoriesCount": 0
      }
    }
  ]
}

List of coding standards for an organization

Properties

Name Type Required Restrictions Description
data [CodingStandard] true none [Coding standard for an organization]

CodingStandardToolsListResponse

{
  "data": [
    {
      "codingStandardId": 0,
      "uuid": "847feb32-9ff2-11ea-bb37-0242ac130002",
      "isEnabled": true
    }
  ]
}

Properties

Name Type Required Restrictions Description
data [CodingStandardTool] true none [Information about a tool in a coding standard]

CodingStandardPatternsListResponse

{
  "data": [
    {
      "patternDefinition": {
        "id": "accessor-pairs",
        "title": "string",
        "category": "Security",
        "subCategory": "XSS",
        "level": "Error",
        "severityLevel": "Error",
        "description": "Enforce getter and setter pairs in objects and classes",
        "explanation": "Accessor pairs description",
        "enabled": true,
        "languages": [
          "JavaScript"
        ],
        "timeToFix": 5,
        "parameters": [
          {
            "name": "getWithoutSet",
            "description": "getWithoutSet",
            "default": "true"
          }
        ]
      },
      "enabled": true,
      "parameters": [
        {
          "name": "getWithoutSet",
          "value": "true"
        }
      ]
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "meta": {
    "totalEnabled": 35
  }
}

Properties

Name Type Required Restrictions Description
data [CodingStandardPattern] true none [Code pattern configuration for a tool in a coding standard]
pagination PaginationInfo false none Cursor-based pagination information to obtain more items
meta StandardPatternListMeta false none Metadata for a retrieved coding standard's pattern list

ApplyCodingStandardToRepositoriesResult

{
  "successful": [
    "string"
  ],
  "failed": [
    "string"
  ]
}

Result of applying a coding standard to a list of repositories

Properties

Name Type Required Restrictions Description
successful [string] true none Names of the repositories that were successfully linked or unlinked from a coding standard
failed [string] true none Names of the repositories that failed to be linked or unlinked from a coding standard

GatePoliciesListResponse

{
  "data": [
    {
      "id": 1,
      "name": "policy-name",
      "isDefault": true,
      "readOnly": true,
      "meta": {
        "nrOfQualityGates": 10,
        "linkedRepositoriesCount": 10
      }
    }
  ]
}

List of gate policies for an organization

Properties

Name Type Required Restrictions Description
data [GatePolicySummarized] true none [Gate policy summary information, without the quality gate settings]

GatePolicySummarized

{
  "id": 1,
  "name": "policy-name",
  "isDefault": true,
  "readOnly": true,
  "meta": {
    "nrOfQualityGates": 10,
    "linkedRepositoriesCount": 10
  }
}

Gate policy summary information, without the quality gate settings

Properties

Name Type Required Restrictions Description
id integer(int64) true none Identifier of the gate policy
name string true none Name of the gate policy
isDefault boolean true none True if the gate policy is the default for the organization
readOnly boolean true none True if the quality gates of the gate policy cannot be changed
meta GatePolicyMeta true none Meta information about a gate policy

GetGatePolicyResultResponse

{
  "data": {
    "id": 1,
    "name": "policy-name",
    "isDefault": true,
    "readOnly": true,
    "settings": {
      "issueThreshold": {
        "threshold": 1,
        "minimumSeverity": "Error"
      },
      "securityIssueThreshold": 1,
      "duplicationThreshold": 1,
      "coverageThreshold": 1,
      "coverageThresholdWithDecimals": -0.02,
      "diffCoverageThreshold": 70,
      "complexityThreshold": 1
    },
    "meta": {
      "nrOfQualityGates": 10,
      "linkedRepositoriesCount": 10
    }
  }
}

Properties

Name Type Required Restrictions Description
data GatePolicy true none Details of the gate policy

ListRepositoriesFollowingGatePolicyResultResponse

{
  "data": [
    {
      "repositoryId": 0,
      "name": "codacy-eslint"
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Properties

Name Type Required Restrictions Description
data [RepositoryIdentification] true none List of repositories following a gate policy
pagination PaginationInfo false none Cursor-based pagination information to obtain more items

GatePolicy

{
  "id": 1,
  "name": "policy-name",
  "isDefault": true,
  "readOnly": true,
  "settings": {
    "issueThreshold": {
      "threshold": 1,
      "minimumSeverity": "Error"
    },
    "securityIssueThreshold": 1,
    "duplicationThreshold": 1,
    "coverageThreshold": 1,
    "coverageThresholdWithDecimals": -0.02,
    "diffCoverageThreshold": 70,
    "complexityThreshold": 1
  },
  "meta": {
    "nrOfQualityGates": 10,
    "linkedRepositoriesCount": 10
  }
}

Details of the gate policy

Properties

Name Type Required Restrictions Description
id integer(int64) true none Identifier of the gate policy
name string true none Name of the gate policy
isDefault boolean true none True if the gate policy is the default for the organization
readOnly boolean true none True if the quality gates of the gate policy cannot be changed
settings QualityGate true none none
meta GatePolicyMeta true none Meta information about a gate policy

CreateGatePolicyBody

{
  "gatePolicyName": "gate-policy-name",
  "isDefault": true,
  "settings": {
    "issueThreshold": {
      "threshold": 1,
      "minimumSeverity": "Error"
    },
    "securityIssueThreshold": 1,
    "duplicationThreshold": 1,
    "coverageThreshold": 1,
    "coverageThresholdWithDecimals": -0.02,
    "diffCoverageThreshold": 70,
    "complexityThreshold": 1
  }
}

Details of a new gate policy

Properties

Name Type Required Restrictions Description
gatePolicyName string true none Name of the gate policy
isDefault boolean false none none
settings QualityGate false none none

GatePolicyMeta

{
  "nrOfQualityGates": 10,
  "linkedRepositoriesCount": 10
}

Meta information about a gate policy

Properties

Name Type Required Restrictions Description
nrOfQualityGates integer(int32) true none Number of quality gates that are configured in the gate policy
linkedRepositoriesCount integer(int32) true none Number of repositories following the gate policy

ApplyCodingStandardToRepositoriesResultResponse

{
  "data": {
    "successful": [
      "string"
    ],
    "failed": [
      "string"
    ]
  }
}

Properties

Name Type Required Restrictions Description
data ApplyCodingStandardToRepositoriesResult true none Result of applying a coding standard to a list of repositories

CodingStandardPattern

{
  "patternDefinition": {
    "id": "accessor-pairs",
    "title": "string",
    "category": "Security",
    "subCategory": "XSS",
    "level": "Error",
    "severityLevel": "Error",
    "description": "Enforce getter and setter pairs in objects and classes",
    "explanation": "Accessor pairs description",
    "enabled": true,
    "languages": [
      "JavaScript"
    ],
    "timeToFix": 5,
    "parameters": [
      {
        "name": "getWithoutSet",
        "description": "getWithoutSet",
        "default": "true"
      }
    ]
  },
  "enabled": true,
  "parameters": [
    {
      "name": "getWithoutSet",
      "value": "true"
    }
  ]
}

Code pattern configuration for a tool in a coding standard

Properties

Name Type Required Restrictions Description
patternDefinition Pattern true none Code pattern that a Codacy tool can use to find issues
enabled boolean true none True if the code pattern is enabled in the coding standard
parameters CodingStandardParametersList true none none

StandardPatternListMeta

{
  "totalEnabled": 35
}

Metadata for a retrieved coding standard's pattern list

Properties

Name Type Required Restrictions Description
totalEnabled integer(int32) true none Total number of enabled patterns

CodingStandardParametersList

[
  {
    "name": "getWithoutSet",
    "value": "true"
  }
]

Properties

Name Type Required Restrictions Description
anonymous [CodingStandardParameter] false none [Parameter to configure a code pattern for a tool in a coding standard]

RepositoryIdentification

{
  "repositoryId": 0,
  "name": "codacy-eslint"
}

Identifier and name of a repository using a coding standard

Properties

Name Type Required Restrictions Description
repositoryId integer(int64) true none Identifier of the repository
name string true none Name of the repository

CodingStandardRepositoriesListResponse

{
  "data": [
    {
      "repositoryId": 0,
      "name": "codacy-eslint"
    }
  ],
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  }
}

Properties

Name Type Required Restrictions Description
data [RepositoryIdentification] true none List of repositories using a coding standard
pagination PaginationInfo false none Cursor-based pagination information to obtain more items

CodingStandardParameter

{
  "name": "getWithoutSet",
  "value": "true"
}

Parameter to configure a code pattern for a tool in a coding standard

Properties

Name Type Required Restrictions Description
name string true none Code pattern parameter name
value string true none Code pattern parameter value

ToolConfiguration

{
  "enabled": true,
  "patterns": [
    {
      "id": "ESLint_@typescript-eslint_no-shadow",
      "enabled": true,
      "parameters": [
        {
          "name": "getWithoutSet",
          "value": "true"
        }
      ]
    }
  ]
}

Configuration of a tool and its code patterns

Properties

Name Type Required Restrictions Description
enabled boolean false none True if the tool is enabled in the repository or coding standard
patterns [PatternConfiguration] true none List of code pattern configurations

PatternConfiguration

{
  "id": "ESLint_@typescript-eslint_no-shadow",
  "enabled": true,
  "parameters": [
    {
      "name": "getWithoutSet",
      "value": "true"
    }
  ]
}

Code pattern configuration

Properties

Name Type Required Restrictions Description
id string true none Code pattern unique identifier
enabled boolean false none True if the code pattern is enabled in the repository or coding standard
parameters [CodingStandardParameter] false none List of code pattern parameter configurations

SearchOrganizationRepositoriesWithAnalysis

{
  "names": [
    "string"
  ]
}

Search organization repositories with analysis query body

Properties

Name Type Required Restrictions Description
names [string] false none List of repository names

FileExtensionsResponse

{
  "languagesExtensions": [
    {
      "name": "string",
      "codacyDefaults": [
        "string"
      ],
      "extensions": [
        "string"
      ]
    }
  ]
}

Properties

Name Type Required Restrictions Description
languagesExtensions [FileExtensions] true none List of languages with supported extensions

FileExtensions

{
  "name": "string",
  "codacyDefaults": [
    "string"
  ],
  "extensions": [
    "string"
  ]
}

List of supported file extensions for a specific language

Properties

Name Type Required Restrictions Description
name string true none Language name
codacyDefaults [string] true none Default Codacy extensions for the language
extensions [string] true none List of custom extensions for the language

FileExtensionsUpdate

{
  "name": "string",
  "extensions": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
name string true none Language name
extensions [string] true none List of custom file extensions for the language

FileExtensionsBody

{
  "languagesExtensions": [
    {
      "name": "string",
      "extensions": [
        "string"
      ]
    }
  ]
}

Properties

Name Type Required Restrictions Description
languagesExtensions [FileExtensionsUpdate] true none List of custom file extensions to associate with each language for a repository

IssueStateBody

{
  "ignored": true
}

Ignored status of an issue

Properties

Name Type Required Restrictions Description
ignored boolean true none True if the issue is ignored

CodeBlockLine

{
  "number": 0,
  "content": "string"
}

Properties

Name Type Required Restrictions Description
number integer true none Line number
content string true none Line content

CodeBlockLineListResponse

{
  "data": [
    {
      "number": 0,
      "content": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
data [CodeBlockLine] true none none

FileStateBody

{
  "ignored": true,
  "filepath": "src/main/scala/main/Main.scala"
}

Ignored status of a file

Properties

Name Type Required Restrictions Description
ignored boolean true none True if the file is ignored
filepath string true none Relative path of the file in the repository

SrmStatus

"Overdue"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous Overdue
anonymous OnTrack
anonymous DueSoon
anonymous ClosedOnTime
anonymous ClosedLate

SrmPriority

"Critical"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous Low
anonymous Medium
anonymous High
anonymous Critical

SrmSource

"Codacy"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous Codacy
anonymous Jira
anonymous PenTest

SrmLikelihood

"low"

Probability of the security issue being exploited.

Properties

Name Type Required Restrictions Description
anonymous string false none Probability of the security issue being exploited.

Enumerated Values

Property Value
anonymous Low
anonymous Medium
anonymous High
anonymous not_applicable

SrmEffortToFix

"low"

Estimated effort to fix the issue.

Properties

Name Type Required Restrictions Description
anonymous string false none Estimated effort to fix the issue.

Enumerated Values

Property Value
anonymous Low
anonymous Medium
anonymous High
anonymous not_applicable

SrmItemsSortBy

"Status"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous Status
anonymous DetectedAt

SrmItemsResponse

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "id": "ba7c836d-85f8-4617-9a95-ac6f00af1d30",
      "itemSource": "Codacy",
      "itemSourceId": "764334",
      "title": "Codacy quality - critical security issue 764334",
      "repository": "codacy-docs",
      "openedAt": "2017-07-21T17:32:28Z",
      "closedAt": "2017-08-21T17:32:28Z",
      "dueAt": "2017-07-21T17:32:28Z",
      "priority": "Critical",
      "status": "Overdue",
      "htmlUrl": "https://app.codacy.com/gh/test-org/test-repo/issues?resultDataId=12345",
      "projectKey": "PUL",
      "securityCategory": "Cryptography",
      "summary": "Modern web application design incorporates a Same-Origin Policy (SOP) in order to restrict interactions between scripts loaded on the origin and resources hosted on other origins.",
      "cvssScore": "0.42",
      "cvssVector": "CVSS:3.0/AV:A/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:L/E:U/MUI:N",
      "cwe": "CWE-122",
      "affectedTargets": "https://example.com",
      "likelihood": "Low",
      "effortToFix": "High",
      "remediation": "Always ensure that the 'Access-Control-Allow-Origin' only allows specific origins."
    }
  ]
}

Security and risk management item list, sorted by due date descending.

Properties

Name Type Required Restrictions Description
pagination PaginationInfo true none Cursor-based pagination information to obtain more items
data [SrmItem] true none [Security and risk management item of an organization.]

SrmItemResponse

{
  "data": {
    "id": "ba7c836d-85f8-4617-9a95-ac6f00af1d30",
    "itemSource": "Codacy",
    "itemSourceId": "764334",
    "title": "Codacy quality - critical security issue 764334",
    "repository": "codacy-docs",
    "openedAt": "2017-07-21T17:32:28Z",
    "closedAt": "2017-08-21T17:32:28Z",
    "dueAt": "2017-07-21T17:32:28Z",
    "priority": "Critical",
    "status": "Overdue",
    "htmlUrl": "https://app.codacy.com/gh/test-org/test-repo/issues?resultDataId=12345",
    "projectKey": "PUL",
    "securityCategory": "Cryptography",
    "summary": "Modern web application design incorporates a Same-Origin Policy (SOP) in order to restrict interactions between scripts loaded on the origin and resources hosted on other origins.",
    "cvssScore": "0.42",
    "cvssVector": "CVSS:3.0/AV:A/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:L/E:U/MUI:N",
    "cwe": "CWE-122",
    "affectedTargets": "https://example.com",
    "likelihood": "Low",
    "effortToFix": "High",
    "remediation": "Always ensure that the 'Access-Control-Allow-Origin' only allows specific origins."
  }
}

Response with a security and risk management item.

Properties

Name Type Required Restrictions Description
data SrmItem true none Security and risk management item of an organization.

SrmItem

{
  "id": "ba7c836d-85f8-4617-9a95-ac6f00af1d30",
  "itemSource": "Codacy",
  "itemSourceId": "764334",
  "title": "Codacy quality - critical security issue 764334",
  "repository": "codacy-docs",
  "openedAt": "2017-07-21T17:32:28Z",
  "closedAt": "2017-08-21T17:32:28Z",
  "dueAt": "2017-07-21T17:32:28Z",
  "priority": "Critical",
  "status": "Overdue",
  "htmlUrl": "https://app.codacy.com/gh/test-org/test-repo/issues?resultDataId=12345",
  "projectKey": "PUL",
  "securityCategory": "Cryptography",
  "summary": "Modern web application design incorporates a Same-Origin Policy (SOP) in order to restrict interactions between scripts loaded on the origin and resources hosted on other origins.",
  "cvssScore": "0.42",
  "cvssVector": "CVSS:3.0/AV:A/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:L/E:U/MUI:N",
  "cwe": "CWE-122",
  "affectedTargets": "https://example.com",
  "likelihood": "Low",
  "effortToFix": "High",
  "remediation": "Always ensure that the 'Access-Control-Allow-Origin' only allows specific origins."
}

Security and risk management item of an organization.

Properties

Name Type Required Restrictions Description
id string(uuid) true none Item ID internal to Codacy.
itemSource string true none Source platform of the item's underlying issue
itemSourceId string true none Original source item ID.
title string true none Human-readable title of the item.
repository string false none none
openedAt string(date-time) true none none
closedAt string(date-time) false none none
dueAt string(date-time) true none none
priority string true none none
status string true none none
htmlUrl string false none Link to the item's underlying issue
projectKey string false none Jira project key of the item's underlying issue
securityCategory string false none The category of a security item identified by Codacy
summary string false none Brief description of the issue. Specific to penetration testing issues.
cvssScore number(float) false none CVSS (Common Vulnerability Scoring System) score representing the severity of the vulnerability. Specific to penetration testing issues.
cvssVector string false none CVSS (Common Vulnerability Scoring System) scoring vector, including various metrics detailing the nature and impact of the vulnerability. Specific to penetration testing issues.
cwe string false none CWE (Common Weakness Enumeration) software vulnerability identifier. Specific to penetration testing issues.
affectedTargets string false none List of targets affected by the security issue, determined dynamically based on the target type. Includes URLs, app names with operating systems for mobile apps, SSIDs for wireless, hostnames, full names for social engineering targets, and various combinations of hostnames and IP addresses for other targets. Cannot guarantee a specific format. Specific to penetration testing issues.
likelihood string false none Specific to penetration testing issues.
effortToFix string false none Specific to penetration testing issues.
remediation string false none Recommended steps to fix the security issue. Specific to penetration testing issues.

Enumerated Values

Property Value
itemSource Codacy
itemSource Jira
itemSource PenTest
priority Low
priority Medium
priority High
priority Critical
status Overdue
status OnTrack
status DueSoon
status ClosedOnTime
status ClosedLate
likelihood Low
likelihood Medium
likelihood High
likelihood not_applicable
effortToFix Low
effortToFix Medium
effortToFix High
effortToFix not_applicable

SrmPriorityMapping

{
  "priority": "Critical",
  "criteria": {
    "category": "Security",
    "severity": "Error"
  },
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}

Security and risk management priority mapping

Properties

Name Type Required Restrictions Description
priority string true none none
criteria object true none none
» category string true none Issue category
» severity SeverityLevel true none Issue severity level. (These values map to our UI as follows: Info->Minor, Warning->Medium, Error->Critical)
createdAt string(date-time) false none Priority mapping creation date
updatedAt string(date-time) false none Priority mapping update date

Enumerated Values

Property Value
priority Low
priority Medium
priority High
priority Critical

MembershipPrivilegesBody

{
  "permission": "OrganizationOwner"
}

Minimum permission level regarding configuring patterns, configuring which file extensions and branches are analyzed, and ignoring issues and files

Properties

Name Type Required Restrictions Description
permission MembershipPrivileges false none none

MembershipPrivileges

"OrganizationOwner"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous OrganizationOwner
anonymous RepoAdmin
anonymous RepoWrite
anonymous RepoRead

SearchSRMDashboard

{
  "repositories": [
    "string"
  ],
  "priorities": [
    "Low"
  ],
  "categories": [
    "string"
  ]
}

Request body to filter the metrics of the security issues dashboard of an organization.

Properties

Name Type Required Restrictions Description
repositories [string] false none Repository names to filter by.
priorities [string] false none Security issue priorities to filter by. See SrmPriority for possible values.
categories [string] false none Security categories to filter by. Use _other_ to search for issues that don't have a security category.

SearchSRMItems

{
  "repositories": [
    "string"
  ],
  "priorities": [
    "string"
  ],
  "statuses": [
    "string"
  ],
  "categories": [
    "string"
  ]
}

Request body to filter the security issues of an organization.

Properties

Name Type Required Restrictions Description
repositories [string] false none Repository names to filter by.
priorities [string] false none Security issue priorities to filter by. See SrmPriority for possible values.
statuses [string] false none Security issue priorities to filter by. See SrmStatus for possible values.
categories [string] false none Security categories to filter by. Use _other_ to search for issues that don't have a security category.

SearchSRMDashboardRepositories

{
  "repositories": [
    "string"
  ]
}

Request body to filter the search for the list of organization repositories with security findings.

Properties

Name Type Required Restrictions Description
repositories [string] false none Repository names to filter by.

SearchSRMDashboardHistory

{
  "repositories": [
    "string"
  ]
}

Request body to filter the evolution of security findings over time.

Properties

Name Type Required Restrictions Description
repositories [string] false none Repository names to filter by.

SearchSRMDashboardCategories

{
  "repositories": [
    "string"
  ]
}

Request body to filter the search for the list of security categories with findings.

Properties

Name Type Required Restrictions Description
repositories [string] false none Repository names to filter by.

SecurityManagersResponse

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "userId": 867842577,
      "name": "John Doe",
      "email": "example@codacy.com",
      "createdAt": "2017-07-21T17:32:28Z"
    }
  ]
}

Security manager list sorted by organization admin status first and then alphabetically

Properties

Name Type Required Restrictions Description
pagination PaginationInfo true none Cursor-based pagination information to obtain more items
data [SecurityManager] true none [Organization admin or security manager.]

SecurityManager

{
  "userId": 867842577,
  "name": "John Doe",
  "email": "example@codacy.com",
  "createdAt": "2017-07-21T17:32:28Z"
}

Organization admin or security manager.

Properties

Name Type Required Restrictions Description
userId integer(int64) true none User ID internal to Codacy.
name string false none none
email string true none none
createdAt string(date-time) true none none

SecurityManagerBody

{
  "userId": 867842577
}

Assign or revoke the Security Manager role for an organization member.

Properties

Name Type Required Restrictions Description
userId integer(int64) true none User ID of the organization member to be promoted to security manager.

JiraIntegration

{
  "organization_id": 867842577,
  "instance_id": "1324a887-45db-1bf4-1e99-ef0ff456d421",
  "instance_name": "codacy",
  "created_at": "2020-11-09T09:10:00Z",
  "updated_at": "2020-11-09T09:10:00Z"
}

Details of a Jira integration for the security and risk management feature.

Properties

Name Type Required Restrictions Description
organization_id integer(int64) true none Codacy organization ID
instance_id string true none Jira cloud ID of the organization
instance_name string true none Name of the Jira instance that Codacy has access to
created_at string(date-time) true none none
updated_at string(date-time) true none none

JiraIntegrationResponse

{
  "data": {
    "organization_id": 867842577,
    "instance_id": "1324a887-45db-1bf4-1e99-ef0ff456d421",
    "instance_name": "codacy",
    "created_at": "2020-11-09T09:10:00Z",
    "updated_at": "2020-11-09T09:10:00Z"
  }
}

A response with a Jira integration

Properties

Name Type Required Restrictions Description
data JiraIntegration true none Details of a Jira integration for the security and risk management feature.

SlackIntegration

{
  "organization_id": 867842577,
  "webhook_url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
  "created_at": "2020-11-09T09:10:00Z",
  "updated_at": "2020-11-09T09:10:00Z"
}

Details of a Slack integration.

Properties

Name Type Required Restrictions Description
organization_id integer(int64) true none Codacy organization ID
webhook_url string true none Slack Incoming Webhook URL to post notifications to.
created_at string(date-time) true none none
updated_at string(date-time) true none none

SlackIntegrationRequest

{
  "webhook_url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
}

The request body to create or update the Slack integration of the organization.

Properties

Name Type Required Restrictions Description
webhook_url string true none Slack Incoming Webhook URL to post notifications to.

SlackIntegrationResponse

{
  "data": {
    "organization_id": 867842577,
    "webhook_url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
    "created_at": "2020-11-09T09:10:00Z",
    "updated_at": "2020-11-09T09:10:00Z"
  }
}

Properties

Name Type Required Restrictions Description
data SlackIntegration true none Details of a Slack integration.

SecurityRepositoriesResponse

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    {
      "repositoryId": 45738,
      "provider": "gh",
      "owner": "codacy",
      "name": "codacy-eslint"
    }
  ]
}

List of repositories that have security issues.

Properties

Name Type Required Restrictions Description
pagination PaginationInfo true none Cursor-based pagination information to obtain more items
data [RepositorySummary] true none [Essential information to describe a repository.]

SecurityCategoriesResponse

{
  "pagination": {
    "cursor": "string",
    "limit": 0,
    "total": 0
  },
  "data": [
    "Cryptography"
  ]
}

List of security categories that have security issues.

Properties

Name Type Required Restrictions Description
pagination PaginationInfo true none Cursor-based pagination information to obtain more items
data [string] true none none

CommitDetails

{
  "commit": {
    "sha": "string",
    "id": 1,
    "commitTimestamp": "2019-05-07T14:29:13.430Z",
    "authorName": "string",
    "authorEmail": "string",
    "message": "string",
    "startedAnalysis": "2022-01-07T14:29:13.430Z",
    "endedAnalysis": "2022-01-07T14:29:13.430Z",
    "isMergeCommit": false,
    "gitHref": "https://github.com/codacy/tools-for-code-review-engineers/commit/370b160aaf0ed781d707d335aa1fde20cefeabf2",
    "parents": [
      "string"
    ]
  },
  "repository": {
    "repositoryId": 0,
    "name": "codacy-eslint"
  }
}

Details of a commit.

Properties

Name Type Required Restrictions Description
commit Commit true none none
repository RepositoryIdentification true none Identifier and name of a repository using a coding standard

ConfigureToolBody

{
  "patterns": [
    {
      "id": "ESLint_@typescript-eslint_no-shadow",
      "enabled": true
    }
  ]
}

How to configure a tool.

Properties

Name Type Required Restrictions Description
patterns [ConfigurePattern] false none The patterns to enable or disable.

ConfigurePattern

{
  "id": "ESLint_@typescript-eslint_no-shadow",
  "enabled": true
}

A pattern to enable or disable.

Properties

Name Type Required Restrictions Description
id string true none The pattern's id.
enabled boolean true none Whether to enable or disable the pattern.

GitProviderAppPermissions

{
  "contentPermission": true
}

Information about Codacy GitHub App repository permissions

Properties

Name Type Required Restrictions Description
contentPermission boolean true none True if Codacy GitHub App has repository permissions for Contents, false otherwise.