/api/admin/events
In order to access the admin API endpoints you need to identify yourself. Unless you're using the none
authentication method, you'll need to create an ADMIN token and add an Authorization header using the token.
The Events API lets you retrieve events from your Unleash instance.
Event endpoints
Get all events
- HTTP
- cURL
- HTTPie
GET <unleash-url>/api/admin/events
Authorization: <API-token>
content-type: application/json
curl -H "Content-Type: application/json" \
-H "Authorization: <API-token>" \
-X GET \
<unleash-url>/api/admin/events
http GET \
<unleash-url>/api/admin/events \
Authorization:<API-token> \
Query parameters
Query parameter | Description | Required |
---|---|---|
project | When applied, the endpoint will only return events from the given project. | No |
When called without any query parameters, the endpoint will return the last 100 events from the Unleash instance. When called with a project
query parameter, it will return only events related to that project, but it will return all the events, and not just the last 100.
Get events by project
- HTTP
- cURL
- HTTPie
GET <unleash-url>/api/admin/events?project=<project-name>
Authorization: <API-token>
content-type: application/json
curl -H "Content-Type: application/json" \
-H "Authorization: <API-token>" \
-X GET \
<unleash-url>/api/admin/events?project=<project-name>
http GET \
<unleash-url>/api/admin/events?project=<project-name> \
Authorization:<API-token> \
Use the project
query parameter to make the API return all events pertaining to the given project.
Responses
Responses
200 OK
The last 100 events from the Unleash server when called without a project
query parameter.
When called with a project
query parameter: all events related to that project.
{
"version": 1,
"events": [
{
"id": 842,
"type": "feature-environment-enabled",
"createdBy": "user@company.com",
"createdAt": "2022-05-12T08:49:49.521Z",
"data": null,
"preData": null,
"tags": [],
"featureName": "my-constrained-toggle",
"project": "my-project",
"environment": "development"
},
{
"id": 841,
"type": "feature-environment-disabled",
"createdBy": "user@company.com",
"createdAt": "2022-05-12T08:49:45.986Z",
"data": null,
"preData": null,
"tags": [],
"featureName": "my-constrained-toggle",
"project": "my-project",
"environment": "development"
}
]
}
Get events for a specific toggle
- HTTP
- cURL
- HTTPie
GET <unleash-url>/api/admin/events/<toggle-name>
Authorization: <API-token>
content-type: application/json
curl -H "Content-Type: application/json" \
-H "Authorization: <API-token>" \
-X GET \
<unleash-url>/api/admin/events/<toggle-name>
http GET \
<unleash-url>/api/admin/events/<toggle-name> \
Authorization:<API-token> \
Fetch all events related to a specified toggle.
Responses
Responses
200 OK
The list of events related to the given toggle.
{
"toggleName": "my-constrained-toggle",
"events": [
{
"id": 842,
"type": "feature-environment-enabled",
"createdBy": "user@company.com",
"createdAt": "2022-05-12T08:49:49.521Z",
"data": null,
"preData": null,
"tags": [],
"featureName": "my-constrained-toggle",
"project": "my-project",
"environment": "development"
},
{
"id": 841,
"type": "feature-environment-disabled",
"createdBy": "user@company.com",
"createdAt": "2022-05-12T08:49:45.986Z",
"data": null,
"preData": null,
"tags": [],
"featureName": "my-constrained-toggle",
"project": "my-project",
"environment": "development"
}
]
}
Event type description
This section has been moved to a dedicated event type reference document.