# Groups | Signal House API Docs

> Manage top-level Signal House accounts, called groups, through the API.

Source: https://docs.signalhouse.io/groups

---

## Groups

### GET /group/counts

Retrieve resource counts grouped by group. Results include only groups the authenticated caller can access.

**The following roles are required to use this endpoint:** `admin`, `developer`, `api`, `billing`, `user`

#### Request Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `groupId` | Query Param | Optional | Restrict results to an accessible Group ID. |
| `limit` | Query Param | Optional | Maximum rows to return (1–1000). |
| `offset` | Query Param | Optional | Rows to skip; requires limit. |

#### Example Response 200

Response

```json
{
  "data": [
    {
      "groupId": "G1234567",
      "subgroups": 2,
      "endpoints": 3,
      "api_keys": 1,
      "brands": 2,
      "campaigns": 2,
      "phone_numbers": 4
    }
  ],
  "total": 1,
  "page": 1,
  "limit": 20,
  "totalPages": 1
}
```

### GET /group

Retrieve group information by ID. The id parameter is required for customer roles — an unfiltered read-all is restricted to Signal House internal roles and returns 403 for all other roles. The response carries optOutEnforcement (boolean, default true): whether Signal House suppresses the group's sends to recipients who have opted out. It is false only while the account holds a signed Opt-Out Handling Attestation, and cannot be set through this or any other endpoint; signing the attestation in the portal turns it off and re-enabling automated opt-out turns it back on.

**The following roles are required to use this endpoint:** `admin`, `developer`, `api`, `billing`, `user`

#### Request Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | Query Param | Required | Specific Group ID. |

#### Example Response 200

Response

```json
[
  {
    "_id": "60f7b2a1c9e77c001a2b3c56",
    "groupId": "G1234567",
    "optOutEnforcement": true,
    "groupName": "Acme Parent Group",
    "contactFirstName": "John",
    "contactLastName": "Doe",
    "groupCompanyName": "Acme Global",
    "addressLine1": "123 Main St",
    "city": "Springfield",
    "state": "MO",
    "country": "US",
    "postalCode": "65804",
    "phone": "5551234567",
    "status": "active",
    "complianceStatus": "unverified",
    "createdAt": "2024-01-15T12:00:00.000Z",
    "updatedAt": "2024-01-15T12:00:00.000Z"
  }
]
```

### PUT /group/:id

Update an existing group.

**The following roles are required to use this endpoint:** `admin`, `developer`, `api`, `billing`

#### Request Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | URL Param | Required | Group ID to update. |
| `groupName` | String | Optional | Name of the group. |
| `contactFirstName` | String | Optional | Primary contact first name. |
| `contactLastName` | String | Optional | Primary contact last name. |
| `contactMiddleName` | String | Optional | Primary contact middle name. |
| `groupCompanyName` | String | Optional | Associated company name. |
| `addressLine1` | String | Optional | Address line 1. |
| `addressLine2` | String | Optional | Address line 2. |
| `city` | String | Optional | City. |
| `state` | String | Optional | State. |
| `country` | String | Optional | Country. |
| `postalCode` | String | Optional | Postal code. |
| `phone` | String | Optional | Phone number. |
| `cspId` | String|null | Optional | Connectivity Partner (CSP) identifier. Set to null or empty string to clear. Must be unique across active groups. |
| `defaultCnpSubgroupId` | String|null | Optional | Default subgroup ID for CNP campaign mapping. Must belong to this group and be active. Set to null or empty string to clear. |
| `status` | String | Optional | 'active' or 'inactive' (Signal House Admins only). |
| `featureFlags` | Object | Optional | Feature-flag overrides (Signal House Admins only). Keys: netPricing (boolean), tmtIntegration (boolean), p2pEnabled (boolean), tollFreeEnabled (boolean), shortCodeEnabled (boolean), p2pShortlinksDisabled (boolean, when true SignalHouse link-shortening is suppressed on every P2P send for the group), sentimentDisabled (boolean, when true inbound message sentiment enrichment is disabled for the group), rcsEnabled (boolean, opt-in: enables RCS agents for the group), ontraportIntegration (boolean, opt-in and off by default: must be enabled before the group can connect Ontraport or receive its webhook/write-backs - see Ontraport below). |
| `requireTwoFactor` | Boolean | Optional | Require every member of the group to use two-factor authentication (group admins and Signal House Admins only). A member without it gets a setup-only session at their next sign-in (see POST /auth). Sessions already open aren't affected. |

#### Example Response 200

Response

```json
{
  "_id": "60f7b2a1c9e77c001a2b3c56",
  "groupId": "G1234567",
  "groupName": "Acme Parent Group Updated",
  "cspId": "CSP123",
  "defaultCnpSubgroupId": "S1234567",
  "status": "active",
  "complianceStatus": "unverified",
  "updatedAt": "2024-01-16T14:00:00.000Z"
}
```

