ListCommits - List commits

Updated at:

Retrieves commits from a repository.

Applicable editions

Central edition, Region edition

Service endpoint and authorization

Product

Resource

Required permission

Codeup

commit

Read-only

Request syntax

Central edition

GET https://{domain}/oapi/v1/codeup/organizations/{organizationId}/repositories/{repositoryId}/commits

Region edition

GET https://{domain}/oapi/v1/codeup/repositories/{repositoryId}/commits

Request headers

Parameter

Type

Required

Description

Example

x-yunxiao-token

string

Yes

The personal access token.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

In

Required

Description

Example

organizationId

string

path

  • Yes, for Central edition

  • No, for Region edition

The organization ID.

60d54f3daccf2bbd6659f3ad

repositoryId

string

path

Yes

The ID or URL-encoded path of the repository.

2813489 or 60de7a6852743a5162b5f957%2FDemoRepo

refName

string

query

Yes

The branch name, tag name, or commit revision. If omitted, the repository's default branch is used.

master

since

string

query

No

The start time for filtering commits. The value must be in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

2024-10-05T15:30:45Z

until

string

query

No

The end time for filtering commits. The value must be in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

2024-10-05T15:30:45Z

page

integer

query

No

The page number of the results to return.

1

perPage

integer

query

No

The number of results per page.

10

path

string

query

No

The file path by which to filter commits.

src/test/main.java

search

string

query

No

The keyword to search for in commit messages.

Test

showSignature

boolean

query

No

Specifies whether to show the signature.

false

committerIds

string

query

No

A comma-separated list of committer IDs.

[62c795xxxb468af8]

Request examples

Central edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/codeup/organizations/60d54f3daccf2bbd6659f3ad/repositories/2813489/commits?refName=master&since=2024-10-05T15:30:45Z&until=2024-10-05T15:30:45Z&page=1&perPage=10&path=src/test/main.java&search=Test&showSignature=false&committerIds=[62c795xxxb468af8]' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Region edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/codeup/repositories/2813489/commits?refName=master&since=2024-10-05T15:30:45Z&until=2024-10-05T15:30:45Z&page=1&perPage=10&path=src/test/main.java&search=Test&showSignature=false&committerIds=[62c795xxxb468af8]' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response parameters

Parameter

Type

Description

Example

-

array

An array of commit objects.

-

object

A commit object.

authorEmail

string

The email address of the author.

username@example.com

authorName

string

The name of the author.

codeup-name

authoredDate

string

The time when the author created the commit.

2024-10-05T15:30:45Z

committedDate

string

The time when the committer created the commit.

2024-10-05T15:30:45Z

committerEmail

string

The email address of the committer.

username@example.com

committerName

string

The name of the committer.

codeup-name

id

string

The ID of the commit.

6da8c14b5a9102998148b7ea35f96507d5304f74

message

string

The commit message.

commit message detail

parentIds

array[string]

The IDs of the parent commits.

["3fdaf119cf76539c1a47de0074ac02927ef4c8e1"]

shortId

string

The short ID of the commit.

6da8c14b

stats

object

Line change statistics for the commit. This parameter is returned only if available.

additions

integer

The number of lines added.

1

deletions

integer

The number of lines deleted.

1

total

integer

The total number of lines changed.

2

title

string

The commit title (the first line of the commit message).

commit msg title

webUrl

string

The web URL for the commit.

http://example.com/example_repo/commit/commit_sha

Response example

[
    {
        "authorEmail": "username@example.com",
        "authorName": "codeup-name",
        "authoredDate": "2024-10-05T15:30:45Z",
        "committedDate": "2024-10-05T15:30:45Z",
        "committerEmail": "username@example.com",
        "committerName": "codeup-name",
        "id": "6da8c14b5a9102998148b7ea35f96507d5304f74",
        "message": "commit message detail",
        "parentIds": ["3fdaf119cf76539c1a47de0074ac02927ef4c8e1"],
        "shortId": "6da8c14b",
        "stats": {
            "additions": 1,
            "deletions": 1,
            "total": 2
        },
        "title": "commit msg title",
        "webUrl": "http://exmaple.com/example_repo/commit/commit_sha"
    }
]

Response headers

Parameter

Description

Example

x-next-page

The next page number.

3

x-page

The current page number.

2

x-per-page

The number of results per page.

20

x-prev-page

The previous page number.

1

x-request-id

The request ID.

37294673-00CA-5B8B-914F-A8B35511E90A

x-total

The total number of results.

50

x-total-pages

The total number of pages.

3

Error codes

For API-specific error codes, see the Error Code Center.