protocol

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package protocol holds the wire types of the bubbles REST API. It is the single source of truth shared by the server handlers and the Go SDK and depends on the standard library only. The REST contract is docs/openapi.yaml.

Index

Constants

View Source
const (
	MaxAlertTitle      = 200
	MaxAlertText       = 4000
	MaxAlertFields     = 20
	MaxAlertFieldName  = 64
	MaxAlertFieldValue = 512
	MaxAlertDedupeKey  = 200
	MaxAlertLink       = 2048
)

Limits of an AlertInput.

View Source
const (
	ScopeMessagesRead  = "messages:read"
	ScopeMessagesWrite = "messages:write"
	ScopeAlertsWrite   = "alerts:write"
	ScopeFilesWrite    = "files:write"
	ScopeChannelsRead  = "channels:read"
	ScopeEventsRead    = "events:read"
	ScopeCommands      = "commands"
	ScopeDMWrite       = "dm:write"
	ScopeMCP           = "mcp"
)

App token scopes. A token carries a subset of these; every endpoint an app calls checks the scope it needs.

View Source
const (
	ChannelPublic  = "public"
	ChannelPrivate = "private"
	ChannelDM      = "dm"
	ChannelGroupDM = "group_dm"
)

Channel kinds.

View Source
const (
	MemberOwner  = "owner"
	MemberMember = "member"
)

Membership roles.

View Source
const (
	NotifyAll      = "all"
	NotifyMentions = "mentions"
	NotifyNone     = "none"
)

Notification levels of a membership.

View Source
const (
	SeverityInfo     = "info"
	SeverityWarning  = "warning"
	SeverityCritical = "critical"
)

Alert severities.

View Source
const (
	MaxCommandsPerApp      = 50
	MaxCommandNameChars    = 32
	MaxCommandTextChars    = 200  // description and usage
	MaxCommandArgsChars    = 4000 // args of an invocation
	MaxCommandRespondChars = 4000 // text of a response
)

Limits of the command registry and of an invocation.

View Source
const (
	CommandTopic  = "topic"
	CommandInvite = "invite"
	CommandLeave  = "leave"
	CommandMute   = "mute"
	CommandMe     = "me"
	CommandHelp   = "help"
)

Built-in command names. An app cannot register one of these.

View Source
const (
	CodeBadRequest          = "bad_request"
	CodeUnauthorized        = "unauthorized"
	CodeForbidden           = "forbidden"
	CodeNotFound            = "not_found"
	CodeConflict            = "conflict"
	CodeTooLarge            = "too_large"
	CodeUnsupportedMedia    = "unsupported_media"
	CodeRateLimited         = "rate_limited"
	CodeInsufficientStorage = "insufficient_storage"
	CodeUnavailable         = "unavailable"
	CodeInternal            = "internal"
)

Error codes of the REST error model (see docs/openapi.yaml).

View Source
const (
	AlertTransitionCreated      = "created"
	AlertTransitionEscalated    = "escalated"
	AlertTransitionRenotifyDue  = "renotify_due"
	AlertTransitionUpdatedOther = "updated_other"
	AlertTransitionAcked        = "acked"
	AlertTransitionResolved     = "resolved"
)

Alert transitions: what an alert event did to its alert. They are the values of AlertUpdatedEvent.Transition; a new alert message (message.created, kind alert) is implicitly TransitionCreated. Only created, escalated and renotify_due can notify (pkg/notifyrules); the others are informational.

View Source
const (
	FileImage = "image"
	FileVideo = "video"
	FileAudio = "audio"
	FileOther = "file"
)

File categories.

View Source
const (
	MessageText   = "text"
	MessageAlert  = "alert"
	MessageSystem = "system"
)

Message kinds.

View Source
const (
	AlertOpen     = "open"
	AlertAcked    = "acked"
	AlertResolved = "resolved"
)

Alert states.

View Source
const (
	PairingPending  = "pending"
	PairingApproved = "approved"
	PairingDenied   = "denied"
	PairingExpired  = "expired"
	PairingClaimed  = "claimed"
)

Pairing request states.

View Source
const (
	// ResetContent deletes every message, file, alert and event and bumps
	// the instance epoch; accounts, channels, apps and settings stay.
	ResetContent = "content"
	// ResetFactory wipes everything and returns the server to the setup
	// wizard under a new instance id.
	ResetFactory = "factory"
)

Reset modes of POST /admin/reset.

View Source
const (
	RoleAdmin  = "admin"
	RoleMember = "member"
	RoleGuest  = "guest"
)

User roles.

View Source
const (
	KindHuman = "human"
	KindApp   = "app"
)

User kinds.

View Source
const (
	// QueryResume is the last seq the client applied (bootstrap seq_head or
	// the last event frame); the server replays retained events after it.
	QueryResume = "resume"
	// QueryInstance is the instance_id the client's state belongs to.
	QueryInstance = "instance"
	// QueryEpoch is the epoch the client's state belongs to.
	QueryEpoch = "epoch"
)

WebSocket query parameters.

View Source
const (
	FrameHello = "hello"
	FramePong  = "pong"
)

Server frame types that are not events.

View Source
const (
	// ResumeOK: the client's state is current; replayed events (if any)
	// follow, then live events.
	ResumeOK = "ok"
	// ResumeResyncRequired: the resume point is gone (retention, epoch
	// change); drop cached messages and drafts and re-fetch /bootstrap.
	ResumeResyncRequired = "resync_required"
	// ResumeInstanceChanged: the server was factory-reset or replaced; wipe
	// all local state.
	ResumeInstanceChanged = "instance_changed"
)

Hello.Resume outcomes.

View Source
const (
	ClientTyping   = "typing"
	ClientPresence = "presence"
	ClientFocus    = "focus"
	ClientPing     = "ping"
)

Client frame types.

View Source
const (
	PresenceActive = "active"
	PresenceIdle   = "idle"
)

Client presence reports (ClientFrame.State).

View Source
const (
	PresenceOnline  = "online"
	PresenceOffline = "offline"
)

Aggregated presence states (PresenceEvent.State). Idle doubles as the client report value.

View Source
const (
	CloseSlowConsumer   = 4008
	CloseSessionRevoked = 4009
	CloseServerReset    = 4010
	CloseContentCleared = 4011
)

WebSocket close codes (besides the standard 1000-1011).

View Source
const AppTokenPrefix = "bub_"

