# Get the most recent events from the Unleash instance or all events related to a project. GET https://app.unleash-instance.example.com/api/admin/events Returns **the last 100** events from the Unleash instance when called without a query parameter. When called with a `project` parameter, returns **all events** for the specified project. If the provided project does not exist, the list of events will be empty. Reference: https://docs.getunleash.io/api/get-events ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: >- Get the most recent events from the Unleash instance or all events related to a project. version: endpoint_events.getEvents paths: /api/admin/events: get: operationId: get-events summary: >- Get the most recent events from the Unleash instance or all events related to a project. description: >- Returns **the last 100** events from the Unleash instance when called without a query parameter. When called with a `project` parameter, returns **all events** for the specified project. If the provided project does not exist, the list of events will be empty. tags: - - subpackage_events parameters: - name: project in: query description: The name of the project whose events you want to retrieve required: false schema: type: string - name: Authorization in: header description: Header authentication of the form `undefined ` required: true schema: type: string responses: '200': description: eventsSchema content: application/json: schema: $ref: '#/components/schemas/eventsSchema' '401': description: >- Authorization information is missing or invalid. Provide a valid API token as the `authorization` header, e.g. `authorization:*.*.my-admin-token`. content: {} components: schemas: EventsSchemaVersion: type: string enum: - value: '1' EventSchemaType: type: string enum: - value: application-created - value: feature-created - value: feature-deleted - value: feature-updated - value: feature-metadata-updated - value: feature-variants-updated - value: feature-environment-variants-updated - value: feature-project-change - value: feature-archived - value: feature-revived - value: feature-import - value: feature-tagged - value: feature-tag-import - value: feature-strategy-update - value: feature-strategy-add - value: feature-strategy-remove - value: feature-type-updated - value: feature-completed - value: feature-uncompleted - value: feature-link-added - value: feature-link-removed - value: feature-link-updated - value: strategy-order-changed - value: drop-feature-tags - value: feature-untagged - value: feature-stale-on - value: feature-stale-off - value: drop-features - value: feature-environment-enabled - value: feature-environment-disabled - value: strategy-created - value: strategy-deleted - value: strategy-deprecated - value: strategy-reactivated - value: strategy-updated - value: strategy-import - value: drop-strategies - value: context-field-created - value: context-field-updated - value: context-field-deleted - value: project-access-added - value: project-access-user-roles-updated - value: project-access-group-roles-updated - value: project-access-user-roles-deleted - value: project-access-group-roles-deleted - value: project-access-updated - value: project-created - value: project-updated - value: project-deleted - value: project-archived - value: project-revived - value: project-import - value: project-user-added - value: project-user-removed - value: project-user-role-changed - value: project-group-added - value: role-created - value: role-updated - value: role-deleted - value: drop-projects - value: tag-created - value: tag-deleted - value: tag-import - value: drop-tags - value: tag-type-created - value: tag-type-deleted - value: tag-type-updated - value: tag-type-import - value: drop-tag-types - value: addon-config-created - value: addon-config-updated - value: addon-config-deleted - value: db-pool-update - value: user-created - value: user-updated - value: user-deleted - value: drop-environments - value: environment-import - value: environment-created - value: environment-updated - value: environment-deleted - value: segment-created - value: segment-updated - value: segment-deleted - value: group-created - value: group-updated - value: group-deleted - value: group-user-added - value: group-user-removed - value: setting-created - value: setting-updated - value: setting-deleted - value: client-metrics - value: client-register - value: pat-created - value: pat-deleted - value: public-signup-token-created - value: public-signup-token-user-added - value: public-signup-token-updated - value: change-request-created - value: change-request-discarded - value: change-added - value: change-discarded - value: change-edited - value: change-request-rejected - value: change-request-approved - value: change-request-approval-added - value: change-request-cancelled - value: change-request-sent-to-review - value: change-request-schedule-suspended - value: change-request-applied - value: change-request-scheduled - value: change-request-scheduled-application-success - value: change-request-scheduled-application-failure - value: change-request-configuration-updated - value: api-token-created - value: api-token-updated - value: api-token-deleted - value: feature-favorited - value: feature-unfavorited - value: project-favorited - value: project-unfavorited - value: features-exported - value: features-imported - value: service-account-created - value: service-account-deleted - value: service-account-updated - value: feature-potentially-stale-on - value: feature-dependency-added - value: feature-dependency-removed - value: feature-dependencies-removed - value: banner-created - value: banner-updated - value: banner-deleted - value: safeguard-changed - value: safeguard-deleted - value: release-plan-progressions-resumed - value: release-plan-progressions-paused - value: project-environment-added - value: project-environment-removed - value: default-strategy-updated - value: segment-import - value: signal-endpoint-created - value: signal-endpoint-updated - value: signal-endpoint-deleted - value: signal-endpoint-token-created - value: signal-endpoint-token-updated - value: signal-endpoint-token-deleted - value: actions-created - value: actions-updated - value: actions-deleted - value: release-plan-template-created - value: release-plan-template-updated - value: release-plan-template-deleted - value: release-plan-template-archived - value: release-plan-added - value: release-plan-removed - value: release-plan-milestone-started - value: milestone-progression-created - value: milestone-progression-updated - value: milestone-progression-deleted - value: milestone-progression-changed - value: user-preference-updated - value: scim-users-deleted - value: scim-groups-deleted - value: cdn-token-created - value: change-request-requested-approvers-updated - value: impact-metric-created - value: impact-metric-updated - value: impact-metric-deleted EventSchemaData: type: object properties: {} EventSchemaPreData: type: object properties: {} tagSchema: type: object properties: value: type: string description: The value of the tag. type: type: string description: >- The [type](https://docs.getunleash.io/concepts/feature-flags#tags) of the tag color: type: - string - 'null' description: The hexadecimal color code for the tag type. required: - value - type eventSchema: type: object properties: id: type: integer description: The ID of the event. An increasing natural number. createdAt: type: string format: date-time description: The time the event happened as a RFC 3339-conformant timestamp. type: $ref: '#/components/schemas/EventSchemaType' description: >- What [type](https://docs.getunleash.io/concepts/events#event-types) of event this is createdBy: type: string description: Which user created this event createdByUserId: type: - number - 'null' format: double description: The is of the user that created this event environment: type: - string - 'null' description: The feature flag environment the event relates to, if applicable. project: type: - string - 'null' description: The project the event relates to, if applicable. featureName: type: - string - 'null' description: The name of the feature flag the event relates to, if applicable. data: oneOf: - $ref: '#/components/schemas/EventSchemaData' - type: 'null' description: >- Extra associated data related to the event, such as feature flag state, segment configuration, etc., if applicable. preData: oneOf: - $ref: '#/components/schemas/EventSchemaPreData' - type: 'null' description: Data relating to the previous state of the event's subject. tags: type: - array - 'null' items: $ref: '#/components/schemas/tagSchema' description: Any tags related to the event, if applicable. label: type: - string - 'null' description: The concise, human-readable name of the event. summary: type: - string - 'null' description: A markdown-formatted summary of the event. ip: type: - string - 'null' description: >- The IP address of the user that created the event. Only available in Enterprise. groupType: type: string description: The type of transaction group this event belongs to, if applicable. groupId: type: string description: >- The unique identifier for the transaction group this event belongs to, if applicable. required: - id - createdAt - type - createdBy eventsSchema: type: object properties: version: $ref: '#/components/schemas/EventsSchemaVersion' description: >- The api version of this response. A natural increasing number. Only increases if format changes events: type: array items: $ref: '#/components/schemas/eventSchema' description: The list of events totalEvents: type: integer description: The total count of events required: - version - events ``` ## SDK Code Examples ```python import requests url = "https://app.unleash-instance.example.com/api/admin/events" headers = {"Authorization": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://app.unleash-instance.example.com/api/admin/events'; const options = {method: 'GET', headers: {Authorization: ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://app.unleash-instance.example.com/api/admin/events" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://app.unleash-instance.example.com/api/admin/events") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = '' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://app.unleash-instance.example.com/api/admin/events") .header("Authorization", "") .asString(); ``` ```php request('GET', 'https://app.unleash-instance.example.com/api/admin/events', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://app.unleash-instance.example.com/api/admin/events"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", ""); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://app.unleash-instance.example.com/api/admin/events")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```