Method
Parameters
Response
The unique identifier of the created topic
Learn more about Mintlify
Enter your email to receive updates about new features and product releases.
Create a new topic for audience management.
func (s *TopicsSvcImpl) Create(params *CreateTopicRequest) (*CreateTopicResponse, error)
func (s *TopicsSvcImpl) CreateWithContext(ctx context.Context, params *CreateTopicRequest) (*CreateTopicResponse, error)
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)