Skip to content
Download Beeper

Delete a message

client.Messages.Delete(ctx, messageID, params) error
DELETE/v1/chats/{chatID}/messages/{messageID}

Delete a message by final message ID. Pending message IDs are not accepted because messages cannot be deleted while sending.

ParametersExpand Collapse
messageID string

Message ID.

params MessageDeleteParams
ChatID param.Field[string]

Path param: Chat ID. Input routes also accept the local chat ID from this installation when available.

ForEveryone param.Field[bool]Optional

Query param: True to request deletion for everyone when the network supports it; false to delete only for the authenticated user when supported.

Delete a message

package main

import (
  "context"

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

func main() {
  client := beeperdesktopapi.NewClient(
    option.WithAccessToken("My Access Token"),
  )
  err := client.Messages.Delete(
    context.TODO(),
    "1343993",
    beeperdesktopapi.MessageDeleteParams{
      ChatID: "!NCdzlIaMjZUmvmvyHU:beeper.com",
    },
  )
  if err != nil {
    panic(err.Error())
  }
}
Returns Examples