AppTokenPrefix starts every app token.

View Source
const AvatarFileName = "avatar"

AvatarFileName is the name segment of an avatar URL; the server looks files up by id only, so the name is cosmetic.

View Source
const DetailsFields = "fields"

DetailsFields is the key of Error.Details that maps a request field name to the reason it was rejected (validation errors).

View Source
const MaxClientFrameBytes = 4096

MaxClientFrameBytes bounds one client frame.

View Source
const MaxPrefsBytes = 4096

MaxPrefsBytes is the largest prefs object PATCH /me accepts.

View Source
const PairingHeader = "X-Poll-Secret"

PairingHeader carries the poll secret on GET /pairing/requests/{id}.

View Source
const ScopeNotify = "notify"

ScopeNotify lets a tray device show notifications for the user.

View Source
const TimeLayout = "2006-01-02T15:04:05.000Z"

TimeLayout is the wire format of every timestamp: RFC 3339, UTC, with milliseconds.

View Source
const WSPath = "/api/v1/ws"

WSPath is the WebSocket endpoint. Query parameters: QueryResume, QueryInstance, QueryEpoch.

View Source
const WebhookTokenPrefix = "bwh_"

WebhookTokenPrefix starts the secret path token of every incoming webhook.

Variables

AppScopes lists every scope a token can carry.

DeviceScopes are the only scopes a device token carries.

Functions

func AvatarURL

func AvatarURL(fileID string) string

AvatarURL is the URL path of a user's avatar image.

func FileThumbURL

func FileThumbURL(id, name string) string

FileThumbURL is the URL path of a file's thumbnail.

func FileURL

func FileURL(id, name string) string

FileURL is the URL path a file is served from.

func FormatTime

func FormatTime(unixMilli int64) string

FormatTime renders unix milliseconds in TimeLayout.

Types

type AcceptInviteRequest

type AcceptInviteRequest struct {
	Username    string `json:"username"`
	Password    string `json:"password"`
	DisplayName string `json:"display_name"`
}

AcceptInviteRequest is the body of POST /invites/{code}/accept.

type AddMemberRequest

type AddMemberRequest struct {
	Role string `json:"role,omitempty"`
}

AddMemberRequest is the optional body of PUT /channels/{id}/members/{user_id}.

type AdminChannelList

type AdminChannelList struct {
	Items []Channel `json:"items"`
}

AdminChannelList is the body of GET /admin/channels: public and private channels with names and member counts, never their content.

type AdminInvite

type AdminInvite struct {
	ID        string  `json:"id"`
	Role      string  `json:"role"`
	Note      string  `json:"note"`
	CreatedBy *string `json:"created_by"`
	CreatedAt string  `json:"created_at"`
	ExpiresAt string  `json:"expires_at"`
	MaxUses   int     `json:"max_uses"`
	UseCount  int     `json:"use_count"`
	RevokedAt *string `json:"revoked_at"`
}

AdminInvite is one invite; the code is never part of it.

type AdminInviteList

type AdminInviteList struct {
	Items []AdminInvite `json:"items"`
}

AdminInviteList is the body of GET /admin/invites.

type AdminOverview

type AdminOverview struct {
	InstanceName   string   `json:"instance_name"`
	Version        string   `json:"version"`
	StartedAt      string   `json:"started_at"`
	UptimeSeconds  int64    `json:"uptime_seconds"`
	Users          int      `json:"users"`
	Connections    int      `json:"connections"`
	StorageBytes   int64    `json:"storage_used_bytes"`
	DiskFreeBytes  *int64   `json:"disk_free_bytes"`
	TLSMode        string   `json:"tls_mode"`
	CAFingerprint  string   `json:"ca_fingerprint"`
	CertNotAfter   string   `json:"cert_not_after"`
	HTTPSURLs      []string `json:"https_urls"`
	OnboardingURLs []string `json:"onboarding_urls"`
	// ClientIsolationHint is true while no device other than the server
	// itself has signed in; Wi-Fi client isolation is a likely cause.
	ClientIsolationHint bool `json:"client_isolation_hint"`
}

AdminOverview is the body of GET /admin/overview.

type AdminSettings

type AdminSettings struct {
	InstanceName         string   `json:"instance_name"`
	OpenRegistration     bool     `json:"open_registration"`
	UploadMaxBytes       int64    `json:"upload_max_bytes"`
	UserQuotaBytes       int64    `json:"user_quota_bytes"`
	DiskReserveBytes     int64    `json:"disk_reserve_bytes"`
	DefaultRetentionDays *int     `json:"default_retention_days"`
	WebPushEnabled       bool     `json:"web_push_enabled"`
	PushPayload          string   `json:"push_payload"`
	AllowedCIDRs         []string `json:"allowed_cidrs"`
	SessionIdleDays      int      `json:"session_idle_days"`
	AlertRenotifyS       int      `json:"alert_renotify_s"`
	MDNSEnabled          bool     `json:"mdns_enabled"`
	WebResetEnabled      bool     `json:"web_reset_enabled"`
}

AdminSettings is the body of GET /admin/settings and the answer of PATCH: every setting with defaults applied.

type AdminTLS

type AdminTLS struct {
	Mode            string   `json:"mode"`
	CAFingerprint   string   `json:"ca_fingerprint"`
	LeafFingerprint string   `json:"leaf_fingerprint"`
	LeafNotAfter    string   `json:"leaf_not_after"`
	SANs            []string `json:"sans"`
}

AdminTLS is the body of GET /admin/tls.

type AdminUserList

type AdminUserList struct {
	Items []User `json:"items"`
}

AdminUserList is the body of GET /admin/users (human accounts).

type Alert

type Alert struct {
	Severity    string       `json:"severity"`
	State       string       `json:"state"`
	Title       string       `json:"title"`
	Fields      []AlertField `json:"fields"`
	Link        *string      `json:"link"`
	DedupeKey   string       `json:"dedupe_key"`
	Occurrences int          `json:"occurrences"`
	FirstSeenAt string       `json:"first_seen_at"`
	LastSeenAt  string       `json:"last_seen_at"`
	AckedBy     *string      `json:"acked_by"`
	AckedAt     *string      `json:"acked_at"`
	ResolvedBy  *string      `json:"resolved_by"`
	ResolvedAt  *string      `json:"resolved_at"`
}

Alert is the alert state of a kind=alert message.

type AlertField

