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.
Removes a segment entry by its unique identifier.
Methods
Remove
Remove(segmentId string) (RemoveSegmentResponse, error)
Deletes a segment using the default background context.
RemoveWithContext
RemoveWithContext(ctx context.Context, segmentId string) (RemoveSegmentResponse, error)
Deletes a segment with a custom context for cancellation and timeout control.
Parameters
The unique identifier of the segment to delete.
Response
The unique identifier of the deleted segment.
The object type, always segment.
Indicates whether the segment was successfully deleted.
Example
package main
import (
"fmt"
"github.com/resend/resend-go/v2"
)
func main() {
client := resend.NewClient("re_123456789")
response, err := client.Segments.Remove("seg_123456")
if err != nil {
panic(err)
}
if response.Deleted {
fmt.Println("Segment deleted successfully")
}
}
Deleting a segment is permanent and cannot be undone. Make sure you want to delete the segment before proceeding.