Get asset history

POST /api/meta/entity/auditSearch

Retrieve the actions that have been taken on the asset across its history in Atlan.

Body Required

Query to run the retrieval.

The history for an asset can be retrieved either by GUID or by qualifiedName:

  • To search by GUID, use the term entityId with a value of the GUID of the entity for which to retrieve history
  • To search by qualifiedName, use the term entityQualifiedName with the exact (case-sensitive) qualifiedName of the asset for which to retrieve history

This specific example retrieves the last 10 actions that were taken on the asset, sorted in reverse-chronological order.

(For advanced users, this interface actually uses the Elastic Query DSL. You can use more complex queries to retrieve history across more than a single asset using the same interface.)

  • dsl object Required

    Asset history query for Atlan.

    • from integer

      Starting point of results for paging.

      Default value is 0.

    • size integer

      Maximum number of results to return (for paging).

    • sort array[object] | null

      Mapping of properties by which to sort the results. The keys of the map are the property names, and their value is whether to sort each one in ascending or descending order.

      • created object

        Sort by the order in which the activities occurred.

        • order string

          Whether to sort in ascending or descending order.

          Values are asc or desc.

    • query object | null Required

      Query for the asset history. One of entityId or entityQualifiedName must be provided.

  • attributes array[string] | null

    List of attribute names to include in the current version of each entry.

Responses

  • 200 object

    The history of the asset according to the parameters provided.

    Note that each entry has an entityDetail object giving a view of the current value of the asset. When retrieving the history for a single asset, the contents of this entityDetail object will be the same in all entries.

    • entityAudits array[object]

      Entries in the audit history of the asset.

      • Unique name for the asset, its qualifiedName.

      • typeName string

        Name of the type definition that defines this asset.

      • entityId string

        Unique identifier of the asset, its GUID.

      • timestamp integer

        Time (epoch) at which the activity occurred, in milliseconds.

      • created integer

        Time (epoch) at which the audit entry was created, in milliseconds.

      • user string

        Username of the user who carried out the activity.

      • action string

        Type of activity that was carried out on the asset.

        Values are ENTITY_CREATE, ENTITY_UPDATE, ENTITY_DELETE, ENTITY_PURGE, ENTITY_IMPORT_CREATE, ENTITY_IMPORT_UPDATE, ENTITY_IMPORT_DELETE, CLASSIFICATION_ADD, CLASSIFICATION_UPDATE, PROPAGATED_CLASSIFICATION_ADD, PROPAGATED_CLASSIFICATION_DELETE, PROPAGATED_CLASSIFICATION_UPDATE, TERM_ADD, TERM_DELETE, LABEL_ADD, LABEL_DELETE, BUSINESS_ATTRIBUTE_UPDATE, or CUSTOM_ATTRIBUTE_UPDATE.

      • details object | null
      • eventKey string

        Unique identifier for the audit entry.

      • entity object | null
      • type object | null
      • detail object

        Detail of the action that occurred. The specific structure of the object will vary based on the action that occurred.

      • Current version of the asset. Note that this is not a view of the asset as it existed or immediately after it was changed by this action, but is the current view of the asset across all actions.

        • typeName string

          Name of the type definition that defines this instance.

        • attributes object | null

          Attributes that can exist across all assets in Atlan.

        • classifications array[object] | null

          Instance of a classification in Atlan, with its detailed information.

          • typeName string

            Name of the classification. Note that this is the static-hashed unique name of the classification, not the human-readable displayName.

          • Unique identifier of the entity to which this classification is attached.

          • propagate boolean | null

            Whether to propagate this classification to other entities related to the entity to which the classification is attached.

          • Whether to remove this classification from other entities to which it has been propagated when the classification is removed from this entity.

          • entityStatus string | null

            Status of the entity to which this classification is attached.

            Values are ACTIVE or DELETED.

        • displayText string | null

          Human-readable name of the entity.

        • guid string

          Unique identifier of the entity instance.

        • isIncomplete boolean | null

          Default value is false.

        • createdBy string | null

          Username of the user who created the object.

        • updatedBy string | null

          Username of the user who last updated the object.

        • createTime integer | null

          Time (epoch) at which this object was created, in milliseconds.

        • updateTime integer | null

          Time (epoch) at which this object was last updated, in milliseconds.

        • version integer | null

          Version of this object.

        • classificationNames array[string] | null

          List of classifications for this entity. Note that these are the internal hashed names used in Atlan, not the displayText of the classification.

        • labels array[string] | null

          Internal use only.

        • status string

          Status of the entity, either ACTIVE or DELETED.

          Values are ACTIVE or DELETED.

        • meaningNames array[string] Deprecated

          Unused.

        • meanings array[object] Deprecated

          Unused.

    • aggregations object | null
    • count integer

      Number of audit history entries returned by the query.

    • totalCount integer

      Total number of audit history entries for the asset.

POST /api/meta/entity/auditSearch
curl \
 -X POST https://tenant.atlan.com/api/meta/entity/auditSearch \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"dsl":{"from":0,"size":10,"sort":[{"created":{"order":"desc"}}],"query":{"bool":{"filter":{"term":{"entityId":"c47d2400-0c21-4c0d-b9fb-1d53440a75ae"}}}}}}'