type AlertField struct {
	Name  string `json:"name"`
	Value string `json:"value"`
	Short bool   `json:"short"`
}

AlertField is one name/value pair of an alert.

type AlertInput

type AlertInput struct {
	Channel        string       `json:"channel"`
	Severity       string       `json:"severity"`
	Title          string       `json:"title"`
	Text           string       `json:"text,omitempty"`
	Fields         []AlertField `json:"fields,omitempty"`
	Link           *string      `json:"link,omitempty"`
	DedupeKey      string       `json:"dedupe_key"`
	RenotifyAfterS *int         `json:"renotify_after_s,omitempty"`
	OccurredAt     *string      `json:"occurred_at,omitempty"`
}

AlertInput is the body of POST /alerts. Channel is a channel name (with or without a leading #) or id. DedupeKey identifies the condition: a repeat with the same key updates the open alert instead of creating a new one. RenotifyAfterS defaults to the instance setting alert_renotify_s; 0 turns renotification off. OccurredAt (RFC 3339) is when the condition was seen; the server never records a time in the future.

type AlertPage

type AlertPage struct {
	Items      []Message `json:"items"`
	NextCursor *string   `json:"next_cursor"`
}

AlertPage is the body of GET /alerts: alert messages, newest first. NextCursor is null on the last page.

type AlertUpdatedEvent

type AlertUpdatedEvent struct {
	Message    Message `json:"message"`
	Transition string  `json:"transition"`
}

AlertUpdatedEvent is the payload of alert.updated: the alert's message as it stands after the update and the transition that caused the event. The notification dispatcher and the clients decide notifications from Transition and Message.Alert.Severity.

type App

type App struct {
	ID          string     `json:"id"`
	UserID      string     `json:"user_id"`
	Username    string     `json:"username"`
	Name        string     `json:"name"`
	Description string     `json:"description"`
	OwnerUserID *string    `json:"owner_user_id"`
	CreatedAt   string     `json:"created_at"`
	DisabledAt  *string    `json:"disabled_at"`
	Tokens      []AppToken `json:"tokens"`
}

App is an integration: a bot account plus its tokens. Tokens lists every token of the app, revoked ones included, in the admin API and is empty in GET /apps/self.

type AppList

type AppList struct {
	Items []App `json:"items"`
}

AppList is the body of GET /admin/apps.

type AppSelf

type AppSelf struct {
	App   App      `json:"app"`
	Token AppToken `json:"token"`
}

AppSelf is the body of GET /apps/self: the calling token's app and the token itself.

type AppToken

type AppToken struct {
	ID         string   `json:"id"`
	AppID      string   `json:"app_id"`
	Prefix     string   `json:"prefix"`
	Scopes     []string `json:"scopes"`
	ChannelIDs []string `json:"channel_ids"`
	CreatedAt  string   `json:"created_at"`
	ExpiresAt  *string  `json:"expires_at"`
	LastUsedAt *string  `json:"last_used_at"`
	RevokedAt  *string  `json:"revoked_at"`
}

AppToken is the public view of an app token. The secret itself is shown once, when the token is issued; afterwards only Prefix identifies it. ChannelIDs null means the channels the app's bot is a member of; a list restricts the token to those channels.

type ApprovePairingRequest

type ApprovePairingRequest struct {
	Scopes        []string `json:"scopes,omitempty"`
	ChannelIDs    []string `json:"channel_ids,omitempty"`
	CreateChannel bool     `json:"create_channel,omitempty"`
}

ApprovePairingRequest is the body of POST /admin/pairing-requests/{id}/approve: the scopes to grant, the channels to add the new bot to, and whether to create a public "<app>-alerts" channel for it. Empty Scopes grants the scopes the app requested.

type AuditEntry

type AuditEntry struct {
	ID         string          `json:"id"`
	At         string          `json:"at"`
	ActorID    *string         `json:"actor_id"`
	ActorKind  string          `json:"actor_kind"`
	ActorIP    string          `json:"actor_ip"`
	Action     string          `json:"action"`
	TargetType string          `json:"target_type"`
	TargetID   string          `json:"target_id"`
	Detail     json.RawMessage `json:"detail"`
}

AuditEntry is one audit log row.

type AuditPage

type AuditPage struct {
	Items      []AuditEntry `json:"items"`
	NextCursor *string      `json:"next_cursor"`
}

AuditPage is the body of GET /admin/audit; NextCursor is null at the end.

type AuthResponse

type AuthResponse struct {
	User Me `json:"user"`
}

AuthResponse answers every request that starts a session (setup, login, invite accept, register). The session itself travels in the cookie.

type Author

type Author struct {
	ID          string  `json:"id"`
	Username    string  `json:"username"`
	DisplayName string  `json:"display_name"`
	Kind        string  `json:"kind"`
	AvatarURL   *string `json:"avatar_url"`
}

Author is the sender of a message. Accounts are deactivated, never deleted, so the author is always present.

type BackupRequest

type BackupRequest struct {
	Passphrase string `json:"passphrase"`
}

BackupRequest is the body of POST /admin/backup. The archive is encrypted with Passphrase (age, scrypt).

type Bootstrap

type Bootstrap struct {
	InstanceID     string         `json:"instance_id"`
	Epoch          int64          `json:"epoch"`
	Me             Me             `json:"me"`
	Users          []User         `json:"users"`
	Channels       []Channel      `json:"channels"`
	Memberships    []Membership   `json:"memberships"`
	Unread         []Unread       `json:"unread"`
	SettingsPublic SettingsPublic `json:"settings_public"`
	SeqHead        int64          `json:"seq_head"`
}

Bootstrap is the body of GET /bootstrap. Everything in it is a consistent snapshot taken at SeqHead: a client replays events with seq > SeqHead.

type ChangePasswordRequest

type ChangePasswordRequest struct {
	Current string `json:"current"`
	New     string `json:"new"`
}

ChangePasswordRequest is the body of POST /me/password.

type Channel

type Channel struct {
	ID             string   `json:"id"`
	Kind           string   `json:"kind"`
	Name           *string  `json:"name"`
	Topic          string   `json:"topic"`
	Description    string   `json:"description"`
	IsDefault      bool     `json:"is_default"`
	RetentionDays  *int     `json:"retention_days"`
	CreatedBy      *string  `json:"created_by"`
	CreatedAt      string   `json:"created_at"`
	ArchivedAt     *string  `json:"archived_at"`
	MemberCount    int      `json:"member_count"`
	ParticipantIDs []string `json:"participant_ids,omitempty"`
}

Channel is the wire view of a channel row. Name is null for direct messages; ParticipantIDs is set for dm and group_dm only (a note-to-self has exactly one participant).

type ChannelEvent

type ChannelEvent struct {
	Channel     Channel      `json:"channel"`
	Memberships []Membership `json:"memberships,omitempty"`
}

ChannelEvent is the payload of channel.created, channel.updated, channel.archived and channel.unarchived. Memberships lists the initial members on channel.created only.

type ChannelList

type ChannelList struct {
	Items []Channel `json:"items"`
}

ChannelList is the body of GET /channels.

type ClientFrame

type ClientFrame struct {
	Type      string  `json:"type"`
	ChannelID *string `json:"channel_id,omitempty"`
	State     string  `json:"state,omitempty"`
	Visible   *bool   `json:"visible,omitempty"`
	TS        string  `json:"ts,omitempty"`
}

ClientFrame is a client-to-server signal. Fields by type:

typing    channel_id (required)
presence  state: "active" | "idle"
focus     visible (required), channel_id (string or null), ts (optional RFC 3339)
ping      (none)

type Command

type Command struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Usage       string `json:"usage"`
	AppName     string `json:"app_name"`
	Builtin     bool   `json:"builtin"`
}

