> For the complete documentation index, see [llms.txt](https://docs.ilert.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ilert.com/integrations/actions/context/entity-alert.md).

# entity (alert)

Reference for the entity (alert) variable in action placeholders and conditions.

{% hint style="info" %}
This page describes the `entity` variable on alert actions, one of the variables you can use in `{{ }}` placeholders and conditions when you customize an action's YAML definition. It is available in `steps` and in templated settings (such as a webhook body), not in `inbound`. Start with [Actions → Custom behavior](https://docs.ilert.com/integrations/actions.md#custom-behavior-advanced-topic) for how the definition works.
{% endhint %}

`entity` on alert actions. Fields without a value are left out. The fields under "Event-specific" are present only on automatic runs of the named event; manual and delayed runs do not carry them.

Uses: [Context schema: entity](https://docs.ilert.com/integrations/actions/context/entity.md).

```yaml
openapi: 3.1.0
info:
  title: ilert action context - alert entity
  version: 1.0.0
  description: >-
    `entity` on alert actions. Fields without a value are left out. The
    fields under "Event-specific" are present only on automatic runs of the
    named event; manual and delayed runs do not carry them.
components:
  schemas:
    AlertEntity:
      type: object
      required: [kind, id]
      additionalProperties: true
      properties:
        kind:
          const: ALERT
        id:
          type: integer
        summary:
          type: string
        details:
          type: string
          description: Truncated to 32768 characters.
        status:
          type: string
          enum: [PENDING, ACCEPTED, RESOLVED]
        priority:
          type: string
          enum: [HIGH, LOW]
        severity:
          type: integer
        alertKey:
          type: string
        reportTime:
          type: string
          format: date-time
        acceptedOn:
          type: string
          format: date-time
        resolvedOn:
          type: string
          format: date-time
        mergedOn:
          type: string
          format: date-time
        mergeState:
          type: string
          enum: [NONE, MAIN, MERGED]
        mergedIntoId:
          type: integer
        sourceType:
          type: string
          enum: [ALERT_SOURCE]
        correlationId:
          type: string
        labels:
          type: object
          additionalProperties:
            type: string
        customDetails:
          type: object
          additionalProperties: true
        images:
          type: array
          items:
            type: object
            properties:
              src: { type: string }
              href: { type: string }
              alt: { type: string }
        links:
          type: array
          items:
            type: object
            properties:
              href: { type: string }
              text: { type: string }
        teamIds:
          type: array
          items:
            type: integer
        source:
          $ref: './entity.md#/components/schemas/IdName'
          description: The alert source.
        escalationPolicy:
          $ref: './entity.md#/components/schemas/IdName'
        assignedTo:
          $ref: './entity.md#/components/schemas/IdName'
        responders:
          type: array
          items:
            type: object
            properties:
              user:
                $ref: './entity.md#/components/schemas/User'
              status:
                type: string
                enum: [PENDING, ACCEPTED]
              acceptedAt:
                type: string
                format: date-time
        channel:
          type: object
          properties:
            id:
              type: integer
        url:
          type: string
          format: uri
          description: Link to the alert in ilert.
          examples: ["https://acme.ilert.com/alert/view?id=123"]

        # Event-specific
        cause:
          type: string
          enum: [MANUAL, AUTO]
          description: "`alert.resolved` only. `AUTO` when the alert source resolved it."
        resolveComment:
          type: string
          description: "`alert.resolved` only."
        assignType:
          type: string
          enum: [USER, POLICY, SCHEDULE, POLICY_LEVEL]
          description: "`alert.rerouted` only. What the alert was rerouted to."
        escalationLevel:
          type: integer
          description: "`alert.rerouted`, `alert.escalated`, `alert.responder_added`, `alert.responder_removed`, when known."
        changedResponders:
          type: array
          description: "`alert.escalated`, `alert.responder_added`, `alert.responder_removed` only. The users that changed."
          items:
            $ref: './entity.md#/components/schemas/User'
        comment:
          type: object
          description: "`alert.comment_added` only. The new comment."
          properties:
            id:
              type: integer
            content:
              type: string
            created:
              type: string
              format: date-time
            triggerType:
              type: string
              enum: [NONE, ALL]
        changedChannel:
          type: object
          description: "`alert.channel_attached`, `alert.channel_detached` only."
          properties:
            id:
              type: integer
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ilert.com/integrations/actions/context/entity-alert.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