#### Enterprise SSO

A group can let the people on its company email domains sign in through its own OpenID Connect identity provider (Okta, Microsoft Entra ID, Google Workspace and similar). Register `callbackUrl` as a redirect URL in the identity provider, save the provider with `PUT /group/sso`, then add each domain and prove the group owns it by publishing the TXT record returned for it and calling verify. A domain can be verified by only one group, and public mailbox domains (gmail.com, outlook.com and the like) can't be claimed.

Once a domain is verified, `GET /auth/oauth/sso?email=…` signs its people in (see Authentication › Sign in with a provider). Someone signing in for the first time gets an account in the group with the `user` role. Every endpoint takes the group's `groupId`, is open to the group's `admin` users, and requires signing in directly: an OAuth connector token is rejected with `403`. Every endpoint returns the group's SSO configuration; the client secret is never returned.

### GET /group/sso

Get the group's Enterprise SSO configuration: whether SSO is available on this API, the redirect URL to register with the identity provider, the saved provider (without its client secret), and each claimed domain with the DNS record that verifies it.

**The following roles are required to use this endpoint:** `admin`

#### Request Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `groupId` | Query Param | Required | The group. |

#### Example Response 200

Response

```json
{
  "groupId": "G1234567",
  "available": true,
  "callbackUrl": "https://api.signalhouse.io/auth/oauth/sso/callback",
  "connection": {
    "connectionId": "6711c0ffee0000000000abcd",
    "issuer": "https://acme.okta.com",
    "clientId": "0oa1b2c3d4e5f6g7h8i9",
    "hasClientSecret": true,
    "enabled": true,
    "createdAt": "2026-10-01T12:00:00.000Z",
    "updatedAt": "2026-10-01T12:00:00.000Z"
  },
  "domains": [
    {
      "domain": "acme.com",
      "verified": false,
      "verifiedAt": null,
      "lastCheckedAt": null,
      "verificationRecord": {
        "type": "TXT",
        "name": "_signalhouse-verification.acme.com",
        "value": "signalhouse-verification=Zk3l9b5m0n2Q8rV1sT4uW7yZx2"
      }
    }
  ]
}
```

### PUT /group/sso

Create or update the group's identity provider. The issuer must publish an OpenID Connect discovery document at a public https address; the API reads it before saving and stores the issuer exactly as the document names it. Requires a fresh POST /auth/2fa/confirm-identity from the same session, which a successful save spends.

**The following roles are required to use this endpoint:** `admin`

#### Request Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `groupId` | String | Required | The group. |
| `issuer` | String | Required | The provider's issuer URL, e.g. https://acme.okta.com. Must be https. |
| `clientId` | String | Required | The client ID of the application registered at the provider. |
| `clientSecret` | String | Optional | The client secret. Required the first time; omit it later to keep the saved one. Stored encrypted and never returned. |
| `enabled` | Boolean | Optional | Whether sign-in through the provider is on. Defaults to true. |

#### Example Request

Request

```json
{
  "groupId": "G1234567",
  "issuer": "https://acme.okta.com",
  "clientId": "0oa1b2c3d4e5f6g7h8i9",
  "clientSecret": "••••••••",
  "enabled": true
}
```

#### Example Response 200

Response

```json
{
  "groupId": "G1234567",
  "available": true,
  "callbackUrl": "https://api.signalhouse.io/auth/oauth/sso/callback",
  "connection": {
    "issuer": "https://acme.okta.com",
    "clientId": "0oa1b2c3d4e5f6g7h8i9",
    "hasClientSecret": true,
    "enabled": true
  },
  "domains": []
}
```

### DELETE /group/sso

Remove the group's identity provider and all its domains, and unlink every account that signed in through it. The accounts themselves are kept. Requires a fresh POST /auth/2fa/confirm-identity from the same session.

**The following roles are required to use this endpoint:** `admin`

#### Request Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `groupId` | Query Param | Required | The group. |

#### Example Response 200

Response

```json
{
  "groupId": "G1234567",
  "available": true,
  "callbackUrl": "https://api.signalhouse.io/auth/oauth/sso/callback",
  "connection": null,
  "domains": []
}
```

### POST /group/sso/domains

Claim an email domain for the group's SSO. The claim does nothing until it is verified; the response includes the TXT record to publish. Refused for public mailbox domains and for a domain another group has already verified.

**The following roles are required to use this endpoint:** `admin`

#### Request Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `groupId` | String | Required | The group. |
| `domain` | String | Required | The domain, e.g. acme.com. |

#### Example Request

Request

```json
{
  "groupId": "G1234567",
  "domain": "acme.com"
}
```

