# `Jido.Chat.EventEnvelope`
[🔗](https://github.com/agentjido/jido_chat/blob/v1.0.0/lib/jido/chat/event_envelope.ex#L1)

Canonical normalized event envelope used by webhook and gateway ingestion.

# `event_type`

```elixir
@type event_type() ::
  :message
  | :reaction
  | :action
  | :modal_submit
  | :modal_close
  | :slash_command
  | :assistant_thread_started
  | :assistant_context_changed
```

# `t`

```elixir
@type t() :: %Jido.Chat.EventEnvelope{
  adapter_name: nil | nil | atom(),
  channel_id: nil | nil | binary(),
  event_type:
    :message
    | :reaction
    | :action
    | :modal_submit
    | :modal_close
    | :slash_command
    | :assistant_thread_started
    | :assistant_context_changed,
  id: binary(),
  message_id: nil | nil | binary(),
  metadata: map(),
  payload: nil | nil | any(),
  raw: map(),
  thread_id: nil | nil | binary()
}
```

# `from_map`

```elixir
@spec from_map(map()) :: t()
```

Builds event envelope from serialized data.

# `new`

```elixir
@spec new(map()) :: t()
```

Creates a canonical event envelope.

# `schema`

Returns the Zoi schema for EventEnvelope.

# `to_map`

```elixir
@spec to_map(t()) :: map()
```

Serializes event envelope into a plain map with type marker.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
