Accelerate the Value of Data

Get Entity Events Total by Tenant

Learn how to get statistics on all events of an entity per facet.

Use this endpoint to get statistics of all of the events of an entity grouped by type of event, time, and entity URIs.

Request

GET {TenantURL}/{entity object URI}/_events/_total?facet={list_of_facets}
Table 1. Parameters
Parameter Required Description
Headers Authorization Yes Information about authentication access token in the format "Bearer <accessToken>". For more information, see Authentication API.
Query facet Yes

A comma-separated list of facets to apply for search query.

Group results by:
type
event types
minute, hour, day, week, month, quarter, year
date histogram
types No

A comma-separated list of event types to filter by.

Possible values: CREATED, UPDATED,DELETED, DELETED_GDPR, POTENTIAL_MATCHES_FOUND, POTENTIAL_MATCHES_REMOVED, MERGED, MERGED_MANUALLY, MERGED_ON_THE_FLY, SPLITTED, NOT_MATCHES_SET, AS_MATCHES_SET, AS_MATCHES_RESET, NOT_MATCHES_RESET, NOT_A_MATCH_FOUND, NOT_A_MATCH_REMOVED, ENTITY_LOST_MERGE.

For more information on events, see topic Events API

Response

The response body contains the statistics of all events of the entity per facet.

Example

Request

For example, get statistics of all of the events of the 01c8VFO entity grouping per type of event and year.

GET {TenantURL}/entities/01c8VFO/_events/_total?facet=type,year
Headers: Authorization: Bearer 204938ca-2cf7-44b0-b11a-1b4c59984512
Response

{
    "total": 4,
    "facets": {
        "year": [
            {
                "term": "2024",
                "count": 4
            }
        ],
        "type": [
            {
                "term": "UPDATED",
                "count": 2
            },
            {
                "term": "MERGED_ON_THE_FLY",
                "count": 1
            },
            {
                "term": "CREATED",
                "count": 1
            }
        ]
    }
}

Errors

Here are the most common errors for this endpoint.
Status CodeMessageDescription
400 Invalid Facet Type
{
    "severity": "Error",
    "errorMessage": "Invalid facet type uri for events",
    "errorCode": 533,
    "errorDetailMessage": "Invalid facet type uri for events",
    "innerErrorData": {
        "exception": "Code: INVALID_STATS_FACET_TYPE; Message parameters: [uri]. Invalid facet type uri for events. Invalid facet type uri for events"
    }
}
400 Unknown Event Type

    "severity": "Error",
    "errorMessage": "Event type UPDA is unknown",
    "errorCode": 530,
    "errorDetailMessage": "Event type UPDA is unknown",
    "innerErrorData": {
        "exception": "Code: STATS_EVENT_TYPE_IS_UNKNOWN; Message parameters: [UPDA]. Event type UPDA is unknown. Event type UPDA is unknown"
    }
}
400 Unsupported Request
{
    "severity": "Error",
    "errorMessage": "Unsupported request. Required request parameter 'facet' for method parameter type String is not present",
    "errorCode": 2003,
    "errorDetailMessage": "Invalid path, request method or content-type in user request",
    "innerErrorData": {
        "exception": "Required request parameter 'facet' for method parameter type String is not present"
    }
}
500The operation is forbidden for the current user, please check your privileges
{
    "severity": "Error",
    "errorMessage": "Entity statistics storage internal error",
    "errorCode": 531,
    "errorDetailMessage": "Entity statistics storage internal error",
    "innerErrorData": {
        "innerErrorData": {
            "innerErrorData": {
                "innerErrorData": {
                    "exception": "Elasticsearch exception [type=too_many_buckets_exception, reason=Trying to create too many buckets. Must be less than or equal to: [65536] but this number of buckets was exceeded. This limit can be set by changing the [search.max_buckets] cluster level setting.]"
                },
                "exception": "Elasticsearch exception [type=search_phase_execution_exception, reason=]"
            },
            "exception": "ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason=]]; nested: ElasticsearchException[Elasticsearch exception [type=too_many_buckets_exception, reason=Trying to create too many buckets. Must be less than or equal to: [65536] but this number of buckets was exceeded. This limit can be set by changing the [search.max_buckets] cluster level setting.]];"
        },
        "exception": "Code: ENTITY_STATS_SERVICE_STORAGE_EXCEPTION; Message parameters: null. Entity statistics storage internal error. Entity statistics storage internal error"
    }
}