Command is one entry of GET /commands. AppName is empty for a built-in.

type CommandInput

type CommandInput struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Usage       string `json:"usage"`
}

CommandInput is one command of the body of PUT /apps/self/commands.

type CommandInvoked

type CommandInvoked struct {
	InvocationID string         `json:"invocation_id"`
	Command      string         `json:"command"`
	Args         string         `json:"args"`
	ChannelID    string         `json:"channel_id"`
	ThreadRootID *string        `json:"thread_root_id"`
	User         CommandInvoker `json:"user"`
}

CommandInvoked is the data of a command.invoked event. It is sent only to the connections of the app that owns the command, with seq 0, and is not stored.

type CommandInvoker

type CommandInvoker struct {
	ID          string `json:"id"`
	Username    string `json:"username"`
	DisplayName string `json:"display_name"`
}

CommandInvoker names the person who ran a command.

type CommandList

type CommandList struct {
	Items []Command `json:"items"`
}

CommandList is the body of GET /commands and of the response to PUT /apps/self/commands.

type CommandResponse

type CommandResponse = RespondCommandRequest

CommandResponse is the body of POST /api/v1/commands/invocations/{id}/respond.

type ContentCleared

type ContentCleared struct {
	Epoch int64 `json:"epoch"`
}

ContentCleared answers POST /admin/reset with mode "content": the new instance epoch. Sessions stay valid; clients resync to empty channels.

type CreateAppRequest

type CreateAppRequest struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Username    string `json:"username,omitempty"`
}

CreateAppRequest is the body of POST /admin/apps. Username is optional; without it the bot's username is derived from the name.

type CreateAppTokenRequest

type CreateAppTokenRequest struct {
	Scopes     []string `json:"scopes"`
	ChannelIDs []string `json:"channel_ids,omitempty"`
	ExpiresAt  *string  `json:"expires_at,omitempty"`
}

CreateAppTokenRequest is the body of POST /admin/apps/{id}/tokens. ChannelIDs absent or null leaves the token unrestricted by an allowlist.

type CreateChannelRequest

type CreateChannelRequest struct {
	Name      string   `json:"name"`
	Kind      string   `json:"kind"`
	Topic     string   `json:"topic,omitempty"`
	MemberIDs []string `json:"member_ids,omitempty"`
}

CreateChannelRequest is the body of POST /channels.

type CreateInviteRequest

type CreateInviteRequest struct {
	Role             string `json:"role,omitempty"`
	Note             string `json:"note,omitempty"`
	ExpiresInSeconds int    `json:"expires_in_seconds,omitempty"`
	MaxUses          int    `json:"max_uses,omitempty"`
}

CreateInviteRequest is the body of POST /admin/invites. Zero fields take the defaults (member, 72 hours, one use).

type CreateMessageRequest

type CreateMessageRequest struct {
	Body         string   `json:"body"`
	ThreadRootID *string  `json:"thread_root_id,omitempty"`
	FileIDs      []string `json:"file_ids,omitempty"`
	Nonce        string   `json:"nonce,omitempty"`
}

CreateMessageRequest is the body of POST /channels/{id}/messages. A repeated nonce returns the message it created first.

type CreateWebhookRequest

type CreateWebhookRequest struct {
	ChannelID string `json:"channel_id"`
	Name      string `json:"name"`
}

CreateWebhookRequest is the body of POST /admin/webhooks. Name becomes the name of the webhook's pseudo-app and of its bot account.

type CreatedInvite

type CreatedInvite struct {
	AdminInvite
	URL string `json:"url"`
}

CreatedInvite answers POST /admin/invites. URL holds the secret code and is in this answer only.

type CreatedWebhook

type CreatedWebhook struct {
	Webhook
	URL string `json:"url"`
}

CreatedWebhook is the answer of POST /admin/webhooks: the webhook and the URL to post to. The URL carries the secret and is not shown again.

type Device

type Device struct {
	ID         string   `json:"id"`
	Name       string   `json:"name"`
	Prefix     string   `json:"prefix"`
	Scopes     []string `json:"scopes"`
	Current    bool     `json:"current"`
	CreatedAt  string   `json:"created_at"`
	LastUsedAt *string  `json:"last_used_at"`
}

Device is the public view of a device token.

type DeviceList

type DeviceList struct {
	Items []Device `json:"items"`
}

DeviceList is the body of GET /me/devices.

type DeviceLoginRequest

type DeviceLoginRequest struct {
	Username   string `json:"username"`
	Password   string `json:"password"`
	DeviceName string `json:"device_name"`
}

DeviceLoginRequest is the body of POST /auth/device-login.

type DeviceLoginResponse

type DeviceLoginResponse struct {
	DeviceToken string `json:"device_token"`
	DeviceID    string `json:"device_id"`
	HandoffCode string `json:"handoff_code"`
}

DeviceLoginResponse carries the new device token (shown once) and the one-time handoff code that opens the web app without a second sign-in.

type EditMessageRequest

type EditMessageRequest struct {
	Body string `json:"body"`
}

