Activity Log
Activity Log endpoints for the Mergify API.
Get the activity log #
/repos/{owner}/{repository}/logs
Get the activity log 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
batch_pull
integer[]
Filter to batch (draft) pull requests' own lifecycle events by number (surfaced in the dashboard as "Batch Pull Request"). Repeatable to match several batches at once. The draft PR is the Mergify-opened pull request that speculatively checks a batch; this returns each batch's `action.queue.checks_start` / `action.queue.checks_end` events (which snapshot the draft PR number) plus the batch's bisection events. When `in_place` is true the number is the user's own PR rather than a Mergify draft. The number rotates on checks-retry — each event snapshots the number at that attempt. Mutually exclusive with `not_batch_pull` (exclusion).
not_batch_pull
integer[]
Exclude batch (draft) pull requests' own lifecycle events by number — the same event set `batch_pull` includes, negated. Repeatable. Mirrors Datadog's facet semantics: unchecking a batch pull request in the dashboard sidebar adds it to the exclusion list. Mutually exclusive with `batch_pull` (positive include).
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
not_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"[]
Exclude events whose type matches any of the given values. Mutually exclusive with `event_type` (positive include).
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`).
not_outcome
"success" | "failure" | "pending" | "neutral"[]
Exclude events whose derived outcome label matches any of the given values (`success` / `failure` / `pending` / `neutral`). Repeatable. Mirrors Datadog's facet semantics: unchecking an outcome in the dashboard sidebar adds it to the exclusion list. Mutually exclusive with `outcome` (positive include).
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).
not_pull_request
integer[]
Exclude events whose pull request matches any of the given numbers. Mutually exclusive with `pull_request` (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 / pull-request / batch-pull-request facet counts) over the same filter set as `/logs`. 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`, `by_pull_request`, and `by_batch_pull_request` return the top 200 values by count in the window, self-excluding their own filters.
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
batch_pull
integer[]
Filter to batch (draft) pull requests' own lifecycle events by number (surfaced in the dashboard as "Batch Pull Request"). Repeatable to match several batches at once. The draft PR is the Mergify-opened pull request that speculatively checks a batch; this returns each batch's `action.queue.checks_start` / `action.queue.checks_end` events (which snapshot the draft PR number) plus the batch's bisection events. When `in_place` is true the number is the user's own PR rather than a Mergify draft. The number rotates on checks-retry — each event snapshots the number at that attempt. Mutually exclusive with `not_batch_pull` (exclusion).
not_batch_pull
integer[]
Exclude batch (draft) pull requests' own lifecycle events by number — the same event set `batch_pull` includes, negated. Repeatable. Mirrors Datadog's facet semantics: unchecking a batch pull request in the dashboard sidebar adds it to the exclusion list. Mutually exclusive with `batch_pull` (positive include).
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
not_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"[]
Exclude events whose type matches any of the given values. Mutually exclusive with `event_type` (positive include).
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`).
not_outcome
"success" | "failure" | "pending" | "neutral"[]
Exclude events whose derived outcome label matches any of the given values (`success` / `failure` / `pending` / `neutral`). Repeatable. Mirrors Datadog's facet semantics: unchecking an outcome in the dashboard sidebar adds it to the exclusion list. Mutually exclusive with `outcome` (positive include).
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).
not_pull_request
integer[]
Exclude events whose pull request matches any of the given numbers. Mutually exclusive with `pull_request` (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
}
],
"by_pull_request": [
{
"value": "string",
"count": 0
}
],
"by_batch_pull_request": [
{
"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!