---
title: "Eventos"
description: "O envelope CloudEvents que todos os eventos da Qomni compartilham."
version: "pt-br"
---

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

# Eventos

Todo evento é um [CloudEvent 1.0](https://cloudevents.io): o mesmo envelope e, dentro de `data`, o que é próprio de cada evento. `id` é a chave de idempotência (vem do trabalho, não do acaso) e `subject` é o workspace, então um consumidor pode descartar duplicatas e processar em ordem por workspace. Os nomes seguem `ai.qomni.<domínio>.<objeto>.<ação>.v<n>`.

## Envelope

CloudEvents 1.0 as every qomni event uses it (STYLE.md, events). Each event schema is this envelope plus its `type` and its `data`. `id` is the idempotency key, derived from the work; `subject` is the workspace slug, so brokers partition by workspace; `time` is when it happened.

| Campo | Tipo | Detalhe |
| --- | --- | --- |
| `specversion` <br /><span class="q-ev-flag q-ev-required">Obrigatório</span> | string | `"1.0"` |
| `id` <br /><span class="q-ev-flag q-ev-required">Obrigatório</span> | string | ≤ 200 |
| `source` <br /><span class="q-ev-flag q-ev-required">Obrigatório</span> | string | Who publishes it, e.g. /cells/co1/agents |
| `type` <br /><span class="q-ev-flag q-ev-required">Obrigatório</span> | string |  |
| `time` <br /><span class="q-ev-flag q-ev-required">Obrigatório</span> | string | `date-time` |
| `datacontenttype` <br /><span class="q-ev-flag q-ev-required">Obrigatório</span> | string | `"application/json"` |
| `subject` <br /><span class="q-ev-flag q-ev-required">Obrigatório</span> | string | The workspace slug. |
| `livemode` <br /><span class="q-ev-flag q-ev-optional">Opcional</span> | boolean | CloudEvents extension: false for test-mode work. |
| `traceparent` <br /><span class="q-ev-flag q-ev-optional">Opcional</span> | string | CloudEvents distributed-tracing extension. |
| `data` <br /><span class="q-ev-flag q-ev-required">Obrigatório</span> | object |  |

## Objetos compartilhados

Objetos que vários eventos carregam dentro de `data`.

### `actor`

Who or what acted: an agent, a member, an API key (its ID, never the key) or the system.

| Campo | Tipo | Detalhe |
| --- | --- | --- |
| `type` <br /><span class="q-ev-flag q-ev-required">Obrigatório</span> | string | `agent`, `member`, `api_key`, `system` |
| `id` <br /><span class="q-ev-flag q-ev-required">Obrigatório</span> | string |  |
| `on_behalf_of` <br /><span class="q-ev-flag q-ev-optional">Opcional</span> | string | The member an API key or an approved agent action acts for. |

### `subject`

| Campo | Tipo | Detalhe |
| --- | --- | --- |
| `type` <br /><span class="q-ev-flag q-ev-required">Obrigatório</span> | string | `agent`, `conversation`, `call`, `phone_number` |
| `id` <br /><span class="q-ev-flag q-ev-required">Obrigatório</span> | string |  |

Source: https://docs.qomni.ai/pt-br/events/index.mdx