EditMessageRequest is the body of PATCH /messages/{id}.

type EphemeralMessage

type EphemeralMessage struct {
	InvocationID string  `json:"invocation_id"`
	ChannelID    string  `json:"channel_id"`
	ThreadRootID *string `json:"thread_root_id"`
	Author       *Author `json:"author"`
	Body         string  `json:"body"`
}

EphemeralMessage is the data of an ephemeral.message event: a notice or an app's private answer shown only to the person it is for, in the channel (and thread) the command ran in. It has seq 0 and is not stored. Author is the app's bot for an app's answer and null for a notice from the server itself. InvocationID is empty when no app invocation is behind the notice.

type Error

type Error struct {
	Code    string         `json:"code"`
	Message string         `json:"message"`
	Details map[string]any `json:"details,omitempty"`
}

Error is the inner object of the error envelope.

func (*Error) Error

func (e *Error) Error() string

Error makes *Error usable as a Go error in SDK code.

func (*Error) FieldErrors

func (e *Error) FieldErrors() map[string]string

FieldErrors returns details.fields of a validation error, or nil.

type ErrorBody

type ErrorBody struct {
	Error Error `json:"error"`
}

ErrorBody is the JSON error envelope: {"error":{"code","message","details"}}.

type Event

type Event struct {
	Seq       int64           `json:"seq"`
	Type      string          `json:"type"`
	ChannelID string          `json:"channel_id,omitempty"`
	TS        string          `json:"ts"`
	Data      json.RawMessage `json:"data"`
}

Event is the envelope of one realtime event (WebSocket frame and replay). Persisted events carry their global Seq; ephemeral frames use seq 0.

Data holds one of the payload types below, selected by Type:

message.created, message.updated  Message
message.deleted                   MessageDeleted
reaction.added, reaction.removed  ReactionEvent
pin.added, pin.removed            PinEvent
channel.created, .updated,
channel.archived, .unarchived     ChannelEvent
channel.member_joined             MemberJoinedEvent
channel.member_left               MemberLeftEvent
membership.updated                Membership (user-scoped)
read.updated                      ReadEvent (user-scoped)
alert.updated                     AlertUpdatedEvent

Channel-scoped events carry ChannelID and are delivered to the channel's members (public channel lifecycle events to every non-guest); user-scoped events carry no ChannelID and go to the one user named in the payload.

type FactoryReset

type FactoryReset struct {
	SetupToken    string `json:"setup_token"`
	SetupURL      string `json:"setup_url"`
	CARotated     bool   `json:"ca_rotated"`
	CAFingerprint string `json:"ca_fingerprint"`
}

FactoryReset answers POST /admin/reset with mode "factory": the new one-time setup token, where to use it and the CA devices must trust (CARotated says whether it changed).

type File

type File struct {
	ID           string  `json:"id"`
	Name         string  `json:"name"`
	Size         int64   `json:"size"`
	Mime         string  `json:"mime"`
	Category     string  `json:"category"`
	Width        *int    `json:"width"`
	Height       *int    `json:"height"`
	HasThumb     bool    `json:"has_thumb"`
	MetaStripped bool    `json:"meta_stripped"`
	URL          string  `json:"url"`
	ThumbURL     *string `json:"thumb_url"`
}

File is an uploaded file. It is the answer of POST /files and the element of Message.Files. Name is the sanitized original file name. MetaStripped is false for files whose metadata could not be removed (HEIC, video, audio, documents and images that were not processed).

type HandoffCodeResponse

type HandoffCodeResponse struct {
	HandoffCode string `json:"handoff_code"`
}

HandoffCodeResponse is the body of POST /auth/handoff-code.

type Hello

type Hello struct {
	Type          string `json:"type"` // FrameHello
	InstanceID    string `json:"instance_id"`
	Epoch         int64  `json:"epoch"`
	SeqHead       int64  `json:"seq_head"`
	UserID        string `json:"user_id"`
	ServerVersion string `json:"server_version"`
	Resume        string `json:"resume"`
}

Hello is the first frame on every connection.

type InviteInfo

type InviteInfo struct {
	Valid        bool   `json:"valid"`
	Role         string `json:"role,omitempty"`
	InstanceName string `json:"instance_name"`
}

InviteInfo is the body of GET /invites/{code}. Role is empty and Valid false when the code is unknown, expired, revoked or used up.

type InvokeCommandRequest

type InvokeCommandRequest struct {
	ChannelID    string  `json:"channel_id"`
	Command      string  `json:"command"`
	Args         string  `json:"args"`
	ThreadRootID *string `json:"thread_root_id,omitempty"`
}

InvokeCommandRequest is the body of POST /commands/invoke.

type InvokedCommand

type InvokedCommand struct {
	InvocationID string `json:"invocation_id,omitempty"`
	Builtin      bool   `json:"builtin"`
}

InvokedCommand is the response to POST /commands/invoke. InvocationID is set for an app command (202: the app was told); it is empty for a built-in, which the server has already run (200).

type IssuedAppToken

type IssuedAppToken struct {
	Token            string   `json:"token"`
	ConnectionString string   `json:"connection_string"`
	Info             AppToken `json:"info"`
}

IssuedAppToken is the answer of POST /admin/apps/{id}/tokens: the only time the token secret is shown. ConnectionString is the same token in the bubbles:// form the SDK and the netdiag setup accept.

type LoginRequest

type LoginRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

LoginRequest is the body of POST /auth/login.

type MarkReadRequest

type MarkReadRequest struct {
	MessageID string `json:"message_id"`
}

MarkReadRequest is the body of POST /channels/{id}/read.

type Me

type Me struct {
	User
	Prefs      json.RawMessage `json:"prefs"`
	MustChange bool            `json:"must_change_pw"`
}

Me is the signed-in user's own view: the public fields plus private ones.

type Member

type Member struct {
	UserID   string `json:"user_id"`
	Role     string `json:"role"`
	JoinedAt string `json:"joined_at"`
}

Member is the public view of a channel member (GET /channels/{id}/members).

type MemberJoinedEvent

type MemberJoinedEvent struct {
	ChannelID  string     `json:"channel_id"`
	UserID     string     `json:"user_id"`
	ActorID    string     `json:"actor_id"`
	Channel    Channel    `json:"channel"`
	Membership Membership `json:"membership"`
}

MemberJoinedEvent is the payload of channel.member_joined. Channel and Membership let the new member's client add the channel without a refetch.