### POST /group/sso/domains/:domain/verify

Verify a claimed domain by looking up its TXT record at \_signalhouse-verification.<domain>. Returns a 400 while the record isn't found (DNS changes can take a while to appear), or when another group verified the domain first.

**The following roles are required to use this endpoint:** `admin`

#### Request Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `domain` | URL Param | Required | The claimed domain. |
| `groupId` | String | Required | The group. |

#### Example Request

Request

```json
{
  "groupId": "G1234567"
}
```

### DELETE /group/sso/domains/:domain

Remove a domain from the group's SSO. People on it stop signing in through the group's identity provider; their accounts are kept.

**The following roles are required to use this endpoint:** `admin`

#### Request Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `domain` | URL Param | Required | The domain. |
| `groupId` | Query Param | Required | The group. |

#### Ontraport

Signal House Admins must first enable `featureFlags.ontraportIntegration` (see `PUT /group/:id` above) for the group - it is opt-in and off by default. Until then, every endpoint below behaves as if no connection exists, and the inbound webhook responds `404` even with a valid, previously-issued token.

A group can connect its own Ontraport account to send SMS from an Ontraport automation and have replies and STOPs written back to the matching Ontraport contact. Connect with `PUT /group/ontraport`, then paste the returned `webhookUrl` into an Ontraport automation's **Send to a Webhook** step. Ontraport itself calling that URL is a separate inbound integration, authenticated by an opaque per-connection token embedded in the URL rather than a Signal House session, and is not documented here.

All four endpoints take the group's `groupId`, are open to the group's `admin` and `developer` users (and Signal House staff), and require signing in directly: an OAuth connector token is rejected with `403`. None of them ever returns the stored API Key or App ID.

### GET /group/ontraport

Get the group's Ontraport connection status: whether it's connected, the webhook URL to paste into an Ontraport automation's Send to a Webhook step, and whether the connection is enabled.

**The following roles are required to use this endpoint:** `admin`, `developer`, `signalhouse_admin`

#### Request Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `groupId` | Query Param | Required | The group. |

#### Example Response 200

Response

```json
{
  "connected": true,
  "webhookUrl": "https://api.signalhouse.io/integrations/ontraport/webhook/aBcDeFgHiJkLmNoPqRsTuVwXyZ012345",
  "enabled": true
}
```

### PUT /group/ontraport

Connect or reconnect the group's own Ontraport account. The API Key and App ID are verified with a read-only call to Ontraport before anything is stored; a bad pair throws rather than saving. Both are encrypted at rest and never returned by any read.

**The following roles are required to use this endpoint:** `admin`, `developer`, `signalhouse_admin`

#### Request Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `groupId` | String | Required | The group. |
| `apiKey` | String | Required | The Ontraport API Key, from Ontraport's own API settings. |
| `appId` | String | Required | The Ontraport App ID, from Ontraport's own API settings. |

#### Example Request

Request

```json
{
  "groupId": "G1234567",
  "apiKey": "••••••••",
  "appId": "••••••••"
}
```

#### Example Response 200

Response

```json
{
  "connected": true,
  "webhookUrl": "https://api.signalhouse.io/integrations/ontraport/webhook/aBcDeFgHiJkLmNoPqRsTuVwXyZ012345",
  "enabled": true
}
```

### DELETE /group/ontraport

Disconnect (disable) the group's Ontraport connection. The webhook stops accepting deliveries immediately, but the stored API Key, App ID, and any linked Ontraport contact ids are kept, so reconnecting resumes cleanly. The primary self-service way to kill a leaked webhook URL.

**The following roles are required to use this endpoint:** `admin`, `developer`, `signalhouse_admin`

#### Request Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `groupId` | Query Param | Required | The group. |

#### Example Response 200

Response

```json
{
  "connected": true,
  "webhookUrl": "https://api.signalhouse.io/integrations/ontraport/webhook/aBcDeFgHiJkLmNoPqRsTuVwXyZ012345",
  "enabled": false
}
```

### PUT /group/ontraport/regenerate-token

Mint a fresh webhook token for an existing connection, immediately invalidating the old URL. A second self-service way to kill a leaked webhook URL, for when sending should keep working but the old URL needs to stop accepting deliveries. Throws if the group has no Ontraport connection yet.

**The following roles are required to use this endpoint:** `admin`, `developer`, `signalhouse_admin`

#### Request Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `groupId` | String | Required | The group. |

#### Example Request

Request

```json
{
  "groupId": "G1234567"
}
```

#### Example Response 200

Response

```json
{
  "connected": true,
  "webhookUrl": "https://api.signalhouse.io/integrations/ontraport/webhook/zYxWvUtSrQpOnMlKjIhGfEdCbA987654",
  "enabled": true
}
```
