Help Center/ CodeArts Repo/ API Reference/ APIs/ V4/ Repository/ Obtaining the Latest Push Event of a Repository
Updated on 2026-01-27 GMT+08:00

Obtaining the Latest Push Event of a Repository

Function

This API is used to obtain the latest push event of a repository.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

Authorization Information

Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

codeartsrepo:repository:getRepository

Read

-

-

-

-

URI

GET https://{hostURL}/v4/repositories/{repository_id}/last-push-event

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

repository_id

Yes

Integer

Definition

You can query the project list to obtain the repository ID by calling the API used to query user's all repositories.

Constraints

N/A

Default Value

N/A

Value range:

1~2147483647

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token. Obtain one by calling the IAM API Obtaining a User Token. The value of X-Subject-Token in the response header is a token.

Constraints

N/A

Range

1–100,000 characters.

Default Value

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

ref

String

Definition:

Branch or tag name.

Value range:

N/A.

created_at

String

Definition:

Creation time.

Value range:

N/A.

repository

RepositoryBriefDto object

Definition:

Repository information.

Value range:

N/A.

Table 4 RepositoryBriefDto

Parameter

Type

Description

id

Integer

Definition:

Repository ID.

Value range:

N/A.

Value range:

1~2147483647

name

String

Definition:

Repository name.

Value range:

N/A.

path

String

Definition:

Repository path.

Value range:

N/A.

path_with_namespace

String

Definition:

Complete repository path.

Value range:

N/A.

project_name

String

Definition:

Repository project name.

Value range:

N/A.

Example Requests

None

Example Responses

Status code: 200

Obtain the latest push event of a repository.

{
  "ref" : "master",
  "created_at" : "2025-06-19T21:27:31.000+08:00",
  "repository" : {
    "id" : 2112036131,
    "name" : "ddddddddddd",
    "path" : "ddddddddddd",
    "path_with_namespace" : "3e1f6634946144c2b1ccb46fb8152b8f/test",
    "project_name" : "kanban"
  }
}

Status Codes

Status Code

Description

200

Obtain the latest push event of a repository.

Error Codes

See Error Codes.