GEThttps://api.spotinst.io/audit/events?fromDate={fromDate}&toDate={toDate}&accountId={ACCOUNT_ID}&responseStatus=all

Gets audit events that have response status of 200. This is the default when the responseStatus parameter is not included in the query. When you use responseStatus in the query, you can get all audit events without regard to status.

The API requires one of the following permissions to be defined in Spot:

URL Parameters

Parameter Type Description
fromDate * Long

Timestamp in milliseconds for the start time

Example: 1511370488000
toDate * Long

Timestamp in milliseconds for the end time

Example: 1511370498000
ACCOUNT_ID String

Your Spot accountId associated with your token

Example: act-123abc
responseStatus String

Determines whether the audit events should be filtered by their response status code or not. Valid values: "success": Gets only events with status 200. "all": Audit events will not be filtered by response status codes, and all the events will be returned.

Example: all
Default: success
Request

Headers
Copied!
Downloaded!
{
    "Authorization": "Bearer ${token}"
}
Response - Example 1: Only Status 200 Responses (responseStatus=success)

Headers
Copied!
Downloaded!
{
    "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
  "status": {
    "code": 200,
    "message": "OK"
  },
  "items": [
    {
      "user": "USER_MAIL",
      "namespace": "AWS",
      "actionType": "Create",
      "resourceType": "Elastigroup",
      "resourceId": "sig-123456",
      "createdAt": "2017-12-31T16:45:10.000+0000",
      "context": "",
      "responseStatus": 200
    }
  ]
}
Response - Example 2: All Response Statuses (responseStatus=all)

Body
Copied!
Downloaded!
{
  "request": {
    "id": "85ed2605-2ece-4233-b1d3-53ea1bdbf575",
    "url": "/audit/events",
    "method": "GET",
    "timestamp": "2020-06-01T17:48:01.168Z"
  },
  "response": {
    "status": {
      "code": 200,
      "message": "OK"
    },
    "kind": "spotinst:audit",
    "items": [
      {
        "user": "rnd.dev@spotinst.com",
        "namespace": "GENERAL",
        "actionType": "Sign in with SSO",
        "resourceType": "User",
        "resourceId": "21126",
        "createdAt": "2020-06-01T12:17:51.000Z",
        "context": "{\"body\":{\"email\":\"test@spot.io\",\"isMarketplaceCustomer\":false},\"url\":\"/signIn/sso\",\"query\":{}}",
        "source": "UI",
        "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.9.1667.012 Safari/537.36",
        "responseStatus": 200
      },
      {
        "user": "rnd.dev@spotinst.com",
        "namespace": "GENERAL",
        "actionType": "Sign in with SSO",
        "resourceType": "User",
        "resourceId": "21126",
        "createdAt": "2020-06-01T12:20:36.000Z",
        "context": "{\"body\":{\"email\":\"test@spot.io\",\"isMarketplaceCustomer\":false},\"url\":\"/signIn/sso\",\"query\":{}}",
        "source": "UI",
        "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.9.1667.012 Safari/537.36",
        "responseStatus": 401
      }
    ],
    "count":2
  }
}