Help Center/ CodeArts Repo/ API Reference (Ally Region)/ APIs/ Repository/ Obtaining the Last Commit Statistics of a Repository
Updated on 2026-01-08 GMT+08:00

Obtaining the Last Commit Statistics of a Repository

Description

This API is used to obtain the last commit statistics of a repository.

URI

GET /v1/repositories/{repository_id}/statistics

Table 1 Path parameters

Parameter

Mandatory

Type

Description

repository_id

Yes

String

Repository primary key ID

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

branch_name

Yes

String

Branch name

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

error

Error object

Response error

result

RepoCommitStatistics object

Response result

status

String

Response status

Table 5 Error

Parameter

Type

Description

code

String

Error codes

message

String

Error message

Table 6 RepoCommitStatistics

Parameter

Type

Description

all_branch_commits_count

Integer

Total commits

codelines

Array of RepoDailyCodeline objects

Daily committed lines in last 15 days

count

Integer

Total commits in the corresponding repository

event

RepoStatisticsEvent object

Repository statistics status

statistics

Array of RepoStatistics objects

Repository statistics list

total

Integer

Total collects

Table 7 RepoDailyCodeline

Parameter

Type

Description

additions

Integer

Daily increased code lines

date

String

Date

deletions

Integer

Daily deleted code lines

Table 8 RepoStatisticsEvent

Parameter

Type

Description

branch

String

Branch name

Minimum length: 1

Maximum length: 260

created_at

String

Repository statistics creation time

date

String

Repository statistics date

id

Integer

Repository statistical event ID

project_id

Integer

Repository ID

status

String

Repository statistical status: waiting, active, and finish.

updated_at

String

Repository statistics update time

user_id

Integer

User ID

Table 9 RepoStatistics

Parameter

Type

Description

add_lines

Integer

Add code lines

branch

String

Branch name

Minimum length: 1

Maximum length: 260

commit_count

Integer

Number of commits

created_at

String

Repository statistics creation time

delete_lines

Integer

Deleted code lines

id

Integer

Repository statistics record ID

project_id

Integer

Repository ID

updated_at

String

Repository statistics update time

user_name

String

Username

Request Examples

None.

Response Examples

Status code: 200

Request succeeded

{
  "result" : {
    "event" : null,
    "total" : 0,
    "statistics" : [ ],
    "all_branch_commits_count" : 1,
    "count" : 1,
    "codelines" : {
      "additions" : 0,
      "deletions" : 0,
      "date" : "20191015"
    }
  },
  "status" : "success"
}

Status Codes

Status Codes

Description

200

Request succeeded

Error Codes

See Error Codes.