Request example
{
  "dsl": {
    "from": 0,
    "size": 10,
    "sort": [
      {
        "created": {
          "order": "desc"
        }
      }
    ],
    "query": {
      "bool": {
        "filter": {
          "term": {
            "entityId": "c47d2400-0c21-4c0d-b9fb-1d53440a75ae"
          }
        }
      }
    }
  }
}
Response example (200)
{
  "entityAudits": [
    {
      "entityQualifiedName": "u1qWdBZPF9vfEHXFcgEER@FzCMyPR2LxkPFgr8eNGrq",
      "typeName": "AtlasGlossaryTerm",
      "entityId": "c47d2400-0c21-4c0d-b9fb-1d53440a75ae",
      "timestamp": 1657039571112,
      "created": 1657039571135,
      "user": "service-account-apikey-9471cf12-f45c-4275-b280-3e01d26f57e8",
      "action": "CLASSIFICATION_ADD",
      "details": null,
      "eventKey": "c47d2400-0c21-4c0d-b9fb-1d53440a75ae:1657039571112",
      "entity": null,
      "type": null,
      "detail": {
        "typeName": "GeiqD5GfQoJ8oVzhspjQdo",
        "entityGuid": "c47d2400-0c21-4c0d-b9fb-1d53440a75ae",
        "entityStatus": "ACTIVE",
        "propagate": true,
        "removePropagationsOnEntityDelete": true
      },
      "entityDetail": {
        "typeName": "AtlasGlossaryTerm",
        "attributes": {
          "qualifiedName": "u1qWdBZPF9vfEHXFcgEER@FzCMyPR2LxkPFgr8eNGrq",
          "name": "Customer Acquisition Cost"
        },
        "guid": "c47d2400-0c21-4c0d-b9fb-1d53440a75ae",
        "status": "ACTIVE",
        "displayText": "Customer Acquisition Cost",
        "classificationNames": [
          "GeiqD5GfQoJ8oVzhspjQdo"
        ],
        "meaningNames": [],
        "meanings": [],
        "isIncomplete": false,
        "labels": [],
        "createdBy": "service-account-apikey-9471cf12-f45c-4275-b280-3e01d26f57e8",
        "updatedBy": "service-account-apikey-9471cf12-f45c-4275-b280-3e01d26f57e8",
        "createTime": 1657039477745,
        "updateTime": 1657039571112
      }
    },
    {
      "entityQualifiedName": "u1qWdBZPF9vfEHXFcgEER@FzCMyPR2LxkPFgr8eNGrq",
      "typeName": "AtlasGlossaryTerm",
      "entityId": "c47d2400-0c21-4c0d-b9fb-1d53440a75ae",
      "timestamp": 1657039477745,
      "created": 1657039477783,
      "user": "service-account-apikey-9471cf12-f45c-4275-b280-3e01d26f57e8",
      "action": "ENTITY_CREATE",
      "details": null,
      "eventKey": "c47d2400-0c21-4c0d-b9fb-1d53440a75ae:1657039477745",
      "entity": null,
      "type": null,
      "detail": {
        "typeName": "AtlasGlossaryTerm",
        "attributes": {
          "popularityScore": 1.17549435e-38,
          "viewerUsers": [],
          "sourceCreatedAt": 0,
          "viewScore": 1.17549435e-38,
          "lastSyncRunAt": 0,
          "certificateStatus": "VERIFIED",
          "userDescription": "The average amount spent in order to acquire a customer. CAC is calculated by dividing the total amount spent on acquisition activities by the total number of customers acquired during a certain time period. The acquisition activity costs cover various efforts including business development and marketing, as well as salaries, external consultancy fees, and technology costs.",
          "adminRoles": [],
          "adminGroups": [],
          "qualifiedName": "u1qWdBZPF9vfEHXFcgEER@FzCMyPR2LxkPFgr8eNGrq",
          "__hasLineage": false,
          "adminUsers": [],
          "ownerGroups": [],
          "certificateUpdatedBy": "service-account-apikey-9471cf12-f45c-4275-b280-3e01d26f57e8",
          "isEditable": true,
          "sourceUpdatedAt": 0,
          "examples": [],
          "announcementUpdatedAt": 0,
          "name": "Customer Acquisition Cost",
          "certificateUpdatedAt": 1657039477745,
          "isDiscoverable": true,
          "viewerGroups": [],
          "ownerUsers": []
        },
        "guid": "c47d2400-0c21-4c0d-b9fb-1d53440a75ae",
        "isIncomplete": false,
        "provenanceType": 0,
        "createdBy": "service-account-apikey-9471cf12-f45c-4275-b280-3e01d26f57e8",
        "updatedBy": "service-account-apikey-9471cf12-f45c-4275-b280-3e01d26f57e8",
        "createTime": 1657039477745,
        "updateTime": 1657039477745,
        "version": 0,
        "relationshipAttributes": {
          "anchor": {
            "guid": "1c557933-aa97-4eb2-bb14-3b51a636a664",
            "typeName": "AtlasGlossary"
          }
        },
        "classifications": [],
        "proxy": false
      },
      "entityDetail": {
        "typeName": "AtlasGlossaryTerm",
        "attributes": {
          "qualifiedName": "u1qWdBZPF9vfEHXFcgEER@FzCMyPR2LxkPFgr8eNGrq",
          "name": "Customer Acquisition Cost"
        },
        "guid": "c47d2400-0c21-4c0d-b9fb-1d53440a75ae",
        "status": "ACTIVE",
        "displayText": "Customer Acquisition Cost",
        "classificationNames": [
          "GeiqD5GfQoJ8oVzhspjQdo"
        ],
        "meaningNames": [],
        "meanings": [],
        "isIncomplete": false,
        "labels": [],
        "createdBy": "service-account-apikey-9471cf12-f45c-4275-b280-3e01d26f57e8",
        "updatedBy": "service-account-apikey-9471cf12-f45c-4275-b280-3e01d26f57e8",
        "createTime": 1657039477745,
        "updateTime": 1657039571112
      }
    }
  ],
  "aggregations": null,
  "count": 2,
  "totalCount": 2
}