This endpoint lists all of the audit logs which your API key has access to.

Auth scope: Audit API Key

Audit Log Model

Audit logs are representations of a specific action taken by a user in the Gamesight platform. Each Audit Log contains a few key properties:

  • Actor - The user or API key that took the action
  • Verb - The type of action taken (eg create, update, or delete)
  • Target - The object that the action was taken on. For example when updating the name on a Team the Target would be the Team that you updated.
  • Context - The Org, Game, or Team context that this action occurred in. For example when creating a Tracker the Context would be set to the Team that the Tracker was created in.

Below you can find a full specification of the Audit Log model

ColumnTypeNullableDescription
idNumberNoUnique ID for this audit log
actor_typeStringNoType of actor. One of: user, advertiser_api_key, system
actor_idNumberYesID of the actor. Not set when actor_type is system
actor_nameStringYesName for the actor. Either the user's full name or the API key's name
actor_emailStringYesEmail for the actor. Only set for user actors.
actor_ipStringYesIP address for the actor. IP is not collected by default. If you would like to include IP addresses in your Audit Logs please contact your account manager to enable this setting
verbStringNoThe type of action that was recorded. Once of: create, update, delete
target_typeStringNoThe type of object that the actor mutated for this audit log
target_idStringNoThe ID of the mutated object
target_metaObjectYesAdditional metadata about the mutated object. Currently populated for actor_role and permission target types
attributeStringYesThe name of the attribute that was updated. Only set for update verb audit logs
old_valueStringYesThe previous value for the updated attribute. Only set for update verb audit logs
new_valueStringYesThe new value for the updated attribute. Only set for update verb audit logs
context_typeStringNoThe type of context that this action was taken in. One of: org, game, team. Can be used to filter audit logs to only include actions that impact a specific Game or Team.
context_idNumberNoThe ID for the context that this action was taken in
created_atStringNoISO 8601 format timestamp in UTC that this action was taken at

Target Types

There are several different target_type values that you may see in your audit logs. Some of these object names may be unfamiliar as they are internal system concepts, so we have defined them here:

  • refresh_token - A create refresh token audit log entry is generated on the start of every session for a user. You can use this log entry to see user "logins" or session starts
  • actor_role - Each time a user or API key is assigned a role in your Organization you will see a create actor role entry. This will contain information about which role was assigned to the user and in what context.
  • permission - In some cases permissions are directly assigned to a user, rather than through a role assignment. In these cases you will see the target type as create permission rather than actor role.

Soft Deletes

There are a number of target_types that implement a soft-delete system to allow for data recovery. In these cases you may see what is presented as a delete action in the product appear in the Audit Log as an update with an attribute of archived_at. The soft delete logic is implemented as:

  • archived_at set to the deletion timestamp to mark a record for deletion
  • archived_at set to null to restore a deleted record

Pagination

This endpoint has cursor based pagination.

{
  "audit_logs": [...],
  "cursors": {
    "next": "eyJpZCI6IDM2MjE3fQ=="                
  }
}

To retrieve the next page in the time range look for cursors.next on the response payload. Once there are no additional pages in the time range the next cursor will return null.

Below is an example implementing this cursor based pagination in Python.

audit_logs = []
cursor = None

while True: # Continue pulling pages until there are no more pages
  resp = get_audit_log_page(cursor)
  
  audit_logs.append(resp['audit_logs'])
  cursor = resp['cursors']['next']
  
  if cursor is None: # No more pages, break out of the loop
    break
Language
Click Try It! to start a request and see the response here!