Skip to content

Read channel history

GET
/api/channels/{channel}/history
curl --request GET \
--url 'http://127.0.0.1:7799/api/channels/general/history?limit=20' \
--cookie cotal_web_session=<cotal_web_session>

Percent-decode the channel once and validate it using the core channel grammar. Invalid names are refused without rewriting them to another channel. A failed or late read returns HTTP 503.

channel
required
string
>= 1 characters <= 4096 characters

Channel name or pattern accepted by the core channel grammar. Encode it as one URL path component.

Example

general
limit
integer
default: 200 <= 9007199254740991

Maximum requested messages. Absent or empty uses 200. Accepts decimal digits naming a safe integer, including 0; negative, fractional, whitespace-padded and unsafe values are refused.

Example

20

The current snapshot or history page.

Media typeapplication/json
Array
One of:
object
channel
required

Channel name — multicast (broadcast to everyone on the channel).

string
contextId

Conversation / thread correlation id.

string
from
required
object
id
required
string
name
required
string
role
string
id
required

Unique message id.

string
mentions

Lowercased peer names called out within a channel message — a wake hint that also, on a live channel, routes a durable copy to each mentioned target authorized to read that channel (SPEC §4/§5). It never carries content outside the target’s read ACL and is not a routing substitute for channel/to; the message still multicasts to the whole channel. Omitted when empty.

Array<string>
parts
required
Array
One of:
object
kind
required
string
Allowed value: text
text
required
string
replyTo

Id of the message being replied to.

string
space
required
string
ts
required

Epoch ms.

number
Any of:

Example

[
{
"parts": [
{
"kind": "text"
}
]
}
]

A valid one-use k query token is exchanged for a dashboard session. The response redirects to the same path without its query. A valid existing cookie takes precedence over k.

Location
string

The requested path without the query string.

Set-Cookie
string

Cotal_web_session=; Path=/; HttpOnly; SameSite=Strict. The default local listener uses HTTP.

The query or percent-encoded channel name is invalid.

Media typeapplication/json
object
error
required
string

Examplegenerated

{
"error": "example"
}

No valid session, an invalid launch token, or a spent launch token. The readiness credential does not authorize these routes.

Media typeapplication/json
object
error
required
string
Allowed values: unauthenticated launch-token-already-used

Example

{
"error": "unauthenticated"
}

Origin is checked before session authentication. An origin outside this listener’s allowed origins is refused.

Media typeapplication/json
object
error
required
string
Allowed value: cross-origin

Example

{
"error": "cross-origin"
}

These read routes accept no request body. An announced body is refused before it is read; the connection is closed.

Media typeapplication/json
object
error
required
string

Examplegenerated

{
"error": "example"
}

The request failed. The body names the failure; a failed read does not terminate the dashboard.

Media typeapplication/json
object
error
required
string

Examplegenerated

{
"error": "example"
}

The history read failed or did not finish within 8000 ms.

Media typeapplication/json
object
error
required
string

Examplegenerated

{
"error": "example"
}