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

Querying a Commit Message of a Repository

Description

This API is used to obtain a commit message by the repository short ID. The list of all commits in a path can be queried by the file path.

URI

GET /v2/projects/{repo_id}/repository/commits

Table 1 Path parameters

Parameter

Mandatory

Type

Description

repo_id

Yes

Integer

Repository short ID

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

ref_name

No

String

Branch or tag name of a repository. If this parameter is left blank, the default branch is queried.

since

No

String

Date after which the commit operation is performed or on the current day. The format is YYYY-MM-DDTHH:MM:SSZ.

until

No

String

Date after which the commit operation is performed or on the current day. The format is YYYY-MM-DDTHH:MM:SSZ.

path

No

String

File path

all

No

Boolean

Whether to search for each commit in a repository

with_stats

No

Boolean

Whether statistics about each commit are added to the response

page

No

Integer

Page number

Minimum value: 1

Maximum value: 2,147,483,647

per_page

No

Integer

Record number on each page

Minimum value: 1

Maximum value: 100

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

Array of CommitInfo objects

Commit list

status

String

Response status

Table 5 Error

Parameter

Type

Description

code

String

Error codes

message

String

Error message

Table 6 CommitInfo

Parameter

Type

Description

id

String

SHA ID of a commit

short_id

String

Short SHA ID of a commit

title

String

Commit title

author_name

String

Author

author_email

String

Author email

committer_name

String

Committer

committer_email

String

Committer email

created_at

String

Creation time

message

String

Commit message

parent_ids

Array of strings

Parent commit ID

committed_date

String

Commit time

authored_date

String

Author commit time

Request Examples

GET https://{endpoint}/v2/projects/859341/repository/commits

Response Examples

Status code: 200

Request succeeded

{
  "result" : [ {
    "id" : "85a0a9d5c6e43bc9c3e443ac01f789e24eeef02b",
    "title" : "some commit message",
    "message" : "some commit message",
    "short_id" : "85a0a9d5",
    "author_name" : "repo",
    "author_email" : null,
    "committer_name" : "repo",
    "committer_email" : null,
    "created_at" : "2021-09-26T03:44:51.000Z",
    "parent_ids" : [ "5c114bb316dff4d4a046e09a5c44c816f2433140" ],
    "committed_date" : "2021-09-26T03:44:51.000Z",
    "authored_date" : null
  }, {
    "id" : "5c114bb316dff4d4a046e09a5c44c816f2433140",
    "title": " Update README.md",
    "message" : "Update README.md",
    "short_id" : "5c114bb3",
    "author_name" : "repo",
    "author_email" : null,
    "committer_name" : "repo",
    "committer_email" : null,
    "created_at" : "2021-08-26T12:02:58.000Z",
    "parent_ids" : [ "646fc72bd87eb02e1e84bf3b82179c7f6d22c2c2" ],
    "committed_date" : "2021-08-26T12:02:58.000Z",
    "authored_date" : null
  } ],
  "status" : "success"
}

Status Codes

Status Codes

Description

200

Request succeeded

Error Codes

See Error Codes.