ContactGroups
Get a contact group
Returns a single contact group by its ID. Use this endpoint to get a contact group through the Samva email API.
GET
Returns a single contact group by its ID.
apiKeyheader
x-api-key<token>id*stringMatch
^cgrp_[0-9a-hjkmnp-tv-z]{16,24}$Success
application/json- response
id*ContactGroupIdMatch
^cgrp_[0-9a-hjkmnp-tv-z]{16,24}$organizationId*OrganizationIdMatch
^org_[0-9a-hjkmnp-tv-z]{16,24}$name*stringdescription*string|nulltype*stringValue in
"static""dynamic""smart"criteria*|nullcolor*|The list's label color, one of six families, or null for the neutral chip. Customer-chosen and purely presentational; it carries no meaning the API enforces.
icon*string|nullparentGroupId*|nullcontactCount*integerRange
0 <= value <= 9007199254740991lastCalculatedAt*string|nullisActive*booleancreatedAt*stringupdatedAt*stringimport { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.contactGroups.getById({ "id": "example"});Example Response
{ "id": "string", "organizationId": "string", "name": "string", "description": "string", "type": "static", "criteria": { "property1": "string", "property2": "string" }, "color": "clay", "icon": "string", "parentGroupId": "string", "contactCount": 0, "lastCalculatedAt": "string", "isActive": true, "createdAt": "string", "updatedAt": "string"}Related documentation
Evaluate a dynamic contact group
Recomputes a dynamic contact group's membership from its criteria, returning counts of added, removed, and total members.
List members of a contact group
Returns a contact group's members, most recently joined first. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page.