## Retrieve a message `client.Messages.Get(ctx, messageID, query) (*Message, error)` **get** `/v1/chats/{chatID}/messages/{messageID}` Retrieve a message by final message ID, pendingMessageID, or Matrix event ID. chatID may be a Beeper chat ID or a local chat ID. ### Parameters - `messageID string` Message ID. - `query MessageGetParams` - `ChatID param.Field[string]` Chat ID. Input routes also accept the local chat ID from this installation when available. ### Returns - `type Message struct{…}` - `ID string` Message ID. - `AccountID string` Beeper account ID the message belongs to. - `ChatID string` Chat ID. Input routes also accept the local chat ID from this installation when available. - `SenderID string` Fully qualified sender user ID. Network-backed IDs usually include the network prefix and homeserver. - `SortKey string` A unique, sortable key used to sort messages. - `Timestamp Time` Message timestamp. - `Attachments []Attachment` Attachments included with this message, if any. - `Type AttachmentType` Attachment type. - `const AttachmentTypeUnknown AttachmentType = "unknown"` - `const AttachmentTypeImg AttachmentType = "img"` - `const AttachmentTypeVideo AttachmentType = "video"` - `const AttachmentTypeAudio AttachmentType = "audio"` - `ID string` Attachment identifier, typically an mxc:// URL. Use the download file endpoint to get a local file path. - `Duration float64` Duration in seconds (audio/video). - `FileName string` Original filename if available. - `FileSize float64` File size in bytes if known. - `IsGif bool` True if the attachment is a GIF. - `IsSticker bool` True if the attachment is a sticker. - `IsVoiceNote bool` True if the attachment is a voice note. - `MimeType string` MIME type if known (e.g., 'image/png'). - `PosterImg string` Preview image URL for video attachments (poster frame). May be temporary or available only on this device; download promptly if durable access is needed. - `Size AttachmentSize` Pixel dimensions of the attachment: width/height in px. - `Height float64` - `Width float64` - `SrcURL string` Public URL or local file path to fetch the file. May be temporary or available only on this device; download promptly if durable access is needed. - `Transcription AttachmentTranscription` Attachment transcription if available. - `Engine string` Transcription engine. - `Transcription string` Transcribed text. - `Language string` Detected or selected language. - `EditedTimestamp Time` Timestamp when the message was edited, if known. - `IsDeleted bool` True if the message has been deleted. - `IsHidden bool` True if the message is hidden from normal display. - `IsSender bool` True if the authenticated user sent the message. - `IsUnread bool` True if the message is unread for the authenticated user. May be omitted. - `LinkedMessageID string` ID of the message this is a reply to, if any. - `Links []MessageLink` Link previews included with this message, if any. - `Title string` Link preview title. - `URL string` Resolved link URL. - `Favicon string` Favicon URL if available. May be temporary or available only on this device; download promptly if durable access is needed. - `Img string` Preview image URL if available. May be temporary or available only on this device; download promptly if durable access is needed. - `ImgSize MessageLinkImgSize` Preview image dimensions. - `Height float64` - `Width float64` - `OriginalURL string` Original URL when the displayed URL is shortened or redirected. - `Summary string` Link preview summary. - `Mentions []string` Mentioned user IDs, @room, or null for legacy messages that require text scanning. - `Reactions []Reaction` Reactions to the message, if any. - `ID string` Reaction ID. When a participant can react more than once, the ID is the participant ID concatenated with the reaction key; otherwise it equals the participant ID. - `ParticipantID string` User ID of the participant who reacted. - `ReactionKey string` The reaction key: an emoji (😄), a network-specific key, or a shortcode like "smiling-face". - `Emoji bool` True if the reactionKey is an emoji. - `ImgURL string` URL to the reaction's image. May be temporary or available only on this device; download promptly if durable access is needed. - `Seen MessageSeenUnion` Read receipt state for this message, when available. - `bool` - `Time` - `type MessageSeenByParticipant map[string, MessageSeenByParticipantItemUnion]` Group read receipt state keyed by participant ID. - `bool` - `Time` - `SenderName string` Resolved sender display name. - `SendStatus MessageSendStatus` Message send status for this message, when reported by the bridge. - `Status string` Current status of the message send attempt. - `const MessageSendStatusStatusSuccess MessageSendStatusStatus = "SUCCESS"` - `const MessageSendStatusStatusPending MessageSendStatusStatus = "PENDING"` - `const MessageSendStatusStatusFailRetriable MessageSendStatusStatus = "FAIL_RETRIABLE"` - `const MessageSendStatusStatusFailPermanent MessageSendStatusStatus = "FAIL_PERMANENT"` - `Timestamp Time` Timestamp for the send status event. - `DeliveredToUsers []string` User IDs the message was delivered to, when reported by the network. - `InternalError string` Diagnostic error detail from the messaging network adapter. Do not show directly to users. - `Message string` Human-readable send status or failure message. - `Reason string` Machine-readable failure reason. Present when the send status is a failure. - `Text string` Rich-text message body if present. - `Type MessageType` Message content type. Useful for distinguishing reactions, media messages, and state events from regular text messages. - `const MessageTypeText MessageType = "TEXT"` - `const MessageTypeNotice MessageType = "NOTICE"` - `const MessageTypeImage MessageType = "IMAGE"` - `const MessageTypeVideo MessageType = "VIDEO"` - `const MessageTypeVoice MessageType = "VOICE"` - `const MessageTypeAudio MessageType = "AUDIO"` - `const MessageTypeFile MessageType = "FILE"` - `const MessageTypeSticker MessageType = "STICKER"` - `const MessageTypeLocation MessageType = "LOCATION"` - `const MessageTypeReaction MessageType = "REACTION"` ### Example ```go package main import ( "context" "fmt" "github.com/beeper/desktop-api-go" "github.com/beeper/desktop-api-go/option" ) func main() { client := beeperdesktopapi.NewClient( option.WithAccessToken("My Access Token"), ) message, err := client.Messages.Get( context.TODO(), "1343993", beeperdesktopapi.MessageGetParams{ ChatID: "!NCdzlIaMjZUmvmvyHU:beeper.com", }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", message.ID) } ``` #### Response ```json { "id": "241392", "accountID": "discordgo", "chatID": "!discord_109876543210987654:beeper.com", "senderID": "@discord_221590782384013314:beeper.com", "sortKey": "455171049984", "timestamp": "2026-05-05T20:20:12.497Z", "attachments": [ { "type": "unknown", "id": "id", "duration": 0, "fileName": "fileName", "fileSize": 0, "isGif": true, "isSticker": true, "isVoiceNote": true, "mimeType": "mimeType", "posterImg": "posterImg", "size": { "height": 0, "width": 0 }, "srcURL": "srcURL", "transcription": { "engine": "engine", "transcription": "transcription", "language": "language" } } ], "editedTimestamp": "2025-08-31T23:30:12.520Z", "isDeleted": false, "isHidden": true, "isSender": false, "isUnread": false, "linkedMessageID": "1343993", "links": [ { "title": "title", "url": "url", "favicon": "favicon", "img": "img", "imgSize": { "height": 0, "width": 0 }, "originalURL": "originalURL", "summary": "summary" } ], "mentions": [ "@discord_337451892017545216:beeper.com" ], "reactions": [ { "id": "id", "participantID": "participantID", "reactionKey": "reactionKey", "emoji": true, "imgURL": "imgURL" } ], "seen": true, "senderName": "Kishan Bagaria", "sendStatus": { "status": "SUCCESS", "timestamp": "2025-08-31T23:30:12.520Z", "deliveredToUsers": [ "string" ], "internalError": "internalError", "message": "message", "reason": "reason" }, "text": "The OAuth fix is deployed. Can you verify the desktop flow?", "type": "TEXT" } ```