Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/resend/resend-go/llms.txt

Use this file to discover all available pages before exploring further.

Method

func (s *TopicsSvcImpl) Create(params *CreateTopicRequest) (*CreateTopicResponse, error)
func (s *TopicsSvcImpl) CreateWithContext(ctx context.Context, params *CreateTopicRequest) (*CreateTopicResponse, error)

Parameters

params
*CreateTopicRequest
required
The topic creation parameters
Name
string
required
The name of the topic
DefaultSubscription
DefaultSubscription
required
Default subscription preference for new contacts. Can be "opt_in" or "opt_out"
Description
string
Optional description of the topic

Response

Id
string
The unique identifier of the created topic

Example

client := resend.NewClient("re_123456789")

params := &resend.CreateTopicRequest{
    Name:                "Product Updates",
    DefaultSubscription: resend.DefaultSubscriptionOptIn,
    Description:         "Monthly product updates and announcements",
}

topic, err := client.Topics.Create(params)
if err != nil {
    panic(err)
}

fmt.Println("Topic ID:", topic.Id)