type MemberLeftEvent

type MemberLeftEvent struct {
	ChannelID string `json:"channel_id"`
	UserID    string `json:"user_id"`
	ActorID   string `json:"actor_id"`
}

MemberLeftEvent is the payload of channel.member_left. ActorID differs from UserID when the member was removed. The departing user must still receive the event although they are no longer a member.

type MemberList

type MemberList struct {
	Items []Member `json:"items"`
}

MemberList is the body of GET /channels/{id}/members.

type Membership

type Membership struct {
	ChannelID        string  `json:"channel_id"`
	UserID           string  `json:"user_id"`
	Role             string  `json:"role"`
	JoinedAt         string  `json:"joined_at"`
	LastReadID       *string `json:"last_read_id"`
	NotifyLevel      string  `json:"notify_level"`
	AlertMinSeverity string  `json:"alert_min_severity"`
	MutedUntil       *string `json:"muted_until"`
}

Membership is one user's own relation to a channel, including private preferences. LastReadID and MutedUntil are null when unset.

type Mentions

type Mentions struct {
	UserIDs []string `json:"user_ids"`
	Channel bool     `json:"channel"`
	Here    bool     `json:"here"`
}

Mentions lists who a message mentions.

type Message

type Message struct {
	ID           string     `json:"id"`
	ChannelID    string     `json:"channel_id"`
	ThreadRootID *string    `json:"thread_root_id"`
	Kind         string     `json:"kind"`
	Author       Author     `json:"author"`
	OverrideName *string    `json:"override_name"`
	Body         string     `json:"body"`
	Files        []File     `json:"files"`
	Reactions    []Reaction `json:"reactions"`
	Mentions     Mentions   `json:"mentions"`
	ReplyCount   int        `json:"reply_count"`
	LastReplyAt  *string    `json:"last_reply_at"`
	EditedAt     *string    `json:"edited_at"`
	Deleted      bool       `json:"deleted"`
	CreatedAt    string     `json:"created_at"`
	Alert        *Alert     `json:"alert"`
}

Message is the wire view of a chat message. A deleted message keeps its row as a tombstone: Deleted is true, Body is empty and Files, Reactions and Mentions are empty.

type MessageDeleted

type MessageDeleted struct {
	ID           string  `json:"id"`
	ChannelID    string  `json:"channel_id"`
	ThreadRootID *string `json:"thread_root_id"`
	DeletedAt    string  `json:"deleted_at"`
}

MessageDeleted is the payload of message.deleted. The message row stays as a tombstone; ThreadRootID is set when the deleted message was a reply.

type MessagePage

type MessagePage struct {
	Items         []Message `json:"items"`
	HasMoreBefore bool      `json:"has_more_before"`
	HasMoreAfter  bool      `json:"has_more_after"`
}

MessagePage is a page of messages in chronological order (oldest first).

type NewMessage

type NewMessage = CreateMessageRequest

NewMessage is the body of POST /api/v1/channels/{id}/messages.

type PairingApproval

type PairingApproval struct {
	App        App      `json:"app"`
	ChannelIDs []string `json:"channel_ids"`
}

PairingApproval is the answer of an approval: the new app and the ids of the channels its bot was added to (the created one included).

type PairingCreated

type PairingCreated struct {
	ID         string `json:"id"`
	PollSecret string `json:"poll_secret"`
	Code       string `json:"code"`
	ExpiresAt  string `json:"expires_at"`
}

PairingCreated is the answer of POST /pairing/requests. The app shows Code to the admin and polls with PollSecret, which is shown only here.

type PairingRequest

type PairingRequest = PairingRequestInput

PairingRequest is the body of POST /api/v1/pairing/requests.

type PairingRequestInput

type PairingRequestInput struct {
	AppName         string   `json:"app_name"`
	Description     string   `json:"description,omitempty"`
	RequestedScopes []string `json:"requested_scopes,omitempty"`
}

PairingRequestInput is the body of POST /pairing/requests.

type PairingStatus

type PairingStatus struct {
	State     string `json:"state"`
	Token     string `json:"token,omitempty"`
	ExpiresAt string `json:"expires_at"`
}

PairingStatus is the answer of GET /pairing/requests/{id}. Token is set exactly once, on the first poll after the admin approved the request; the state is then claimed.

type PasswordResetLink struct {
	URL       string `json:"url"`
	ExpiresAt string `json:"expires_at"`
}

PasswordResetLink answers POST /admin/users/{id}/password-reset. URL is the one-time link; it is in this answer only.

type Patch

type Patch[T any] struct {
	Set   bool
	Value *T
}

Patch is one field of a partial update: absent from the JSON (Set false, leave unchanged), null (Set true, Value nil: clear) or a value.

func (Patch[T]) IsZero

func (p Patch[T]) IsZero() bool

IsZero lets `omitzero` drop an unset field.

func (Patch[T]) MarshalJSON

func (p Patch[T]) MarshalJSON() ([]byte, error)

MarshalJSON writes the value, or null to clear it.

func (*Patch[T]) UnmarshalJSON

func (p *Patch[T]) UnmarshalJSON(b []byte) error

UnmarshalJSON records that the field was present.

type PendingPairing

type PendingPairing struct {
	ID              string   `json:"id"`
	AppName         string   `json:"app_name"`
	Description     string   `json:"description"`
	RequestedScopes []string `json:"requested_scopes"`
	Code            string   `json:"code"`
	SourceIP        string   `json:"source_ip"`
	CAFingerprint   string   `json:"ca_fingerprint"`
	CreatedAt       string   `json:"created_at"`
	ExpiresAt       string   `json:"expires_at"`
}

PendingPairing is a pairing request as the admin sees it: the code to compare with the one the app shows, where it came from, and the CA fingerprint the app displays too.

type PendingPairingList

type PendingPairingList struct {
	Items []PendingPairing `json:"items"`
}

PendingPairingList is the body of GET /admin/pairing-requests.

type Pin

type Pin struct {
	Message  Message `json:"message"`
	PinnedBy *string `json:"pinned_by"`
	PinnedAt string  `json:"pinned_at"`
}

Pin is a pinned message of a channel.

type PinEvent

type PinEvent struct {
	ChannelID string `json:"channel_id"`
	MessageID string `json:"message_id"`
	UserID    string `json:"user_id"`
	PinnedAt  string `json:"pinned_at,omitempty"`
}

