ContactGroups
Create a contact group
Creates a new contact group and returns it with a 201 status. Use this endpoint to create a contact group through the Samva email API.
POST
Creates a new contact group and returns it with a 201 status.
apiKeyheader
x-api-key<token>application/json- body
name*stringLength
length <= 120description?string|null|nulltype?|nullcriteria?|null|nullcolor?||nullicon?string|null|nullparentGroupId?|null|nullisActive?boolean|nullSuccess
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.create({ "name": "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
Add members to a contact group
Adds one or more contacts to a contact group, returning counts of added and skipped members. One request carries at most 1000 ids.
Evaluate a dynamic contact group
Recomputes a dynamic contact group's membership from its criteria, returning counts of added, removed, and total members.