Skip to content
Download Beeper

List labels

client.Labels.List(ctx) (*[]Label, error)
GET/v1/labels

List the labels the user has created for organizing chats. Filter chats by label via GET /v1/chats/search with labelID.

ReturnsExpand Collapse
type LabelListResponse []Label

Labels the user has created, sorted by name.

ID string

Unique identifier of the label.

Name string

Display name of the label.

List labels

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"),
  )
  labels, err := client.Labels.List(context.TODO())
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", labels)
}
[
  {
    "id": "id",
    "name": "name"
  }
]
Returns Examples
[
  {
    "id": "id",
    "name": "name"
  }
]