tommy

Rendered from docs/openapi-chat.json in the repository.

On this page

tommy chat API v1

Captures the Slack and Microsoft Teams messages your application posts instead of delivering them, keeping each one's Block Kit blocks or Adaptive Card exactly as it was sent. The chat tab groups them by channel and nests replies under the message they answer.

These routes read back what tommy captured, in the shape this content type wants: filters that only mean something here, and the parts that are bytes rather than JSON. They read from the same store as the events API, so a client that sends and immediately fetches sees its own write, and every entry carries the id of the event behind it.

The events API - /api/v1/events, described in its own document - is the generic view of the same captures, and is the one to use when what you are asserting does not depend on the content type. The fake vendor endpoints are described nowhere here: they are the vendors' specifications, not tommy's.

This document is generated from the server's route table. It cannot describe a route that does not exist, and CI fails if the checked-in copy stops matching the code.

Server

  • /api/v1/chat — This tommy's chat API.

Operations

GET /channels The derived channel index: message, thread, reply and orphan counts, and the last message. Computed on every request, so it always agrees with the tab.

Responses

StatusBodyDescription
200 application/json · array of chat.ChannelSummary
Success.
GET /messages Every captured chat message, newest first.

Parameters

NameInTypeDescription
provider query string Only entries captured by this provider, such as mailjet.
type query string Only entries of this event type, such as mail.message.
search query string Case-insensitive substring over the summary and type.
since query string RFC3339 timestamp, a duration such as 5m, or unix milliseconds.
limit query integer Maximum number of entries to return.
offset query integer How many entries to skip.
channel query string The provider's channel id, its display name, or the derived key - all three appear in responses.
author query string Substring of the author's name or id.
thread query string Only messages in this thread, by derived thread key.
format query string The payload format the provider sent, such as blocks or text.
bot query boolean Only messages posted by a bot, or only those that were not.
replies query boolean Include or exclude thread replies.

Responses

StatusBodyDescription
200 application/json · array of chat.MessageEnvelope
Success.
400 application/json · api.Error
A query parameter could not be parsed - a malformed since, a negative limit.
DELETE /messages Clear every captured chat message.

Responses

StatusBodyDescription
204 no body Done. No body.
GET /messages/{id} One message, with its derived channel, thread and root identifiers.

Parameters

NameInTypeDescription
id required path string The event id, as returned by any listing.

Responses

StatusBodyDescription
200 application/json · chat.MessageEnvelope
Success.
404 application/json · api.Error
No such resource, or it belongs to another plugin.

Schemas

api.Error

PropertyType
error requiredstring

chat.Author

PropertyType
botboolean
icon_urlstring
idstring
namestring

chat.ChannelRef

PropertyType
id requiredstring
namestring

chat.ChannelSummary

PropertyType
display requiredstring
id requiredstring
key requiredstring
last_authorstring
last_message_at requiredstring (date-time)
last_message_idstring
last_previewstring
messages requiredinteger
messages_url requiredstring
namestring
orphans requiredinteger
replies requiredinteger
threads requiredinteger
ui_url requiredstring

chat.Content

PropertyType
data requiredstring, base64-encoded
format requiredstring

chat.Message

PropertyType
author requiredchat.Author
channel requiredchat.ChannelRef
contentsarray of chat.Content
text requiredstring
thread_tsstring
tsstring

chat.MessageEnvelope

PropertyType
channel_key requiredstring
formatsarray of string
id requiredstring
message requiredchat.Message
metaobject of any
provider requiredstring
received_at requiredstring (date-time)
reply requiredboolean
root_id requiredstring
thread_key requiredstring
type requiredstring
urlstring