Amazon CloudTrail Events API

Operations for looking up and querying events

GitHub OpenAPI
Business capability
Observability Management BC-4220.20

Operations 1

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /#LookupEvents Look up recent account activity events · Lookup Events #
Ask an LLM
“Who deleted that EC2 instance in my account last week?”
“Can I look up CloudTrail management events from the last 90 days by user or event name?”
Tell an agent
Look up management events matching {LookupAttributes} between {StartTime} and {EndTime}.
Show the last {MaxResults} recorded API activity events in this Region.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/amazon-cloudtrail:amazon-cloudtrail-events-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

amazon-cloudtrail-events-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: AWS CloudTrail Events API
  version: '2013-11-01'
  description: Generated from AWS's published Smithy model for AWS CloudTrail. 1 operation(s).
  contact:
    name: Amazon Web Services
    url: https://aws.amazon.com/contact-us/
  license:
    name: Apache 2.0
    identifier: Apache-2.0
    url: https://github.com/aws/api-models-aws/blob/main/LICENSE
servers:
- url: https://cloudtrail.{region}.amazonaws.com
  variables:
    region:
      default: us-east-1
security:
- sigv4: []
paths:
  /#LookupEvents:
    post:
      operationId: LookupEvents
      summary: Lookup Events
      description: 'Looks up management events or CloudTrail Insights events that are captured by CloudTrail. You can look
        up events that occurred in a Region within the last 90 days. LookupEvents returns recent Insights events for trails
        that enable Insights. To view Insights events for an event data store, you can run queries on your Insights event
        data store, and you can also view the Lake dashboard for Insights. Lookup supports the following attributes for management
        events: Amazon Web Services access key Event ID Event name Event source Read only Resource name Resource type User
        name Lookup supports the following attributes for Insights events: Event ID Event name Event source All attributes
        are optional. The default number of results returned is 50, with a maximum of 50 possible. The response includes a
        token that you can use to get the next page of results. The rate of lookup requests is limited to two per second,
        per account, per Region. If this limit is exceeded, a throttling error occurs.'
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/LookupEventsResponse'
        '400':
          description: InvalidEventCategoryException; InvalidLookupAttributesException; InvalidMaxResultsException; InvalidNextTokenException;
            InvalidTimeRangeException; OperationNotPermittedException; UnsupportedOperationException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InvalidEventCategoryException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - CloudTrail_20131101.LookupEvents
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/LookupEventsRequest'
      tags:
      - Events
components:
  securitySchemes:
    sigv4:
      type: apiKey
      in: header
      name: Authorization
      description: AWS Signature Version 4. The Authorization header carries an AWS4-HMAC-SHA256 signature over the canonical
        request, with X-Amz-Date (and X-Amz-Security-Token for temporary credentials). Not a bearer token.
      x-aws-sigv4:
        signingName: cloudtrail
  schemas:
    Event:
      type: object
      properties:
        EventId:
          type: string
          description: The CloudTrail ID of the event returned.
        EventName:
          type: string
          description: The name of the event returned.
        ReadOnly:
          type: string
          description: Information about whether the event is a write event or a read event.
        AccessKeyId:
          type: string
          description: The Amazon Web Services access key ID that was used to sign the request. If the request was made with
            temporary security credentials, this is the access key ID of the temporary credentials.
        EventTime:
          type: string
          format: date-time
          description: The date and time of the event returned.
        EventSource:
          type: string
          description: The Amazon Web Services service to which the request was made.
        Username:
          type: string
          description: A user name or role name of the requester that called the API in the event returned.
        Resources:
          type: array
          items:
            $ref: '#/components/schemas/Resource'
          description: A list of resources referenced by the event returned.
        CloudTrailEvent:
          type: string
          description: A JSON string that contains a representation of the event returned.
    InvalidEventCategoryException:
      type: object
      properties:
        Message:
          type: string
          description: Brief description of the exception returned by the request.
    LookupAttribute:
      type: object
      properties:
        AttributeKey:
          type: string
          enum:
          - EventId
          - EventName
          - ReadOnly
          - Username
          - ResourceType
          - ResourceName
          - EventSource
          - AccessKeyId
          description: Specifies an attribute on which to filter the events returned.
        AttributeValue:
          type: string
          description: Specifies a value for the specified AttributeKey. The maximum length for the AttributeValue is 2000
            characters. The following characters ('_', ' ', ',', '\\n') count as two characters towards the 2000 character
            limit.
      required:
      - AttributeKey
      - AttributeValue
    LookupEventsRequest:
      type: object
      properties:
        LookupAttributes:
          type: array
          items:
            $ref: '#/components/schemas/LookupAttribute'
          description: Contains a list of lookup attributes. Currently the list can contain only one item.
        StartTime:
          type: string
          format: date-time
          description: Specifies that only events that occur after or at the specified time are returned. If the specified
            start time is after the specified end time, an error is returned.
        EndTime:
          type: string
          format: date-time
          description: Specifies that only events that occur before or at the specified time are returned. If the specified
            end time is before the specified start time, an error is returned.
        EventCategory:
          type: string
          enum:
          - insight
          description: Specifies the event category. If you do not specify an event category, events of the category are not
            returned in the response. For example, if you do not specify insight as the value of EventCategory, no Insights
            events are returned.
        MaxResults:
          type: integer
          description: The number of events to return. Possible values are 1 through 50. The default is 50.
        NextToken:
          type: string
          description: The token to use to get the next page of results after a previous API call. This token must be passed
            in with the same parameters that were specified in the original call. For example, if the original call specified
            an AttributeKey of 'Username' with a value of 'root', the call with NextToken should include those same parameters.
    LookupEventsResponse:
      type: object
      properties:
        Events:
          type: array
          items:
            $ref: '#/components/schemas/Event'
          description: A list of events returned based on the lookup attributes specified and the CloudTrail event. The events
            list is sorted by time. The most recent event is listed first.
        NextToken:
          type: string
          description: The token to use to get the next page of results after a previous API call. If the token does not appear,
            there are no more results to return. The token must be passed in with the same parameters as the previous call.
            For example, if the original call specified an AttributeKey of 'Username' with a value of 'root', the call with
            NextToken should include those same parameters.
    Resource:
      type: object
      properties:
        ResourceType:
          type: string
          description: 'The type of a resource referenced by the event returned. When the resource type cannot be determined,
            null is returned. Some examples of resource types are: Instance for EC2, Trail for CloudTrail, DBInstance for
            Amazon RDS, and AccessKey for IAM. To learn more about how to look up and filter events by the resource types
            supported for a service, see Filtering CloudTrail Events.'
        ResourceName:
          type: string
          description: The name of the resource referenced by the event returned. These are user-created names whose values
            will depend on the environment. For example, the resource name might be "auto-scaling-test-group" for an Auto
            Scaling Group or "i-1234567" for an EC2 Instance.
x-provenance:
  method: harvested
  publisher: Amazon Web Services
  source: https://raw.githubusercontent.com/aws/api-models-aws/3cd98287b471c106254abd89279cc87308d38bfd/models/cloudtrail/service/2013-11-01/cloudtrail-2013-11-01.json
  note: converted by smithy-to-openapi.py from AWS's Smithy model (roadmap#1001)