1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-01 00:08:27 +01:00
unleash.unleash/website/docs/reference/api/legacy/unleash/admin/events.md
2024-10-08 12:11:05 +02:00

3.6 KiB

title
/api/admin/events

import ApiRequest from '@site/src/components/ApiRequest'

:::note

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

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

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

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

:::note Content moved

This section has been moved to a dedicated events documentation.

:::