All updates

Update Segment API

Rename a segment from the API, CLI, or any official SDK.

You could already create, retrieve, list, and delete segments from the API. Today we're adding PATCH /segments/:id so you can rename a segment the same way.

Renaming a segment

Pass the segment ID and the new name.

import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.segments.update(
'78261eea-8f8b-4381-83c6-79fa7120f1cf',
{
name: 'Active Users',
},
);

The response confirms the rename:

{
"object": "segment",
"id": "78261eea-8f8b-4381-83c6-79fa7120f1cf"
}

Renaming segments is also available in the Resend CLI and through the MCP server.