Skip to content
Download Beeper

Send a message

client.Messages.Send(ctx, chatID, body) (*MessageSendResponse, error)
POST/v1/chats/{chatID}/messages

Send a text message to a specific chat. Supports replying to existing messages. Returns a pending message ID.

ParametersExpand Collapse
chatID string

Unique identifier of the chat.

body MessageSendParams
Attachment param.Field[MessageSendParamsAttachment]optional

Single attachment to send with the message

UploadID string

Upload ID from uploadAsset endpoint. Required to reference uploaded files.

Duration float64optional

Duration in seconds (optional override of cached value)

FileName stringoptional

Filename (optional override of cached value)

MimeType stringoptional

MIME type (optional override of cached value)

Size MessageSendParamsAttachmentSizeoptional

Dimensions (optional override of cached value)

Height float64
Width float64
Type stringoptional

Special attachment type (gif, voiceNote, sticker). If omitted, auto-detected from mimeType

Accepts one of the following:
const MessageSendParamsAttachmentTypeGif MessageSendParamsAttachmentType = "gif"
const MessageSendParamsAttachmentTypeVoiceNote MessageSendParamsAttachmentType = "voiceNote"
const MessageSendParamsAttachmentTypeSticker MessageSendParamsAttachmentType = "sticker"
ReplyToMessageID param.Field[string]optional

Provide a message ID to send this as a reply to an existing message

Text param.Field[string]optional

Text content of the message you want to send. You may use markdown.

ReturnsExpand Collapse
type MessageSendResponse struct{…}
ChatID string

Unique identifier of the chat.

PendingMessageID string

Pending message ID

Send a message

package main

import (
  "context"
  "fmt"

  "github.com/beeper/desktop-api-go"
)

func main() {
  client := beeperdesktopapi.NewClient(

  )
  response, err := client.Messages.Send(
    context.TODO(),
    "!NCdzlIaMjZUmvmvyHU:beeper.com",
    beeperdesktopapi.MessageSendParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.PendingMessageID)
}
{
  "chatID": "!signal_adamvy:local-signal.localhost",
  "pendingMessageID": "m1694783291234567"
}
Returns Examples
{
  "chatID": "!signal_adamvy:local-signal.localhost",
  "pendingMessageID": "m1694783291234567"
}