Skip to content
Download Beeper

Archive or unarchive a chat

client.Chats.Archive(ctx, chatID, body) error
POST/v1/chats/{chatID}/archive

Archive or unarchive a chat. Set archived=true to move it to Archive, or archived=false to move it back to the inbox.

ParametersExpand Collapse
chatID string

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

body ChatArchiveParams
Archived param.Field[bool]Optional

True to archive, false to unarchive

Archive or unarchive a chat

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.Chats.Archive(
    context.TODO(),
    "!NCdzlIaMjZUmvmvyHU:beeper.com",
    beeperdesktopapi.ChatArchiveParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
}
Returns Examples