Node.js
import { Rewrite } from '@rewritetoday/sdk';
const rewrite = new Rewrite(process.env.REWRITE_API_KEY!);
const { data, error } = await rewrite.segments.get(
'748395130237498560',
);
if (error) throw error;{
"ok": true,
"data": {
"id": "748395130237498560",
"createdAt": "2026-03-20T14:22:31.562Z",
"name": "vip-customers",
"description": "Customers with priority transactional flows.",
"color": "#0EA5E9",
"contactsCount": 12,
"sandbox": false,
"updatedAt": "2026-03-20T14:22:31.562Z"
}
}Segments
Get a segment
Fetch one segment and its current aggregate metadata.
GET
/
segments
/
{id}
Node.js
import { Rewrite } from '@rewritetoday/sdk';
const rewrite = new Rewrite(process.env.REWRITE_API_KEY!);
const { data, error } = await rewrite.segments.get(
'748395130237498560',
);
if (error) throw error;{
"ok": true,
"data": {
"id": "748395130237498560",
"createdAt": "2026-03-20T14:22:31.562Z",
"name": "vip-customers",
"description": "Customers with priority transactional flows.",
"color": "#0EA5E9",
"contactsCount": 12,
"sandbox": false,
"updatedAt": "2026-03-20T14:22:31.562Z"
}
}Authorizations
Send your API key as Authorization: Bearer rw_....
Required scope: project:read.
Path Parameters
Segment identifier returned by Rewrite.
Example:
"748395130237498412"