Skip to content

Page through a conversation's change journal

GET
/chats/{chat}/wal
curl --request GET \
--url 'https://chat.work.optidata.cloud/api/chats/36/wal?page=1' \
--header 'Authorization: Bearer <token>'

Every conversation keeps a write-ahead journal: one append-only entry per change to its messages, each carrying the event class and its payload. An integration that follows the journal can keep an external copy of the conversation up to date without re-reading the message history.

This operation pages through the journal from the beginning. To follow it live, read latest once and then poll since/{id}.

chat
required
integer format: int64

Numeric id of the conversation.

page
integer
default: 1 >= 1

1-based page number.

A page of journal entries.

Media typeapplication/json
object
current_page
integer
data
Array
first_page_url
string | null format: uri
from
integer | null
last_page
integer
last_page_url
string | null format: uri
links
Array<object>

Navigation links of a paginated envelope.

object
url
string | null format: uri
label
string
page
integer | null
active
boolean
next_page_url
string | null format: uri
path
string format: uri
per_page
integer
prev_page_url
string | null format: uri
to
integer | null
total
integer
data
Array<object>

One append-only entry of a conversation’s change journal. event_class names the kind of change and event_json carries its payload; entries are applied in ascending id order.

object
id

Monotonic position in the journal. Pass it to since/{id}.

integer format: int64
chat_id
integer format: int64
message_id

The message the entry is about.

integer | null format: int64
guid
string | null
optiwork_session_id

The client session that caused the change. Compare it with your own to skip the echo of your own writes.

string | null
event_class

The kind of change this entry records.

string
event_json

The payload of the change.

object | string | null
created_at
string format: date-time
updated_at
string format: date-time
Example
{
"current_page": 1
}

Missing, malformed or expired authentication key.

Media typeapplication/json

Authentication failures — and a few permission denials — use an error key rather than message.

object
error
required
string
Examples
Examplemissing

No bearer token sent

{
"error": "JWT passport exception: Missing bearer token in request"
}

The caller is not a participant of the conversation, or lacks the role the operation requires.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Exampledenied
{
"message": "This action is unauthorized."
}

The resource does not exist, or does not belong to the given conversation.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplemissing
{
"message": "No query results for model [App\\Models\\Chat\\Chat] 99999999"
}

Rate limit exceeded. Retry after the window resets.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplethrottled
{
"message": "Too Many Attempts."
}