Event Logs
Retrieve event logs for pull request activity.
Get the events log #
/repos/{owner}/{repository}/logs
Get the events logs of the requested repository. Supports filtering by `event_type`, derived `outcome` (`success` / `failure` / `pending` / `neutral`), `trigger` (include only these trigger strings — Datadog `Only`), and `not_trigger` (exclude). `trigger` and `not_trigger` are mutually exclusive.
owner
string
required
The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
repository
string
required
The name of the repository
min length: 1 · pattern: ^[\w\-\.]+$
pull_request
integer[]
Filter events by pull-request number. Repeatable to match several PRs at once (e.g. `?pull_request=1&pull_request=2`).
base_ref
string
Get events for PRs to the given base ref
min length: 1 · max length: 255
event_type
"action.assign" | "action.backport" | "action.close" | "action.comment" | "action.copy" | "action.delete_head_branch" | "action.dequeue" | "action.dismiss_reviews" | "action.edit" | "action.github_actions" | "action.label" | "action.merge" | "action.post_check" | "action.queue.batch_bisection_end" | "action.queue.batch_bisection_start" | "action.queue.change" | "action.queue.checks.change" | "action.queue.checks_end" | "action.queue.checks_not_started" | "action.queue.checks_start" | "action.queue.enter" | "action.queue.leave" | "action.queue.merged" | "action.rebase" | "action.refresh" | "action.request_reviews" | "action.review" | "action.squash" | "action.update" | "ci_insights.auto_quarantine.disabled" | "ci_insights.auto_quarantine.enabled" | "ci_insights.auto_quarantine.modified" | "ci_insights.job_retried" | "command.dequeue" | "command.queue" | "queue.pause.create" | "queue.pause.delete" | "queue.pause.update" | "scheduled_freeze.create" | "scheduled_freeze.delete" | "scheduled_freeze.update" | "test.dequarantined" | "test.quarantined"[]
The specific types of events to select
outcome
"success" | "failure" | "pending" | "neutral"[]
Filter events by derived outcome label (`success` / `failure` / `pending` / `neutral`). Repeatable to match several outcomes at once (e.g. `?outcome=success&outcome=failure`).
trigger
string[]
Include only events whose `trigger` matches one of the given values (exact match). Repeatable. Mirrors Datadog's facet behaviour after clicking `Only`: the URL switches from exclusion mode to inclusion mode with a positive list — shorter than `not_trigger=<everything else>`. Mutually exclusive with `not_trigger`.
not_trigger
string[]
Exclude events whose `trigger` matches any of the given values (exact match). Repeatable. Mirrors Datadog's facet semantics: the default state is `all triggers included`, and unchecking a trigger in the dashboard sidebar adds it to the exclusion list. Mutually exclusive with `trigger` (positive include).
received_from
string <date-time>
Start of the time range (ISO 8601 with timezone, e.g. 2024-01-01T00:00:00Z). Defaults to `received_to - 1 day`.
received_to
string <date-time>
End of the time range (ISO 8601 with timezone, e.g. 2024-01-01T00:00:00Z). Defaults to `now`.
cursor
string
The opaque cursor of the current page. Must be extracted from RFC 5988 pagination links to get first/previous/next/last pages
per_page
integer
The number of items per page
min: 1 · max: 100
200 Successful Response
The number of items in this page
The number of items per page
Example Response
{
"size": 0,
"per_page": 0,
"events": [
{
"id": 0,
"received_at": "2024-01-15T09:00:00Z",
"trigger": "string",
"repository": "string",
"pull_request": 0,
"base_ref": "string",
"outcome": "success",
"type": "action.assign",
"metadata": {}
}
]
}
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/logs" \
-H "Authorization: Bearer <token>"
Get aggregated event counts #
/repos/{owner}/{repository}/logs/aggregate
Aggregations (total / histogram / event-type / outcome / trigger facet counts) over the same filter set as `/logs` — `event_type`, `outcome`, `trigger` (include) and `not_trigger` (exclude) all included. The response stays consistent with what the row endpoint returns: `total` matches what the table will show; unchecked values produce no row in their facet list (the sidebar hides their count rather than display `0`). `by_outcome` is derived from `event.type` (most types map directly; a few refine the label from event metadata); `by_trigger` returns the top 200 triggers by count in the window.
owner
string
required
The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
repository
string
required
The name of the repository
min length: 1 · pattern: ^[\w\-\.]+$
pull_request
integer[]
Filter events by pull-request number. Repeatable to match several PRs at once (e.g. `?pull_request=1&pull_request=2`).
base_ref
string
Get events for PRs to the given base ref
min length: 1 · max length: 255
event_type
"action.assign" | "action.backport" | "action.close" | "action.comment" | "action.copy" | "action.delete_head_branch" | "action.dequeue" | "action.dismiss_reviews" | "action.edit" | "action.github_actions" | "action.label" | "action.merge" | "action.post_check" | "action.queue.batch_bisection_end" | "action.queue.batch_bisection_start" | "action.queue.change" | "action.queue.checks.change" | "action.queue.checks_end" | "action.queue.checks_not_started" | "action.queue.checks_start" | "action.queue.enter" | "action.queue.leave" | "action.queue.merged" | "action.rebase" | "action.refresh" | "action.request_reviews" | "action.review" | "action.squash" | "action.update" | "ci_insights.auto_quarantine.disabled" | "ci_insights.auto_quarantine.enabled" | "ci_insights.auto_quarantine.modified" | "ci_insights.job_retried" | "command.dequeue" | "command.queue" | "queue.pause.create" | "queue.pause.delete" | "queue.pause.update" | "scheduled_freeze.create" | "scheduled_freeze.delete" | "scheduled_freeze.update" | "test.dequarantined" | "test.quarantined"[]
The specific types of events to select
outcome
"success" | "failure" | "pending" | "neutral"[]
Filter events by derived outcome label (`success` / `failure` / `pending` / `neutral`). Repeatable to match several outcomes at once (e.g. `?outcome=success&outcome=failure`).
trigger
string[]
Include only events whose `trigger` matches one of the given values (exact match). Repeatable. Mirrors Datadog's facet behaviour after clicking `Only`: the URL switches from exclusion mode to inclusion mode with a positive list — shorter than `not_trigger=<everything else>`. Mutually exclusive with `not_trigger`.
not_trigger
string[]
Exclude events whose `trigger` matches any of the given values (exact match). Repeatable. Mirrors Datadog's facet semantics: the default state is `all triggers included`, and unchecking a trigger in the dashboard sidebar adds it to the exclusion list. Mutually exclusive with `trigger` (positive include).
received_from
string <date-time>
Start of the time range (ISO 8601 with timezone). Defaults to `received_to - 1 day`.
received_to
string <date-time>
End of the time range (ISO 8601 with timezone). Defaults to `now`.
200 Successful Response
Example Response
{
"total": 0,
"interval_size_seconds": 0,
"histogram": [
{
"start": "2024-01-15T09:00:00Z",
"end": "2024-01-15T09:00:00Z",
"count": 0
}
],
"by_event_type": [
{
"value": "string",
"count": 0
}
],
"by_outcome": [
{
"value": "string",
"count": 0
}
],
"by_trigger": [
{
"value": "string",
"count": 0
}
]
}
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/logs/aggregate" \
-H "Authorization: Bearer <token>"
Was this page helpful?
Thanks for your feedback!