Skip to main content

Method

func (s *TopicsSvcImpl) List(options *ListOptions) (*ListTopicsResponse, error)
func (s *TopicsSvcImpl) ListWithContext(ctx context.Context, options *ListOptions) (*ListTopicsResponse, error)

Parameters

options
*ListOptions
Pagination options
Limit
*int
Maximum number of topics to return
After
*string
Cursor for forward pagination
Before
*string
Cursor for backward pagination

Response

Object
string
Always "list"
HasMore
bool
Whether there are more results available
Data
[]*Topic
Array of topic objects
Id
string
The unique identifier of the topic
Name
string
The name of the topic
Description
string
The description of the topic
DefaultSubscription
DefaultSubscription
Default subscription preference
CreatedAt
string
ISO 8601 timestamp of when the topic was created

Example

client := resend.NewClient("re_123456789")

limit := 10
options := &resend.ListOptions{
    Limit: &limit,
}

response, err := client.Topics.List(options)
if err != nil {
    panic(err)
}

for _, topic := range response.Data {
    fmt.Printf("Topic: %s (%s)\n", topic.Name, topic.Id)
}

fmt.Println("Has More:", response.HasMore)

Build docs developers (and LLMs) love