Use this API to review event activity for a user, a project, or an instance. Events cover a wide range of actions, such as joining a project, commenting on an issue, pushing changes to a merge request, or closing an epic.
Activity is subject to retention limits. For more information, see the user activity time period limit and the project activity time period limit.
These endpoints have some limitations:
- Some epic features, such as child items, linked items, start dates, due dates, and health statuses, are not returned.
- Some merge request notes use the
DiscussionNotetype instead, which is not supported. - Bulk push events, created when a push exceeds the push event activities limit, are returned with limited details.
List all events
GET /api/v4/events
Lists all events for the authenticated user. Does not return events associated with epics or merge requests. Returns bulk push events with limited commit details.
Parameters
| Name | Type | Description |
|---|---|---|
scopeQuery | String | Include all events across a user’s projects Example: all |
pageQuery | Integer | Current page number Default: 1Example: 1 |
per_Query | Integer | Number of items per page Default: 20Example: 20 |
actionQuery | String | Event action to filter on |
target_Query | String | Event target type to filter on Allowed values: issue,milestone,merge_,note,project,snippet,user,wiki,design |
beforeQuery | String (date) | Include only events created before this date |
afterQuery | String (date) | Include only events created after this date |
sortQuery | String | Return events sorted in ascending and descending order Allowed values: asc,descDefault: desc |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
List all visible events for a project
GET /api/v4/projects/{id}/events
Lists all visible events for a specified project. When a push exceeds the Push event activities limit, a single bulk push event is returned instead of individual commit events. Bulk push events have limited commit details: commit_count is 0, ref_count shows the number of refs pushed, and individual commit attributes are null.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
actionQuery | String | Event action to filter on |
target_Query | String | Event target type to filter on Allowed values: issue,milestone,merge_,note,project,snippet,user,wiki,design |
beforeQuery | String (date) | Include only events created before this date |
afterQuery | String (date) | Include only events created after this date |
sortQuery | String | Return events sorted in ascending and descending order Allowed values: asc,descDefault: desc |
pageQuery | Integer | Current page number Default: 1Example: 1 |
per_Query | Integer | Number of items per page Default: 20Example: 20 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Retrieve contribution events for a user
GET /api/v4/users/{id}/events
Retrieves the contribution events for a specified user. Does not return events associated with epics or merge requests. Returns bulk push events with limited commit details.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String | The ID or username of the user |
pageQuery | Integer | Current page number Default: 1Example: 1 |
per_Query | Integer | Number of items per page Default: 20Example: 20 |
actionQuery | String | Event action to filter on |
target_Query | String | Event target type to filter on Allowed values: issue,milestone,merge_,note,project,snippet,user,wiki,design |
beforeQuery | String (date) | Include only events created before this date |
afterQuery | String (date) | Include only events created after this date |
sortQuery | String | Return events sorted in ascending and descending order Allowed values: asc,descDefault: desc |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not found | — |
Schemas
Objects returned by the operations above and objects nested in their request bodies.
APIEntitiesCustomAttribute
| Property | Type | Description |
|---|---|---|
key | String | Example:foo |
value | String | Example:bar |
APIEntitiesEvent
| Property | Type | Description |
|---|---|---|
action_ | String | Example:closed |
author | APIEntities | — |
author_ | Integer (int64) | Example:25 |
author_ | String | Example:root |
created_ | String | Example:2017- |
id | Integer (int64) | Example:1 |
imported | Boolean | Example:false |
imported_ | String | Example:none |
note | APIEntities | — |
project_ | Integer (int64) | Example:2 |
push_ | APIEntities | — |
target_ | Integer (int64) | Example:160 |
target_ | Integer | Example:157 |
target_ | String | Example:Public project search field |
target_ | String | Example:Issue |
wiki_ | APIEntities | — |
APIEntitiesNote
| Property | Type | Description |
|---|---|---|
author | APIEntities | — |
body | String | Example:Note body. |
commands_ | Object | — |
commit_ | String | Example:7b09ce7e6f80347baf03 |
confidential | Boolean | Example:false |
created_ | String (date- | Example:2022- |
id | Integer (int64) | Example:1 |
imported | Boolean | Example:false |
imported_ | String | Example:github |
internal | Boolean | Example:false |
noteable_ | Integer (int64) | Example:1 |
noteable_ | Integer | Example:1 |
noteable_ | String | Example:Issue |
position | Object | — |
project_ | Integer (int64) | Example:1 |
resolvable | Boolean | Example:false |
resolved | Boolean | Example:false |
resolved_ | String (date- | Example:2022- |
resolved_ | APIEntities | — |
suggestions | APIEntities | — |
system | Boolean | Example:false |
type | String | Example:Discussion |
updated_ | String (date- | Example:2022- |
APIEntitiesPushEventPayload
| Property | Type | Description |
|---|---|---|
action | String | Example:pushed |
commit_ | Integer | Example:1 |
commit_ | String | Example:50d4420237a9de7be130 |
commit_ | String | Example:Add simple search to projects in public area |
commit_ | String | Example:c5feabde2d8cd023215a |
ref | String | Example:master |
ref_ | Integer | Example:1 |
ref_ | String | Example:branch |
APIEntitiesSuggestion
| Property | Type | Description |
|---|---|---|
appliable | Boolean | Example:true |
applied | Boolean | Example:false |
from_ | String | Example:Original content |
from_ | Integer | Example:1 |
id | Integer (int64) | Example:1 |
to_ | String | Example:New content |
to_ | Integer | Example:1 |
APIEntitiesUserBasic
| Property | Type | Description |
|---|---|---|
avatar_ | String | Example:/ |
avatar_ | String | Example:https: |
custom_ | Array of APIEntities | — |
id | Integer (int64) | Example:1 |
locked | Boolean | — |
name | String | Example:Administrator |
public_ | String | Example:john@example. |
state | String | Example:active |
username | String | Example:admin |
web_ | String | Example:https: |
APIEntitiesWikiPageBasic
| Property | Type | Description |
|---|---|---|
format | String | Example:markdown |
slug | String | Example:deploy |
title | String | Example:deploy |
wiki_ | Integer (int64) | Example:123 |