summaryrefslogtreecommitdiff
path: root/docs/api/events.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/api/events.md')
-rw-r--r--docs/api/events.md16
1 files changed, 6 insertions, 10 deletions
diff --git a/docs/api/events.md b/docs/api/events.md
index 7fc7d78..570dffa 100644
--- a/docs/api/events.md
+++ b/docs/api/events.md
@@ -31,13 +31,11 @@ sequenceDiagram
The core of the service is to facilitate conversations between users. Conversational activity is delivered to clients using
_events_. Each event notifies interested clients of activity sent to the service through its API.
-
## Asynchronous completion
A number of endpoints return
`202 Accepted` responses. The actions performed by those endpoints will be completed before events are delivered. To await the completion of an operation which returns this response, clients must monitor the event stream for the corresponding event.
-
## `GET /api/events`
Subscribes to events.
@@ -87,13 +85,12 @@ The service may terminate the connection at any time. Clients should reconnect a
Each event's `data` consists of a JSON object describing one event. Every event includes the following fields:
| Field | Type | Description |
-|:--------|:-----------------|:-------------------------------------------------------------------------------------------------------------|
+| :------ | :--------------- | :----------------------------------------------------------------------------------------------------------- |
| `type` | string | The type of entity the event describes. Will be one of the types listed in the next section. |
| `event` | string, optional | The specific kind of event. Will be one of the events listed with the associated `type` in the next section. |
The remaining fields depend on the `type` and (if present) the `event` field.
-
## Heartbeat events
```json
@@ -108,7 +105,6 @@ Clients should treat any period of time without events, longer than the heartbea
These events have the `type` field set to `"heartbeat"`. The `event` field is absent.
-
## User events
The following events describe changes to users.
@@ -132,7 +128,7 @@ Sent whenever a new user is created.
These events have the `event` field set to `"created"`. They include the following additional fields:
| Field | Type | Description |
-|:-------|:----------|:---------------------------------------------------------------------------------------------------------------------------------------------------|
+| :----- | :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------- |
| `at` | timestamp | The moment the user was created. |
| `id` | string | A unique identifier for the newly-created user. This can be used to associate the user with other events, or to make API calls targeting the user. |
| `name` | string | The user's name. |
@@ -160,7 +156,7 @@ Sent whenever a new channel is created.
These events have the `event` field set to `"created"`. They include the following additional fields:
| Field | Type | Description |
-|:-------------|:--------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| :----------- | :------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `at` | timestamp | The moment the channel was created. |
| `id` | string | A unique identifier for the newly-created channel. This can be used to associate the channel with other events, or to make API calls targeting the channel. |
| `name` | string | The channel's name. |
@@ -190,7 +186,7 @@ Sent whenever a channel is deleted or expires.
These events have the `event` field set to `"deleted"`. They include the following additional fields:
| Field | Type | Description |
-|:------|:----------|:------------------------------------|
+| :---- | :-------- | :---------------------------------- |
| `at` | timestamp | The moment the channel was deleted. |
| `id` | string | The deleted channel's ID. |
@@ -219,7 +215,7 @@ Sent whenever a message is sent by a client.
These events have the `event` field set to `"sent"`. They include the following additional fields:
| Field | Type | Description |
-|:-------------|:--------------------|:----------------------------------------------------------------------------------------------------------------------------------------------|
+| :----------- | :------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------- |
| `at` | timestamp | The moment the message was sent. |
| `channel` | string | The ID of the channel the message was sent to. |
| `sender` | string | The ID of the user that sent the message. |
@@ -251,6 +247,6 @@ Sent whenever a message is deleted or expires.
These events have the `event` field set to `"deleted"`. They include the following additional fields:
| Field | Type | Description |
-|:------|:----------|:------------------------------------|
+| :---- | :-------- | :---------------------------------- |
| `at` | timestamp | The moment the message was deleted. |
| `id` | string | The deleted message's ID. |