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. Events about a wiki page include a wiki_page object. To return only those events, set target_type to wiki. Requires a token with the read_user or api scope.

Parameters

NameTypeDescription
scope
Query
StringInclude all events across the user’s projects
Example: all
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20
action
Query
StringFilter events by the specified action type
target_type
Query
StringFilter events by target type
Allowed values: issue, milestone, merge_request, note, project, snippet, user, wiki, design
before
Query
String (date)Return events created before the specified date
after
Query
String (date)Return events created after the specified date
sort
Query
StringSort results in ascending or descending order by creation date
Allowed values: asc, desc
Default: desc

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesEvent
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 integerID or URL-encoded path of the project
action
Query
StringFilter events by the specified action type
target_type
Query
StringFilter events by target type
Allowed values: issue, milestone, merge_request, note, project, snippet, user, wiki, design
before
Query
String (date)Return events created before the specified date
after
Query
String (date)Return events created after the specified date
sort
Query
StringSort results in ascending or descending order by creation date
Allowed values: asc, desc
Default: desc
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesEvent
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. A token used to authenticate must have the read_user or api scope.

Parameters

NameTypeDescription
id
Path, required
StringID or username of the user
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20
action
Query
StringFilter events by the specified action type
target_type
Query
StringFilter events by target type
Allowed values: issue, milestone, merge_request, note, project, snippet, user, wiki, design
before
Query
String (date)Return events created before the specified date
after
Query
String (date)Return events created after the specified date
sort
Query
StringSort results in ascending or descending order by creation date
Allowed values: asc, desc
Default: desc

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesEvent
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
authorAPIEntitiesUserBasicAuthor of the note
bodyStringContent of the note
Example: Note body.
commands_changesObject—
commit_idStringExample: 7b09ce7e6f80347baf0316c8c94cdba9a0a7e91d
confidentialBooleanExample: false
created_atString (date-time)Date and time when the note was created
Example: 2022-01-31T15:10:44.988Z
idInteger (int64)ID of the note
Example: 1
importedBooleanExample: false
imported_fromStringExample: github
internalBooleanExample: false
noteable_idInteger (int64)ID of the object the note belongs to, such as an issue or merge request
Example: 1
noteable_iidIntegerExample: 1
noteable_typeStringType of the object the note belongs to, such as Issue or MergeRequest
Example: Issue
positionObjectPosition of the note in the diff. Returned only for diff notes
project_idInteger (int64)ID of the project the note belongs to
Example: 1
resolvableBooleanIf true, the note can be resolved
Example: false
resolvedBooleanIf true, the note is resolved. Returned only for resolvable notes
Example: false
resolved_atString (date-time)Date and time when the note was resolved. Returned only for resolvable notes
Example: 2022-01-31T15:10:44.988Z
resolved_byAPIEntitiesUserBasicUser who resolved the note. Returned only for resolvable notes
suggestionsArray of APIEntitiesSuggestionSuggestions in the note. Returned only for diff notes on merge requests
systemBooleanIf true, the note is a system note
Example: false
typeStringType of the note, such as DiscussionNote or DiffNote. null for a plain note
Example: DiscussionNote
updated_atString (date-time)Date and time when the note was last updated
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
appliableBooleanIf true, the suggestion can be applied
Example: true
appliedBooleanIf true, the suggestion has been applied
Example: false
from_contentStringOriginal content before the suggestion
Example: Original content
from_lineIntegerFirst line number of the suggestion
Example: 1
idInteger (int64)ID of the suggestion
Example: 1
to_contentStringSuggested content that replaces the original
Example: New content
to_lineIntegerLast line number of the suggestion
Example: 1

APIEntitiesUserBasic

PropertyTypeDescription
avatar_pathStringExample: /user/avatar/28/The-Big-Lebowski-400-400.png
avatar_urlStringURL of the user’s avatar
Example: https://gravatar.com/avatar/1
custom_attributesArray of APIEntitiesCustomAttribute—
idInteger (int64)ID of the user
Example: 1
lockedBooleanIf true, the user account is locked, and the user cannot sign in until the lock expires or an administrator unlocks the account
nameStringName of the user. For a bot user, **** if the current user cannot read the bot’s project or group
Example: Administrator
public_emailStringPublic email address of the user
Example: john@example.com
stateStringState of the user account. Possible values: active, blocked, ldap_blocked, blocked_pending_approval, banned, or deactivated
Example: active
usernameStringUsername of the user
Example: admin
web_urlStringURL of the user’s profile
Example: https://gitlab.example.com/root

APIEntitiesWikiPageBasic

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