Skip to main content
Segments allow you to organize contacts into groups for targeted email campaigns. This guide covers creating, managing, and using segments with the Resend Go SDK.

Overview

Segments (formerly called “audiences”) provide a way to organize your global contacts into logical groups for broadcast campaigns. Unlike the legacy audience system, segments work with global contacts and support more flexible organization.
Terminology Update: Resend has renamed “audiences” to “segments”. The API still accepts audience_id for backward compatibility, but new integrations should use segment_id.

Creating a Segment

Create a new segment to organize your contacts.
string
required
The name of the segment. This will be visible in your Resend dashboard.

Retrieving a Segment

Get details about a specific segment.
Get Segment

Listing Segments

Retrieve all segments in your account with optional pagination.

Deleting a Segment

Remove a segment from your account.
Remove Segment
Deleting a segment does not delete the contacts within it. Contacts remain in your account as global contacts.

Managing Contacts in Segments

Segments are populated and managed through the Contacts API’s nested Segments service.

Adding Contacts to Segments

Add a contact to a segment using the Contacts.Segments.Add method.
Add Contact to Segment

Listing Contact’s Segments

Retrieve all segments a contact belongs to.
List Contact Segments

Removing Contacts from Segments

Remove a contact from a specific segment.
Remove Contact from Segment

Relationship to Contacts

Segments work exclusively with global contacts (contacts created without an audience_id). Here’s the recommended workflow:
1

Create Global Contacts

Create contacts without specifying an audience_id:
2

Create Segments

Create segments to organize contacts:
3

Add Contacts to Segments

Associate contacts with segments:
4

Send Broadcasts

Send email campaigns to entire segments:

Complete Example

Here’s a complete workflow demonstrating segment management:
Complete Segment Workflow

Using Segments with Broadcasts

Segments are primarily used to send broadcast email campaigns to groups of contacts.
Send Broadcast to Segment
See the Broadcasts guide for more details on sending email campaigns to segments.

Migration from Audiences

If you’re migrating from the legacy audiences system:
Old Approach (Audiences):
New Approach (Segments):
The API still accepts audience_id for backward compatibility, but new code should use segment_id.

Best Practices

Use Descriptive Names

Give segments clear, descriptive names that indicate their purpose (e.g., “Premium Users”, “Newsletter Subscribers”).

Combine with Properties

Use contact properties along with segments for advanced targeting and personalization.

Keep Segments Organized

Regularly review and clean up unused segments to maintain organization.

Test Before Broadcasting

Test broadcast campaigns on a small segment before sending to larger audiences.

Next Steps

Contacts

Learn how to manage contacts

Broadcasts

Send email campaigns to segments

Segments Example

View the complete segments example

API Reference

View the complete Segments API reference