PinEvent is the payload of pin.added and pin.removed.

type PinList

type PinList struct {
	Items []Pin `json:"items"`
}

PinList is the body of GET /channels/{id}/pins, newest pin first.

type Pong

type Pong struct {
	Type string `json:"type"` // FramePong
}

Pong answers a client ping frame.

type PostedAlert

type PostedAlert struct {
	Message    Message `json:"message"`
	Transition string  `json:"transition"`
}

PostedAlert is the answer of POST /alerts: the alert's message and what the post did to the alert (an AlertTransition* constant). A new alert is 201 with transition created; a repeat is 200.

type PresenceEvent

type PresenceEvent struct {
	UserID string `json:"user_id"`
	State  string `json:"state"` // PresenceOnline | PresenceIdle | PresenceOffline
}

PresenceEvent is the payload of the ephemeral presence.changed event.

type PushKeys

type PushKeys struct {
	P256DH string `json:"p256dh"`
	Auth   string `json:"auth"`
}

PushKeys are the subscription keys a browser's PushSubscription.toJSON() returns: the client's P-256 public key and its 16-byte auth secret, both base64url without padding (RFC 8291).

type PushPayload

type PushPayload struct {
	Title     string `json:"title"`
	ChannelID string `json:"channel_id"`
	MessageID string `json:"message_id"`
	Body      string `json:"body,omitempty"`
}

PushPayload is the JSON the service worker receives in a push message. Body is present only when the admin set push_payload to "full" (a whitespace-collapsed excerpt of at most 120 characters).

type PushSubscribeRequest

type PushSubscribeRequest struct {
	Endpoint string   `json:"endpoint"`
	Keys     PushKeys `json:"keys"`
}

PushSubscribeRequest is the body of POST /push/subscriptions. The endpoint must be an https URL of a known browser push service.

type PushUnsubscribeRequest

type PushUnsubscribeRequest struct {
	Endpoint string `json:"endpoint"`
}

PushUnsubscribeRequest is the body of DELETE /push/subscriptions.

type PushVapidKey

type PushVapidKey struct {
	Key string `json:"key"`
}

PushVapidKey is the response of GET /push/vapid-public-key: the server's VAPID public key (base64url, uncompressed P-256 point) for PushManager.subscribe({applicationServerKey}).

type Reaction

type Reaction struct {
	Emoji   string   `json:"emoji"`
	Count   int      `json:"count"`
	UserIDs []string `json:"user_ids"`
}

Reaction is the aggregate of one emoji on a message.

type ReactionEvent

type ReactionEvent struct {
	MessageID string `json:"message_id"`
	ChannelID string `json:"channel_id"`
	UserID    string `json:"user_id"`
	Emoji     string `json:"emoji"`
	Count     int    `json:"count"`
}

ReactionEvent is the payload of reaction.added and reaction.removed. Count is the number of users with this emoji on the message after the change.

type ReactionList

type ReactionList struct {
	Items []Reaction `json:"items"`
}

ReactionList is the body of PUT and DELETE /messages/{id}/reactions/{emoji}: the message's reactions after the change.

type ReadEvent

type ReadEvent struct {
	ChannelID  string `json:"channel_id"`
	LastReadID string `json:"last_read_id"`
	Unread     int    `json:"unread"`
	Mentions   int    `json:"mentions"`
}

ReadEvent is the payload of read.updated: the new read marker of the recipient and the unread and mention counts after the change.

type RegisterRequest

type RegisterRequest struct {
	Username    string `json:"username"`
	Password    string `json:"password"`
	DisplayName string `json:"display_name"`
}

RegisterRequest is the body of POST /register.

type ResetPasswordRequest

type ResetPasswordRequest struct {
	Password string `json:"password"`
}

ResetPasswordRequest is the body of POST /password-resets/{code}.

type ResetPreview

type ResetPreview struct {
	Users    int   `json:"users"`
	Channels int   `json:"channels"`
	Messages int   `json:"messages"`
	Files    int   `json:"files"`
	Bytes    int64 `json:"bytes"`
}

ResetPreview is the body of GET /admin/reset/preview: what a reset would delete, shown in the confirmation dialog. Bytes is the stored size of the distinct uploaded files.

type ResetRequest

type ResetRequest struct {
	Mode         string `json:"mode"`
	Confirm      string `json:"confirm"`
	Password     string `json:"password"`
	RotateCA     bool   `json:"rotate_ca,omitempty"`
	KeepSettings bool   `json:"keep_settings,omitempty"`
}

ResetRequest is the body of POST /admin/reset. Confirm must equal the instance name and Password is the admin's own password. RotateCA and KeepSettings apply to ResetFactory only.

type ResolveAlertByKeyRequest

type ResolveAlertByKeyRequest struct {
	DedupeKey string `json:"dedupe_key"`
	Text      string `json:"text,omitempty"`
}

ResolveAlertByKeyRequest is the body of POST /alerts/resolve.

type ResolveAlertRequest

type ResolveAlertRequest struct {
	Text string `json:"text,omitempty"`
}

ResolveAlertRequest is the optional body of POST /alerts/{id}/resolve.

type RespondCommandRequest

type RespondCommandRequest struct {
	Text      string `json:"text"`
	Ephemeral bool   `json:"ephemeral"`
}

RespondCommandRequest is the body of POST /commands/invocations/{id}/respond.

type RespondedCommand

type RespondedCommand struct {
	Ephemeral bool     `json:"ephemeral"`
	Message   *Message `json:"message"`
}

RespondedCommand is the response to a command response. Message is the posted message, null for an ephemeral response (which is never stored).

type SearchPage

type SearchPage struct {
	Items      []SearchResult `json:"items"`
	NextCursor *string        `json:"next_cursor"`
}

SearchPage is the body of GET /search, best match first. NextCursor is the opaque cursor of the following page, null on the last page.

type SearchResult

type SearchResult struct {
	Message Message `json:"message"`
	Snippet string  `json:"snippet"`
}

SearchResult is one hit of GET /search: the message and a short excerpt of its text.

