List Scores for Contributors

curl --header "Authorization: bearer {your_personal_access_token}" https://api.codeowners.com/api/v1/owners/{org}/{repository}/scores/{path}?collabIds[]={collaboratorId}&collabIds[]={collaboratorId2}&teamIds[]={teamId}&teamIds[]={teamId2}

The endpoint will return a list of files and the contributor scores for those files. If the path is a directory, we will return scores which have been summarized for the files below the specified directory. If no path is specified it returns scores for the root of the repository.

It will only return scores for the collaborators or teams specified. For each team that is specified, it will return scores for the members of the team.

If you want to return the team score summarized for a specific path, see the documentation for the Team Score endpoint.

Headers:

Authorization: string; Required;

Append the bearer followed with your personal-access-token

Path parameters:

org : string; Required;

The organization who owns the repository.

repository: string; Required;

The name of the repository.

path: string; Optional;

Relative path of a file or a directory from the root of your repository

Response schema:

{
	"type": array,
    "items": {
    	"type": "Score",
        "properties": {
        	"path": {
            	"type": string,
                "description": "The path of the file or directory"
            },
            "collaborators": {
            	"type": array,
                "items": {
                	"type": "ScoreItem",
                    "properties": {
                    	"id": {
                        	"type": integer,
                            "description": "Id of the contributor"
                        },
                        "score": {
                        	"type": float,
                            "description": "The score for the path, if path is a directory it is the summarized score from the nested files for that contributor."
                        }
                    }
                }
            }
        }
    }
}

Example response:

[
	{
		"path": "/src/index.ts",
		"collaborators": [
			{
				"id": 1,
				"score": 0.23
			},
			{
				"id": 2,
				"score": 0.12
			},
			{
				"id": 3,
				"score": 0.02
			}
		]
	},
	{
		"path": "/src/components/",
		"collaborators": [
			{
				"id": 1,
				"score": 0.34
			},
			{
				"id": 2,
				"score": 0.02
			},
		]
	},
]