Skip to content

Get operation logs for a specific pull request

GET /api/v5/repos/{owner}/{repo}/pulls/{number}/operate_logs

This endpoint queries the operation logs of a specific pull request in the specified repository. It supports sorting in reverse chronological order and paged browsing, and returns a detailed record of each operation, including the operation content, operation type, operator, and time information.

Supported access tokens

  • AtomGit user access token (AtomGit user access tokens)

Anonymous access

This endpoint allows anonymous access.

Request parameters

Parameter Location Type Required Description
owner path string Yes Namespace address of the repository (the address path of an organization or user)
repo path string Yes Repository path (path)
number path string Yes Pull request number
sort query string No Sort in descending order (desc); default: descending
page query integer No Current page number; default is 1
per_page query integer No Number of items per page; maximum is 100 and default is 20

Response parameters

The response is an array of operation log objects; each element describes one operation log.

Field Type Always returned Nullable Description
content string Yes No Operation log content
id integer Yes No Operation log ID
action string Yes No Operation identifier
merge_request_id integer Yes No Merge request ID
created_at string Yes No Creation time
updated_at string Yes No Update time
discussion_id string Yes No Discussion ID
project string Yes No Project path
assignee — (unable to parse) Yes Yes Assignee; may be null
proposer — (unable to parse) Yes Yes Proposer; may be null
user object Yes No Information about the user who performed the operation
action_type string Yes No Operation type

user object

Field Type Always returned Nullable Description
user.id string Yes No User ID
user.name string Yes No User name
user.login string Yes No Login name
user.iam_id string Yes No IAM user ID
user.nick_name string Yes No Nickname
user.state string Yes No Account state
user.avatar_url string Yes No Avatar URL
user.avatar_path — (unable to parse) Yes Yes Avatar path; may be null
user.email string Yes No Email
user.name_cn string Yes No Chinese name
user.web_url string Yes No Personal homepage URL
user.tenant_name — (unable to parse) Yes Yes Tenant name; may be null
user.is_member — (unable to parse) Yes Yes Whether a member; may be null

Error response

The following are examples of failures that the endpoint may return. Error field names and message content are as actually returned by the backend.

400 Invalid parameters

{
  "error": "invalid_request",
  "message": "Parameter number cannot be empty"
}

401 Unauthenticated

{
  "error": "unauthorized",
  "message": "Missing or invalid access token"
}

404 Resource not found

{
  "error": "not_found",
  "message": "Pull request not found"
}

HTTP response status codes

Status code Description
200 Success (OK)
304 Not modified
401 Requires authentication
403 Forbidden
404 Not found
429 Too many requests
500 Internal server error

Request example

Parameter description

Replace <owner> with the namespace address path of the repository (the address path of an enterprise, organization, or user); replace <repo> with the repository path; replace <number> with the pull request number. This endpoint allows anonymous access, so the token can be omitted; if you need authentication, you can also include your AtomGit user access token (access_token) in the request.

cURL

curl -X GET 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/<number>/operate_logs?sort=desc&page=1&per_page=20' \
  -H 'Accept: application/json'

Response example

Status code: 200

[
  {
    "content": "Create mr issue link: **issue boudoirripinings-24** #79",
    "id": 274531,
    "action": "add_mr_issue_link",
    "merge_request_id": 70067,
    "created_at": "2024-04-23T11:32:08.522+08:00",
    "updated_at": "2024-04-23T11:32:08.522+08:00",
    "discussion_id": "18a5ab21f57cda175b8eabc2ec829a9e04d4d458",
    "project": "One/One",
    "assignee": null,
    "proposer": null,
    "user": {
      "id": "65f94ab6f21fa3084fc04823",
      "name": "csdntest13",
      "login": "csdntest13",
      "iam_id": "d8b3e018b2364546b946886a669d50fc",
      "nick_name": "csdntest13_gitcode",
      "state": "active",
      "avatar_url": "https://api.atomgit.com/avatar.png",
      "avatar_path": null,
      "email": "csdntest13@noreply.atomgit.com",
      "name_cn": "csdntest13",
      "web_url": "https://api.atomgit.com/csdntest13",
      "tenant_name": null,
      "is_member": null
    },
    "action_type": "add_mr_issue_link"
  }
]

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing or invalid access credentials)
400 Invalid parameters or the request cannot be parsed
404 The request path does not exist
405 Request method not supported
429 Too many requests; the rate limit is triggered
500 Internal system error

Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc