Get the last events of the event log, the newest first. Use the query parameters to filter the events. To get the next page, give the identifier of the last event in cursor_event_id. An administrator gets the events of all projects. A manager gets the events of their projects only. You must be a manager. A user who has the manager role on a project only must give project_id.
Query parameters
-
Get the events after this date. Date in the ISO 8601 format, for example 2026-10-28T10:00:00
-
Get the events before this date. Date in the ISO 8601 format, for example 2026-10-28T10:00:00
-
Get only the events about files
Default value is
false. -
Get the events that are older than this event
-
Maximum number of events. The maximum value is 1000.
Default value is
100. -
Get only the events of this project
-
Get only the events with this name, for example task:update
-
Filter events by object, the part of the event name before the colon. Repeat the parameter for each value.
-
Filter events by action, the part of the event name after the colon. Repeat the parameter for each value.
-
Filter events by author. Repeat the parameter for each value.
curl -X GET "http://api.example.com/data/events/last?after=2022-07-12&before=2022-07-12&only_files=false&cursor_event_id=a24a6ea4-ce75-4665-a070-57453082c25&limit=100&project_id=a24a6ea4-ce75-4665-a070-57453082c25&name=user_login" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
import requests
url = "http://api.example.com/data/events/last"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json"
}
params = {
"after": "2022-07-12",
"before": "2022-07-12",
"only_files": false,
"cursor_event_id": "a24a6ea4-ce75-4665-a070-57453082c25",
"limit": 100,
"project_id": "a24a6ea4-ce75-4665-a070-57453082c25",
"name": "user_login"
}
payload = None
response = requests.get(
url,
headers=headers,
params=params,
json=payload
)
response.raise_for_status()
if response.content:
print(response.json())
[
{
"id": "a24a6ea4-ce75-4665-a070-57453082c250",
"name": "user_login",
"data": {
"user_id": "b35b7fb5-df86-5776-b181-68564193d360"
},
"project_id": "c46c80c6-e097-6887-c292-79675204e470",
"created_at": "2023-01-01T12:00:00Z",
"user_id": "d57d91d7-f108-7998-d403-80786315f580"
}
]