---
type: api
title: Get risk score history for an entity
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v9/operation/operation-getriskscorehistory
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v9/operation/operation-getriskscorehistory
products:
  - Kibana
---

# Get risk score history for an entity

Availability: 9.5+

- Server: `https://{kibana_url}`

## Paths

- `GET` `/api/risk_score/history`
- `GET` `/s/{space_id}/api/risk_score/history`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v9/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v9/authentication#basicauth)

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Returns time-ordered historical risk score entries from the risk score time-series index for a given entity.

## Query String Parameters

- `entity_type` (enum)
  The type of entity to retrieve history for.
  Values: `host`, `user`, `service`, `generic`
- `entity_id` (string · max: 1000)
  The identifier of the entity to retrieve history for.
- `from` (string · max: 100 · default: now-90d)
  Start of the time range, in date-math syntax. Defaults to 90 days ago.
- `to` (string · max: 100 · default: now)
  End of the time range, in date-math syntax. Defaults to now.
- `score_type` (enum)
  Filter entries by the type of score recorded (`base`, `propagated`, or `resolution`).
  Values: `base`, `propagated`, `resolution`
- `include_contributions` (boolean · default: false)
  When true, each entry also includes the contributions recorded for that scoring run (`inputs`, `modifiers`, category 2 fields, and `criticality_level`), when present on the underlying document.

## Responses

#### `200`

Successful response

`application/json`

- `entity_id` (string · max: 1000)
- `entity_type` (enum)
  Values: `host`, `user`, `service`, `generic`
- `entries` ([] object)
  - `@timestamp` (string · max: 33)
  - `calculated_level` (enum)
    Values: `Unknown`, `Low`, `Moderate`, `High`, `Critical`
  - `calculated_score` (number)
  - `calculated_score_norm` (number · min: 0 · max: 100)
  - `category_1_count` (integer)
  - `category_1_score` (number)
  - `category_2_count` (integer)
  - `category_2_score` (number)
  - `criticality_level` (enum)
    The criticality level of the asset.
    Values: `low_impact`, `medium_impact`, `high_impact`, `extreme_impact`
  - `inputs` ([] object)
    Present only when requested with `include_contributions=true`.
    - `category` (string)
      The risk category of the risk input document.
    - `contribution_score` (number)
    - `description` (string)
      A human-readable description of the risk input document.
    - `entity_id` (string)
      The EUID of the entity within the graph that generated this alert.
    - `id` (string)
      The unique identifier (`_id`) of the original source document
    - `index` (string)
      The unique index (`_index`) of the original source document
    - `risk_score` (number · min: 0 · max: 100)
      The weighted risk score of the risk input document.
    - `timestamp` (string)
      The @timestamp of the risk input document.
  - `modifiers` ([] object)
    Present only when requested with `include_contributions=true`.
    - `contribution` (number)
    - `metadata` (object)
    - `modifier_value` (number)
    - `subtype` (string · max: 100)
    - `type` (string · max: 100)
  - `score_type` (enum)
    Values: `base`, `propagated`, `resolution`
- `interval` (string · max: 10)
  The effective Elasticsearch `date_histogram` interval expression the entries were aggregated into (for example `3h`, `1d`, `1w`), derived from the requested time range.
#### `400`

Invalid request

## Code Examples

#### Console

```console
GET /api/risk_score/history?entity_type={entity_type}&entity_id={entity_id}
```

#### curl

```curl
curl -X GET "https://{kibana_url}/api/risk_score/history?entity_type={entity_type}&entity_id={entity_id}"
```

## Response Examples

#### Risk score history for a user

```json
{
  "entity_id": "alice",
  "entity_type": "user",
  "entries": [
    {
      "@timestamp": "2026-05-20T12:00:00.000Z",
      "calculated_level": "High",
      "calculated_score": 145.2,
      "calculated_score_norm": 72.4,
      "category_1_count": 18,
      "category_1_score": 102,
      "score_type": "base"
    }
  ]
}
```

