> ## Documentation Index
> Fetch the complete documentation index at: https://botpress.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Event Properties

```json Event properties theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
{
  "botId": "<string>",
  "conversationId": "<string>",
  "createdOn": "<Date>",
  "direction": "<EventDirection>",
  "id": "<string>",
  "integration": "<string>",
  "kb": {
    "included": [],
    "results": []
  },
  "messageId": "<string>",
  "payload": {},
  "preview": "<string>",
  "state": {},
  "tags": {
    "conversation": {},
    "message": {},
    "user": {}
  },
  "trigger": {
    "conversationId": "<string>",
    "eventName": "<string>",
    "flowId": "<string>",
    "integration": "<string>",
    "nodeId": "<string>",
    "userId": "<string>"
  },
  "type": "<string>",
  "userId": "<string>"
}
```

Whenever an event occurs during your bot's execution—like a message being sent—you can access details about that event using the `event` object's properties.

The `event` object is available [wherever you can use code in Botpress Studio](https://botpress.com/docs/studio/guides/advanced/use-code.md). This includes:

* [Hooks](https://botpress.com/docs/studio/concepts/hooks.md)
* [Actions](https://botpress.com/docs/studio/concepts/actions.md)
* [Execute Code Cards](https://botpress.com/docs/studio/concepts/cards/execute-code.md)

You can also access the `event` object within certain [Cards](https://botpress.com/docs/studio/concepts/cards/introduction.md)' configuration fields.

> [!WARNING]
>
> This documentation omits certain properties of the `event` object which exist to maintain internal functionality and aren't useful for bot builders (Happy bot building!).

**event** `IncomingEvent`

Information about the last incoming event in your bot's execution.

**botId** `string` *required*

The ID of the bot that experienced the event.

**conversationId** `string`

The ID of the conversation that the event took place in.

**createdOn** `Date` *required*

The data and time when the event was created (in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format).

**direction** `EventDirection` *required*

The direction of the event, indicating whether the event was received by the bot or sent from the bot.

Possible values:

* `'incoming'`: The event originated from the user and was received by the bot.
* `'outgoing'`: The event was generated by the bot and sent to the user.

**id** `string` *required*

The unique identifier for the event.

**integration** `string`

The [integration](https://botpress.com/docs/integrations/) that the event occurred on.

**kb** `object`

Information about [Knowledge Bases](https://botpress.com/docs/studio/concepts/knowledge-base/introduction.md) queried for the event.

**included** `Studio.KnowledgeBase.KB[]` *required*

Array of Knowledge Bases queried for the event.

> [!WARNING]
>
> Since most of this object's properties are for internal use by Botpress, we've omitted its deeper structure from this documentation.

**results** `Studio.KnowledgeBase.ContentResult[]`

Array of Knowledge Base results consulted for this event.

> [!WARNING]
>
> Since most of this object's properties are for internal use by Botpress, we've omitted its deeper structure from this documentation.

**messageId** `string`

The unique identifier for the current event's message.

**payload** `object` *required*

The payload for the current event.

**preview** `string` *required*

A representation of the event in plain text. If the event is text message, this property will contain the message itself.

**state** `EventState` *required*

Data related to the state of the event.

> [!WARNING]
>
> Since most of this object's properties are for internal use by Botpress, we've omitted its deeper structure from this documentation.

**tags** `EventTags`

Any tags associated with the current event. These can contain useful data related to the integration associated with the event.

**conversation** `object`

Tags for the conversation.

**message** `object`

Tags for the message.

**user** `object`

Tags for the user.

**trigger** `DM.Trigger`

The [Trigger](https://botpress.com/docs/studio/concepts/triggers.md) that sent the event.

**conversationId** `string`

The ID of the conversation associated with this Trigger.

**eventName** `string`

The name of the event that the Trigger sent.

**flowId** `string` *required*

The ID of the Workflow containing the Trigger.

**integration** `string`

The integration associated with the Trigger.

**nodeId** `string` *required*

The ID of the Node that contains the Trigger.

**userId** `string`

The ID of the user associated with this Trigger.

**type** `string` *required*

The type of the event.

**userId** `string`

The user ID associated with this event.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.