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 DiscussionNote type 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

NameTypeDescription
scope
Query
StringInclude all events across a user’s projects
Example: all
page
Query
IntegerCurrent page number
Default: 1
Example: 1
per_page
Query
IntegerNumber of items per page
Default: 20
Example: 20
action
Query
StringEvent action to filter on
target_type
Query
StringEvent target type to filter on
Allowed values: issue, milestone, merge_request, note, project, snippet, user, wiki, design
before
Query
String (date)Include only events created before this date
after
Query
String (date)Include only events created after this date
sort
Query
StringReturn events sorted in ascending and descending order
Allowed values: asc, desc
Default: desc

Responses

CodeDescriptionSchema
200OKAPIEntitiesEvent
400Bad Request—
401Unauthorized—

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

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
action
Query
StringEvent action to filter on
target_type
Query
StringEvent target type to filter on
Allowed values: issue, milestone, merge_request, note, project, snippet, user, wiki, design
before
Query
String (date)Include only events created before this date
after
Query
String (date)Include only events created after this date
sort
Query
StringReturn events sorted in ascending and descending order
Allowed values: asc, desc
Default: desc
page
Query
IntegerCurrent page number
Default: 1
Example: 1
per_page
Query
IntegerNumber of items per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKAPIEntitiesEvent
400Bad Request—
404Not 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

NameTypeDescription
id
Path, required
StringThe ID or username of the user
page
Query
IntegerCurrent page number
Default: 1
Example: 1
per_page
Query
IntegerNumber of items per page
Default: 20
Example: 20
action
Query
StringEvent action to filter on
target_type
Query
StringEvent target type to filter on
Allowed values: issue, milestone, merge_request, note, project, snippet, user, wiki, design
before
Query
String (date)Include only events created before this date
after
Query
String (date)Include only events created after this date
sort
Query
StringReturn events sorted in ascending and descending order
Allowed values: asc, desc
Default: desc

Responses

CodeDescriptionSchema
200OKAPIEntitiesEvent
400Bad Request—
404Not found—

Schemas

Objects returned by the operations above and objects nested in their request bodies.

APIEntitiesCustomAttribute

PropertyTypeDescription
keyStringExample: foo
valueStringExample: bar

APIEntitiesEvent

PropertyTypeDescription
action_nameStringExample: closed
authorAPIEntitiesUserBasic—
author_idInteger (int64)Example: 25
author_usernameStringExample: root
created_atStringExample: 2017-02-09T10:43:19.667Z
idInteger (int64)Example: 1
importedBooleanExample: false
imported_fromStringExample: none
noteAPIEntitiesNote—
project_idInteger (int64)Example: 2
push_dataAPIEntitiesPushEventPayload—
target_idInteger (int64)Example: 160
target_iidIntegerExample: 157
target_titleStringExample: Public project search field
target_typeStringExample: Issue
wiki_pageAPIEntitiesWikiPageBasic—

APIEntitiesNote

PropertyTypeDescription
authorAPIEntitiesUserBasic—
bodyStringExample: Note body.
commands_changesObject—
commit_idStringExample: 7b09ce7e6f80347baf0316c8c94cdba9a0a7e91d
confidentialBooleanExample: false
created_atString (date-time)Example: 2022-01-31T15:10:44.988Z
idInteger (int64)Example: 1
importedBooleanExample: false
imported_fromStringExample: github
internalBooleanExample: false
noteable_idInteger (int64)Example: 1
noteable_iidIntegerExample: 1
noteable_typeStringExample: Issue
positionObject—
project_idInteger (int64)Example: 1
resolvableBooleanExample: false
resolvedBooleanExample: false
resolved_atString (date-time)Example: 2022-01-31T15:10:44.988Z
resolved_byAPIEntitiesUserBasic—
suggestionsAPIEntitiesSuggestion—
systemBooleanExample: false
typeStringExample: DiscussionNote
updated_atString (date-time)Example: 2022-01-31T15:10:44.988Z

APIEntitiesPushEventPayload

PropertyTypeDescription
actionStringExample: pushed
commit_countIntegerExample: 1
commit_fromStringExample: 50d4420237a9de7be1304607147aec22e4a14af7
commit_titleStringExample: Add simple search to projects in public area
commit_toStringExample: c5feabde2d8cd023215af4d2ceeb7a64839fc428
refStringExample: master
ref_countIntegerExample: 1
ref_typeStringExample: branch

APIEntitiesSuggestion

PropertyTypeDescription
appliableBooleanExample: true
appliedBooleanExample: false
from_contentStringExample: Original content
from_lineIntegerExample: 1
idInteger (int64)Example: 1
to_contentStringExample: New content
to_lineIntegerExample: 1

APIEntitiesUserBasic

PropertyTypeDescription
avatar_pathStringExample: /user/avatar/28/The-Big-Lebowski-400-400.png
avatar_urlStringExample: https://gravatar.com/avatar/1
custom_attributesArray of APIEntitiesCustomAttribute—
idInteger (int64)Example: 1
lockedBoolean—
nameStringExample: Administrator
public_emailStringExample: john@example.com
stateStringExample: active
usernameStringExample: admin
web_urlStringExample: https://gitlab.example.com/root

APIEntitiesWikiPageBasic

PropertyTypeDescription
formatStringExample: markdown
slugStringExample: deploy
titleStringExample: deploy
wiki_page_meta_idInteger (int64)Example: 123