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.
URI
GET https://{hostURL}/v4/repositories/{repository_id}/last-push-event
| 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. Value range: 1~2147483647 |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition User token. Obtain a token by calling the IAM API for obtaining a user token. The value of X-Subject-Token in the response header is the user token. Constraints Mandatory. Range 1–100,000 characters. Default Value N/A. |
Response Parameters
Status code: 200
| 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. |
| 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.