Messages
Greenlight stores MESSAGE channel chat history in Postgres for operator audit. This is separate from prompts (approval cards with buttons and signed answer callbacks).
Deliver outbound chat with POST /v1/messages/send — the /send verb is for
MESSAGE channel text only. Create channels with POST /v1/channels/new and
prompts with POST /v1/prompts/new.
What is stored
| Direction | When | Fields of note |
|---|---|---|
inbound | A human sends text on a MESSAGE channel | from_user, text, channel_id |
outbound | POST /v1/messages/send or Admin UI send succeeds | api_key_id, text |
Inbound rows are created even if forwarding to the channel callback_url fails,
unless do not store inbound is enabled in Settings.
Outbound rows are created only after the platform accepts the send, unless
do not store outbound is enabled.
Persistence does not replace your agent webhook — inbound chat still
forwards as unsigned message.created events. See Callbacks.
Send outbound
Agent API
POST /v1/messages/send{
"channel_id": "ops-slack",
"text": "Thanks — deploying now."
}Response includes message_id when the message was stored (omitted when outbound
zero retention is enabled).
Admin UI
- Messages → Send message
- Pick a
MESSAGEchannel - Enter text and submit
You can also send from a channel detail page (Send message).
Review history
Messages in the Admin UI lists inbound and outbound rows with filters for direction (All / Inbound / Outbound). Click a row for full detail.
Use GET /v1/messages and GET /v1/messages/{id} — see
API reference.
Agent API: GET /v1/messages, GET /v1/messages/{id}, and POST /v1/messages/send — see
Agent API.
Data retention
Operators configure retention under Settings → Data retention in two layers:
Scheduled deletion
Hard-delete stored rows older than N days (runs every minute):
| Target | Default |
|---|---|
| Prompts | Off, 30 days when enabled |
| Inbound messages | On, 30 days when enabled |
| Outbound messages | On, 30 days when enabled |
Zero retention (do not store)
When enabled, messages of that direction are never written to history (chat and callbacks still work):
| Target | Default |
|---|---|
| Inbound | Off |
| Outbound | Off |
POST /v1/messages/send omits message_id in the response when outbound storage is disabled.
This is independent of per-prompt ttl_sec (soft EXPIRED state).
vs prompts
Messages (MESSAGE) | Prompts (PROMPT) | |
|---|---|---|
| Outbound verb | send | new |
| Outbound API | POST /v1/messages/send | POST /v1/prompts/new |
| Interactive options | No | Yes |
| Answer callback | N/A (use channel webhook) | Per-prompt, signed |
| Admin list | /messages | /prompts |