Snippet is an HTML fragment that is safe to render as markup: all message text in it is HTML-escaped (&, <, >, " and ') and the only tags are <mark> and </mark> around the matched terms.

type Session

type Session struct {
	ID          string `json:"id"`
	Kind        string `json:"kind"`
	Current     bool   `json:"current"`
	CreatedAt   string `json:"created_at"`
	LastSeenAt  string `json:"last_seen_at"`
	IdleExpires string `json:"idle_expires_at"`
	AbsExpires  string `json:"abs_expires_at"`
	UserAgent   string `json:"user_agent"`
	IP          string `json:"ip"`
}

Session describes one signed-in browser or device of the caller.

type SessionList

type SessionList struct {
	Items []Session `json:"items"`
}

SessionList is the body of GET /me/sessions.

type SessionRevokedEvent

type SessionRevokedEvent struct {
	SessionID       string `json:"session_id,omitempty"`
	All             bool   `json:"all,omitempty"`
	ExceptSessionID string `json:"except_session_id,omitempty"`
}

SessionRevokedEvent is the payload of session.revoked: one session (SessionID) or all of the user's sessions except ExceptSessionID.

type SettingsPublic

type SettingsPublic struct {
	InstanceName   string `json:"instance_name"`
	UploadMaxBytes int64  `json:"upload_max_bytes"`
	WebPushEnabled bool   `json:"web_push_enabled"`
}

SettingsPublic is the part of the instance settings every signed-in user may read.

type SettingsUpdatedEvent

type SettingsUpdatedEvent struct {
	Keys []string `json:"keys"`
}

SettingsUpdatedEvent is the payload of settings.updated: the changed setting keys; clients re-fetch what they display.

type SetupRequest

type SetupRequest struct {
	SetupToken   string `json:"setup_token"`
	Username     string `json:"username"`
	Password     string `json:"password"`
	DisplayName  string `json:"display_name"`
	InstanceName string `json:"instance_name"`
}

SetupRequest is the body of POST /setup.

type SetupStatus

type SetupStatus struct {
	NeedsSetup bool `json:"needs_setup"`
}

SetupStatus is the body of GET /setup/status.

type StartDMRequest

type StartDMRequest struct {
	UserIDs []string `json:"user_ids"`
}

StartDMRequest is the body of POST /dms.

type Thread

type Thread struct {
	Root          Message   `json:"root"`
	Replies       []Message `json:"replies"`
	HasMoreBefore bool      `json:"has_more_before"`
	HasMoreAfter  bool      `json:"has_more_after"`
}

Thread is a thread root with a page of its replies, oldest first.

type TypingEvent

type TypingEvent struct {
	ChannelID string `json:"channel_id"`
	UserID    string `json:"user_id"`
}

TypingEvent is the payload of the ephemeral typing event.

type Unread

type Unread struct {
	ChannelID string `json:"channel_id"`
	Unread    int    `json:"unread"`
	Mentions  int    `json:"mentions"`
}

Unread is the unread and mention count of one joined channel.

type UpdateAdminChannelRequest

type UpdateAdminChannelRequest struct {
	RetentionDays json.RawMessage `json:"retention_days,omitempty"`
	IsDefault     *bool           `json:"is_default,omitempty"`
	Archived      *bool           `json:"archived,omitempty"`
}

UpdateAdminChannelRequest is the body of PATCH /admin/channels/{id}. RetentionDays is the JSON number, null (keep forever) or absent.

type UpdateAdminUserRequest

type UpdateAdminUserRequest struct {
	Role        *string `json:"role,omitempty"`
	Deactivated *bool   `json:"deactivated,omitempty"`
}

UpdateAdminUserRequest is the body of PATCH /admin/users/{id}.

type UpdateAppRequest

type UpdateAppRequest struct {
	Name        *string `json:"name,omitempty"`
	Description *string `json:"description,omitempty"`
	Disabled    *bool   `json:"disabled,omitempty"`
}

UpdateAppRequest is the body of PATCH /admin/apps/{id}. An absent field is left alone; disabled true rejects the app's tokens until it is false again.

type UpdateChannelRequest

type UpdateChannelRequest struct {
	Name          *string    `json:"name,omitempty"`
	Topic         *string    `json:"topic,omitempty"`
	Description   *string    `json:"description,omitempty"`
	RetentionDays Patch[int] `json:"retention_days,omitzero"`
}

UpdateChannelRequest is the body of PATCH /channels/{id}. retention_days null removes the channel's own retention.

type UpdateMeRequest

type UpdateMeRequest struct {
	DisplayName  Patch[string]          `json:"display_name,omitzero"`
	StatusText   Patch[string]          `json:"status_text,omitzero"`
	AvatarFileID Patch[string]          `json:"avatar_file_id,omitzero"`
	Prefs        Patch[json.RawMessage] `json:"prefs,omitzero"`
}

UpdateMeRequest is the body of PATCH /me. An absent field is left alone. display_name and prefs cannot be null; status_text null clears the text; avatar_file_id null removes the avatar. prefs replaces the whole object.

type UpdateMembershipRequest

type UpdateMembershipRequest struct {
	NotifyLevel      *string       `json:"notify_level,omitempty"`
	AlertMinSeverity *string       `json:"alert_min_severity,omitempty"`
	MutedUntil       Patch[string] `json:"muted_until,omitzero"`
}

UpdateMembershipRequest is the body of PATCH /channels/{id}/membership. muted_until null unmutes.

type User

type User struct {
	ID           string  `json:"id"`
	Username     string  `json:"username"`
	DisplayName  string  `json:"display_name"`
	Kind         string  `json:"kind"`
	Role         string  `json:"role"`
	AvatarFileID *string `json:"avatar_file_id"`
	StatusText   string  `json:"status_text"`
	Deactivated  bool    `json:"deactivated"`
	CreatedAt    string  `json:"created_at"`
}

User is the public view of an account.

type UserList

type UserList struct {
	Items []User `json:"items"`
}

UserList is the body of GET /users.

type Webhook

type Webhook struct {
	ID        string  `json:"id"`
	ChannelID string  `json:"channel_id"`
	AppID     string  `json:"app_id"`
	Name      string  `json:"name"`
	CreatedBy *string `json:"created_by"`
	CreatedAt string  `json:"created_at"`
	RevokedAt *string `json:"revoked_at"`
}

Webhook is an incoming webhook: a secret URL that posts into one channel as a pseudo-app (a bot account named after the webhook). The secret itself is shown once, when the webhook is created; afterwards nothing identifies the URL but this record.

type WebhookList

type WebhookList struct {
	Items []Webhook `json:"items"`
}

WebhookList is the body of GET /admin/webhooks.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL