Mail API reference

Mail API · Segments

get/v1/workspaces/{workspace_id}/segments/{segment_id}/metricsAuth

A segment's size and unsubscribed share

Counted on request.

Path parameters

workspace_id*string · uuid

Id of the workspace.

segment_id*string · uuid

Id of the segment.

Response · 200

segment_id*string · uuid

Null on a preview.

contact_count*number

Contacts in the segment now.

Example: 1240

unsubscribed_count*number

Of those, globally unsubscribed.

Example: 31

unsubscribed_share*number

`unsubscribed_count / contact_count`, 0 to 1 (4 decimals); 0 for an empty segment.

Example: 0.025

consented_count*number

Of those, with a recorded marketing consent.

Example: 1100

computed_at*string · date-time

When the counts were taken (rule segments change as contacts do).

Example

Request

GET https://api.mail.productcraft.co/v1/workspaces/{workspace_id}/segments/{segment_id}/metrics
Authorization: Bearer YOUR_TOKEN

Response

{
  "segment_id": "00000000-0000-0000-0000-000000000000",
  "contact_count": 1240,
  "unsubscribed_count": 31,
  "unsubscribed_share": 0.025,
  "consented_count": 1100,
  "computed_at": "2026-01-01T00:00:00.000Z"
}