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. 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
| Name | Type | Description |
|---|---|---|
scopeQuery | String | Include all events across the user’s projects Example: all |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items to list per page Default: 20Example: 20 |
actionQuery | String | Filter events by the specified action type |
target_Query | String | Filter events by target type Allowed values: issue,milestone,merge_,note,project,snippet,user,wiki,design |
beforeQuery | String (date) | Return events created before the specified date |
afterQuery | String (date) | Return events created after the specified date |
sortQuery | String | Sort results in ascending or descending order by creation date Allowed values: asc,descDefault: desc |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of 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 | ID or URL- |
actionQuery | String | Filter events by the specified action type |
target_Query | String | Filter events by target type Allowed values: issue,milestone,merge_,note,project,snippet,user,wiki,design |
beforeQuery | String (date) | Return events created before the specified date |
afterQuery | String (date) | Return events created after the specified date |
sortQuery | String | Sort results in ascending or descending order by creation date Allowed values: asc,descDefault: desc |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items to list per page Default: 20Example: 20 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of 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. A token used to authenticate must have the read_user or api scope.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String | ID or username of the user |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items to list per page Default: 20Example: 20 |
actionQuery | String | Filter events by the specified action type |
target_Query | String | Filter events by target type Allowed values: issue,milestone,merge_,note,project,snippet,user,wiki,design |
beforeQuery | String (date) | Return events created before the specified date |
afterQuery | String (date) | Return events created after the specified date |
sortQuery | String | Sort results in ascending or descending order by creation date Allowed values: asc,descDefault: desc |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of 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 | Author of the note |
body | String | Content of the note Example: Note body. |
commands_ | Object | — |
commit_ | String | Example:7b09ce7e6f80347baf03 |
confidential | Boolean | Example:false |
created_ | String (date- | Date and time when the note was created Example: 2022- |
id | Integer (int64) | ID of the note Example: 1 |
imported | Boolean | Example:false |
imported_ | String | Example:github |
internal | Boolean | Example:false |
noteable_ | Integer (int64) | ID of the object the note belongs to, Example: 1 |
noteable_ | Integer | Example:1 |
noteable_ | String | Type of the object the note belongs to,Issue or MergeExample: Issue |
position | Object | Position of the note in the diff. |
project_ | Integer (int64) | ID of the project the note belongs to Example: 1 |
resolvable | Boolean | If true,Example: false |
resolved | Boolean | If true,Example: false |
resolved_ | String (date- | Date and time when the note was resolved. Example: 2022- |
resolved_ | APIEntities | User who resolved the note. |
suggestions | Array of APIEntities | Suggestions in the note. |
system | Boolean | If true,Example: false |
type | String | Type of the note,Discussion or Diff.null for a plain noteExample: Discussion |
updated_ | String (date- | Date and time when the note was last updated 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 | If true,Example: true |
applied | Boolean | If true,Example: false |
from_ | String | Original content before the suggestion Example: Original content |
from_ | Integer | First line number of the suggestion Example: 1 |
id | Integer (int64) | ID of the suggestion Example: 1 |
to_ | String | Suggested content that replaces the original Example: New content |
to_ | Integer | Last line number of the suggestion Example: 1 |
APIEntitiesUserBasic
| Property | Type | Description |
|---|---|---|
avatar_ | String | Example:/ |
avatar_ | String | URL of the user’s avatar Example: https: |
custom_ | Array of APIEntities | — |
id | Integer (int64) | ID of the user Example: 1 |
locked | Boolean | If true, |
name | String | Name of the user.**** if the current user cannot read the bot’s project or groupExample: Administrator |
public_ | String | Public email address of the user Example: john@example. |
state | String | State of the user account.active,blocked,ldap_,blocked_,banned,deactivatedExample: active |
username | String | Username of the user Example: admin |
web_ | String | URL of the user’s profile Example: https: |
APIEntitiesWikiPageBasic
| Property | Type | Description |
|---|---|---|
format | String | Example:markdown |
slug | String | Example:deploy |
title | String | Example:deploy |
wiki_ | Integer (int64) | Example:123 |