All Products
Search
Document Center

ActionTrail:LookupEvents

Last Updated:Sep 07, 2026

Retrieves detailed historical management events.

Operation description

Note

Do not invoke this operation frequently. You can create a trail to deliver management events to Simple Log Service (SLS) and use the real-time consumption feature of SLS to retrieve management events in near real-time. For more information, see Create a single-account trail, Create a multi-account trail, and Real-time consumption.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

actiontrail:LookupEvents

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

NextToken

string

No

The token that is used to request the next page of results.

Note

The request parameters must be the same as those in the previous request.

eyJhY2NvdW50IjoiMTQyNDM3OTU4NjM4NzE2MSIsImV2ZW50SWQiOiI3MkJDRTExRi02OTU3LTQ0NUItQjY0MC1CNEUyMkM4NUEwQzgiLCJsb2dJZCI6IjgyLTE0MjQzNzk1ODYzODcxNjEiLCJ0aW1lIjoxNjAyMzExNTQwMD****

MaxResults

string

No

The maximum number of results to return. Valid values: 1 to 50.

20

StartTime

string

No

The start time of the time range to query. The time follows the ISO 8601 standard and is in UTC. Format: YYYY-MM-DDThh:mm:ssZ.

Note

StartTime and EndTime must be both specified or both left empty. If they are not specified, StartTime defaults to 7 days before the current time.

2020-10-08T11:00:00Z

EndTime

string

No

The end time of the time range to query. The time follows the ISO 8601 standard and is in UTC. Format: YYYY-MM-DDThh:mm:ssZ.

Note

StartTime and EndTime must be both specified or both left empty. If they are not specified, EndTime defaults to the current time.

2020-10-15T11:00:00Z

Direction

string

No

The order in which events are retrieved. Valid values:

  • FORWARD: chronological order.

  • BACKWARD (default): reverse chronological order.

BACKWARD

LookupAttribute

array<object>

No

The query conditions.

Note

You can specify only one or two query conditions at a time. For more information, see Limits.

object

No

Key

string

No

The key of the query condition. For more information, see How do I set the LookupAttribute parameter when calling the LookupEvents operation to retrieve events?

ServiceName

Value

string

No

The value of the query condition. For more information, see How do I set the LookupAttribute parameter when calling the LookupEvents operation to retrieve events?

Ecs

For more information about common request parameters, see Common parameters.

Response elements

Element

Type

Description

Example

object

EndTime

string

The actual end time of the time range used in this query. The time follows the ISO 8601 standard and is in UTC. Format: yyyy-MM-dd'T'HH:mm:ss'Z'.

2020-07-22T14:00:00Z

Events

array<object>

The list of retrieved events.

object

The list of retrieved events.

For more information about the event fields in the event list, see Management event structure.

{ "eventId": "6EEC3A76-C207-5075-889D-A909E62F****", "eventVersion": 1, "eventName": "GetTemplate" }

NextToken

string

The token that is used to request the next page of results.

Note

This field is not returned if no more results are available.

eyJhY2NvdW50IjoiMTQyNDM3OTU4NjM4NzE2MSIsImV2ZW50SWQiOiI3MkJDRTExRi02OTU3LTQ0NUItQjY0MC1CNEUyMkM4NUEwQzgiLCJsb2dJZCI6IjgyLTE0MjQzNzk1ODYzODcxNjEiLCJ0aW1lIjoxNjAyMzExNTQwMD****

RequestId

string

The request ID.

FD79665A-CE8B-49D4-82E6-5EE2E0E7****

StartTime

string

The actual start time of the time range used in this query. The time follows the ISO 8601 standard and is in UTC. Format: yyyy-MM-dd'T'HH:mm:ss'Z'.

2020-07-15T14:00:00Z

Examples

Success response

JSON format

{
  "EndTime": "2020-07-22T14:00:00Z",
  "Events": [
    {
      "eventId": "6EEC3A76-C207-5075-889D-A909E62F****",
      "eventVersion": 1,
      "eventName": "GetTemplate"
    }
  ],
  "NextToken": "eyJhY2NvdW50IjoiMTQyNDM3OTU4NjM4NzE2MSIsImV2ZW50SWQiOiI3MkJDRTExRi02OTU3LTQ0NUItQjY0MC1CNEUyMkM4NUEwQzgiLCJsb2dJZCI6IjgyLTE0MjQzNzk1ODYzODcxNjEiLCJ0aW1lIjoxNjAyMzExNTQwMD****",
  "RequestId": "FD79665A-CE8B-49D4-82E6-5EE2E0E7****",
  "StartTime": "2020-07-15T14:00:00Z"
}

Error codes

HTTP status code

Error code

Error message

Description

400 IncompleteSignature The request signature does not conform to Alibaba Cloud standards. The request signature does not conform to Alibaba Cloud standards.
400 InvalidParameterCombination The end time must be later than the start time. The end time must be greater than the start time.
400 InvalidQueryParameter The specified query parameter is invalid. The specified query parameter is not valid.
400 InvalidParameterEndTime The specified EndTime is invalid.
400 InvalidParameterStartTime The specified StartTime is invalid.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.