# Analytics Events Export API Export raw analytics events captured by MuleSoft API gateways. Filter by date range, API, and version with up to 20,000 events per request and a one-month retention window. - **Version:** 1.0.0 - **Category:** Analytics - **OpenAPI Spec:** [api.yaml](https://dev-portal.mulesoft.com/apis/analytics-event-export/api.yaml) ## Servers - `https://anypoint.mulesoft.com/analytics/{version}/{organizationId}` - `https://{region}.anypoint.mulesoft.com/analytics/{version}/{organizationId}` - `https://{region}.platform.mulesoft.com/analytics/{version}/{organizationId}` ## Operations (2) ### GET /events **Operation ID:** `getEvents` Queries for API events that can be exported in either JSON or CSV format **Parameters:** | `apiIds` | query | Comma-delimited list of API IDs that will be included as part of the query. Omit or specify 'all' or '*' to include all APIs. | optional | | `apiVersionIds` | query | Comma-delimited list of API version IDs to include in query. Omit or specify 'all' or '*' to include all API versions. Ignored if no value was specified for API IDs. | optional | | `fields` | query | The event fields to include in the export. Required for CSV export. For JSON export it will include all fields if omitted. For a full list of fields, perform a GET request on the /events/fields endpoint, described on this API. A list that can be either comma- or period-delimited. Timestamp, API Name, API ID, API Version, API Version ID are always included as part of the response. | optional | | `format` | query | Either csv or json. This determines the format in which the events will be exported from the API. | required | | `maxResults` | query | Maximum number of events to be included in the response. Default and maximum allowed value is 20000. | optional | | `startDate` | query | Date and time, as defined by the ISO 8601 standard | optional | | `endDate` | query | Date and time, as defined by the ISO 8601 standard | optional | | `duration` | query | The timespan that will be used to retrieve data. Consists of an integer number denoting quantity and a single-letter suffix denoting units. Suffix is one of: 'd': Days 'h': Hours 'm': Minutes 's': Seconds To cover a duration of one week, use '7d' as the duration. To cover half a minute, use '30s'. | optional | | `pathPrefix` | query | Filter results by event resource path, used when reporting against a particular REST resource root | optional | ### GET /environments/{envId}/events **Operation ID:** `getEnvironmentsByEnvidEvents` Queries for HTTP events that cab be exported in either JSON or CSV format. This query is performed against a specific environment whose ID is included as part of the URL. **Parameters:** | `format` | query | Either csv or json. This determines the format in which the events will be exported from the API. | required | | `duration` | query | The timespan that will be used to retrieve data. Consists of an integer number denoting quantity and a single-letter suffix denoting units. Suffix is one of: 'd': Days 'h': Hours 'm': Minutes 's': Seconds To cover a duration of one week, use '7d' as the duration. To cover half a minute, use '30s'. | optional | | `apiVersionIds` | query | Comma-delimited list of API version IDs to include in query. Omit or specify 'all' or '*' to include all API versions. Ignored if no value was specified for API IDs. | optional | | `endDate` | query | Date and time, as defined by the ISO 8601 standard | optional | | `maxResults` | query | Maximum number of events to be included in the response. Default and maximum allowed value is 20000. | optional | | `pathPrefix` | query | Filter results by event resource path, used when reporting against a particular REST resource root | optional | | `fields` | query | The event fields to include in the export. Required for CSV export. For JSON export it will include all fields if omitted. For a full list of fields, perform a GET request on the /events/fields endpoint, described on this API. A list that can be either comma- or period-delimited. Timestamp, API Name, API ID, API Version, API Version ID are always included as part of the response. | optional | | `apiIds` | query | Comma-delimited list of API IDs that will be included as part of the query. Omit or specify 'all' or '*' to include all APIs. | optional | | `startDate` | query | Date and time, as defined by the ISO 8601 standard | optional | | `envId` | query | The ID of the environment in which the query will be executed | required |