# Group Subscribers

Organizing subscribers into different groups enables you to easily send targeted messages to specific segments. With Mobile Text Alerts, you can add, edit, and remove groups and subscribers via the [online dashboard](https://platform.mobile-text-alerts.com/manage-groups) or with the [Mobile Text Alerts API](#manage-groups-with-the-api), making it easy to keep your contact lists updated.

<figure><img src="/files/DFgAogilXPmhw6jWkdiL" alt=""><figcaption><p>Manage Group Members in the online dashboard</p></figcaption></figure>

## Manage Groups with the API

The Mobile Text Alerts API allows you to [create a group](#create-a-new-group), [delete a group](#delete-group), [update an existing group's metadata](#update-groups), or [view all groups](#list-all-groups) for your account.

Note that these actions are used to make changes to the group itself, not the subscribers that may be contained within the group. See [Manage Group Members](#manage-group-members) to see actions for adding/removing subscribers from your groups.

[Click here](/api-reference/groups.md) to view the full API Reference for Groups.

### Create a new Group

A <mark style="color:orange;">`POST`</mark> call to the [`/groups`](#post-groups) endpoint creates a new group. See below for all additional request fields for group metadata.

#### Example request

```bash
curl -L \
  --request POST \
  --url 'https://api.mobile-text-alerts.com/v3/groups' \
  --header 'Authorization: Bearer <APIKey>' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Example"
  }'
```

**Successful response:** `"message": "Created group Example."`

#### Request Fields

<table><thead><tr><th width="166.5">Name</th><th width="164.5">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code> <em>- required</em></td><td><code>string</code></td><td>The name of the group.</td></tr><tr><td><code>hidden</code></td><td><code>boolean</code></td><td>Indicates if the group is hidden.</td></tr><tr><td><code>description</code></td><td><code>string</code></td><td>Description of the group.</td></tr><tr><td><code>displayName</code></td><td><code>string</code></td><td>An alternate display name for this group</td></tr><tr><td><code>sortOrder</code></td><td><code>number</code></td><td>Override default sorting when displaying this group on the subscriber sign up page</td></tr><tr><td><code>isTemporary</code></td><td><code>boolean</code></td><td>When set to true, this group is marked as temporary. Temporary groups are deleted at midnight of the day following their creation.</td></tr><tr><td><code>createdAt</code></td><td><code>string</code></td><td>Timestamp of when the group was created. For example: <code>"2025-05-29T19:04:14.000Z"</code></td></tr><tr><td><code>settings</code></td><td><code>object</code></td><td>This field is only used for<a href="/pages/MM7BsSooWKnTLtzOqSm3"> Adaptive Groups</a>. See <a href="/pages/MM7BsSooWKnTLtzOqSm3#configure-settings-field-for-a-group">Configure <code>settings</code> field for a group</a> to learn more about this field.</td></tr></tbody></table>

## POST /groups

> Create Group

```json
{"openapi":"3.0.0","info":{"title":"Mobile Text Alerts API","version":"8.0.0"},"servers":[{"url":"https://api.mobile-text-alerts.com/v3"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"apiKey"}},"schemas":{"CreateGroup.Response":{"allOf":[{"$ref":"#/components/schemas/IApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/IPublicGroup"}},"required":["data"]}]},"IApiResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"},"message":{"type":"string"},"data":{}},"required":[]},"IPublicGroup":{"allOf":[{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"hidden":{"type":"number"},"welcomeMessage":{"type":"string"},"description":{"type":"string"},"parentWebinarId":{"type":"string"},"displayName":{"type":"string","nullable":true},"sortOrder":{"type":"number","nullable":true},"type":{"$ref":"#/components/schemas/GroupType"},"settings":{"$ref":"#/components/schemas/IGroupSettings"},"isTemporary":{"type":"boolean"},"createdAt":{"oneOf":[{"format":"date-time","type":"string"},{"type":"string"},{"type":"string","nullable":true}]}},"required":["id","name","hidden","welcomeMessage"],"description":"IGroup without accountId, keyword"},{"type":"object","properties":{"memberCount":{"type":"number"}},"required":["memberCount"]}]},"GroupType":{"type":"string","enum":["static","adaptive"]},"IGroupSettings":{"type":"object","properties":{"match":{"type":"string","enum":["AND","OR"]},"conditions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"conditionAttribute":{"type":"string"},"conditionOperator":{"type":"string","enum":["equals","not equals","contains","starts with","ends with","greater than","less than","is empty","is not empty","between","not between","is checked","is not checked","is in","is not in"],"description":"GroupOperator"},"conditionCategory":{"type":"string"},"conditionValue":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]}},"conditionSubOperator":{"type":"string","enum":["equals","not equals","contains","starts with","ends with","greater than","less than","is empty","is not empty","between","not between","is checked","is not checked","is in","is not in"],"description":"GroupOperator"},"conditionSubValue":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]}},"shouldLoadDefaultValue":{"type":"boolean"}},"required":["type","conditionAttribute","conditionOperator","conditionValue"],"description":"IGroupCondition"}}},"required":["match","conditions"]},"CreateGroup.Request":{"$ref":"#/components/schemas/Partial-IGroup"},"Partial-IGroup":{"type":"object","properties":{"id":{"type":"number"},"accountId":{"type":"number"},"name":{"type":"string"},"hidden":{"type":"number"},"keyword":{"type":"string"},"welcomeMessage":{"type":"string"},"description":{"type":"string"},"parentWebinarId":{"type":"string"},"displayName":{"type":"string","nullable":true},"sortOrder":{"type":"number","nullable":true},"type":{"$ref":"#/components/schemas/GroupType"},"settings":{"$ref":"#/components/schemas/IGroupSettings"},"isTemporary":{"type":"boolean"},"createdAt":{"oneOf":[{"format":"date-time","type":"string"},{"type":"string"},{"type":"string","nullable":true}]}}}},"responses":{"BadRequestError":{"description":"BadRequestError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[400]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["bad_request_error"]},"name":{"type":"string","enum":["MTABadRequestError"]},"requestId":{"type":"string","format":"uuid"}}}}}},"UnauthorizedError":{"description":"UnauthorizedError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[401]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["unauthorized_error"]},"name":{"type":"string","enum":["MTAUnauthorizedError"]},"requestId":{"type":"string","format":"uuid"}}}}}},"ForbiddenError":{"description":"ForbiddenError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[403]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["forbidden_error"]},"name":{"type":"string","enum":["MTAForbiddenError"]},"requestId":{"type":"string","format":"uuid"},"reason":{}}}}}},"InternalServerError":{"description":"InternalServerError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[500]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["internal_server_error"]},"name":{"type":"string","enum":["MTAInternalServerError"]},"requestId":{"type":"string","format":"uuid"}}}}}}}},"paths":{"/groups":{"post":{"tags":["Groups"],"summary":"Create Group","operationId":"groups_create_group","responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"description":"The maximum number of requests that the consumer is permitted to make per window","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"The number of requests remaining in the current rate limit window","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"The remaining window before the rate limit resets in milliseconds","schema":{"type":"integer"}},"Retry-After":{"description":"The number of seconds to wait before retrying the request","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The maximum number of requests that the consumer is permitted to make per window","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests remaining in the current rate limit window","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"The remaining window before the rate limit resets in milliseconds","schema":{"type":"integer"}},"X-Request-ID":{"description":"A unique identifier for the request","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGroup.Response"}}}},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"500":{"$ref":"#/components/responses/InternalServerError"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGroup.Request"}}},"required":true}}}}}
```

### Delete Group

Groups can be deleted without needing to supply a request body. Simply include the `{groupId}` of the group to be deleted as a path parameter with your <mark style="color:red;">`DELETE`</mark> request.

#### Example Request

In the example below, we delete `groupId`: `187561`.

```bash
curl --request DELETE --location 'https://api.mobile-text-alerts.com/v3/groups/187561' \
  --header 'Authorization: Bearer <APIKey>'
```

**Successful Response:** `{"message":"Group deleted successfully."}`

## DELETE /groups/{groupId}

> Delete Group

```json
{"openapi":"3.0.0","info":{"title":"Mobile Text Alerts API","version":"8.0.0"},"servers":[{"url":"https://api.mobile-text-alerts.com/v3"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"apiKey"}},"schemas":{"DeleteGroup.Response":{"$ref":"#/components/schemas/IApiResponse"},"IApiResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"},"message":{"type":"string"},"data":{}},"required":[]}},"responses":{"BadRequestError":{"description":"BadRequestError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[400]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["bad_request_error"]},"name":{"type":"string","enum":["MTABadRequestError"]},"requestId":{"type":"string","format":"uuid"}}}}}},"UnauthorizedError":{"description":"UnauthorizedError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[401]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["unauthorized_error"]},"name":{"type":"string","enum":["MTAUnauthorizedError"]},"requestId":{"type":"string","format":"uuid"}}}}}},"ForbiddenError":{"description":"ForbiddenError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[403]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["forbidden_error"]},"name":{"type":"string","enum":["MTAForbiddenError"]},"requestId":{"type":"string","format":"uuid"},"reason":{}}}}}},"InternalServerError":{"description":"InternalServerError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[500]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["internal_server_error"]},"name":{"type":"string","enum":["MTAInternalServerError"]},"requestId":{"type":"string","format":"uuid"}}}}}}}},"paths":{"/groups/{groupId}":{"delete":{"tags":["Groups"],"summary":"Delete Group","operationId":"groups_delete_group","responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"description":"The maximum number of requests that the consumer is permitted to make per window","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"The number of requests remaining in the current rate limit window","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"The remaining window before the rate limit resets in milliseconds","schema":{"type":"integer"}},"Retry-After":{"description":"The number of seconds to wait before retrying the request","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The maximum number of requests that the consumer is permitted to make per window","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests remaining in the current rate limit window","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"The remaining window before the rate limit resets in milliseconds","schema":{"type":"integer"}},"X-Request-ID":{"description":"A unique identifier for the request","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteGroup.Response"}}}},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"500":{"$ref":"#/components/responses/InternalServerError"}},"parameters":[{"name":"groupId","in":"path","required":true,"schema":{"type":"string"}}]}}}}
```

### Update Groups

The fields that contain group metadata can be added or updated at any time by calling the <mark style="color:purple;">`PATCH`</mark> [`/groups/{groupId}`](#patch-groups-groupid) endpoint with the identifying `{groupId}` of the group to be updated. See below for all optional request fields that contain group metadata.

#### Example Request

In the example below, we update `groupId`: `187561`.

```bash
curl -L \
  --request PATCH \
  --url 'https://api.mobile-text-alerts.com/v3/groups/187561' \
  --header 'Authorization: Bearer <APIKey>' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "New Name"
  }'
```

**Successful response:** `"message": "Updated group New Name."`

#### Request Fields

<table><thead><tr><th width="166.5">Name</th><th width="164.5">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code> <em>- required</em></td><td><code>string</code></td><td>The name of the group.</td></tr><tr><td><code>hidden</code></td><td><code>boolean</code></td><td>Indicates if the group is hidden.</td></tr><tr><td><code>description</code></td><td><code>string</code></td><td>Description of the group.</td></tr><tr><td><code>displayName</code></td><td><code>string</code></td><td>An alternate display name for this group</td></tr><tr><td><code>sortOrder</code></td><td><code>number</code></td><td>Override default sorting when displaying this group on the subscriber sign up page</td></tr><tr><td><code>isTemporary</code></td><td><code>boolean</code></td><td>When set to true, this group is marked as temporary. Temporary groups are deleted at midnight of the day following their creation.</td></tr><tr><td><code>createdAt</code></td><td><code>string</code></td><td>Timestamp of when the group was created. For example: <code>"2025-05-29T19:04:14.000Z"</code></td></tr><tr><td><code>settings</code></td><td><code>object</code></td><td>This field is only used for<a href="/pages/MM7BsSooWKnTLtzOqSm3"> Adaptive Groups</a>. See <a href="/pages/MM7BsSooWKnTLtzOqSm3#configure-settings-field-for-a-group">Configure <code>settings</code> field for a group</a> to learn more about this field.</td></tr></tbody></table>

## PATCH /groups/{groupId}

> Update Group

```json
{"openapi":"3.0.0","info":{"title":"Mobile Text Alerts API","version":"8.0.0"},"servers":[{"url":"https://api.mobile-text-alerts.com/v3"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"apiKey"}},"schemas":{"UpdateGroup.Response":{"allOf":[{"$ref":"#/components/schemas/IApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/IPublicGroup"}},"required":["data"]}]},"IApiResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"},"message":{"type":"string"},"data":{}},"required":[]},"IPublicGroup":{"allOf":[{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"hidden":{"type":"number"},"welcomeMessage":{"type":"string"},"description":{"type":"string"},"parentWebinarId":{"type":"string"},"displayName":{"type":"string","nullable":true},"sortOrder":{"type":"number","nullable":true},"type":{"$ref":"#/components/schemas/GroupType"},"settings":{"$ref":"#/components/schemas/IGroupSettings"},"isTemporary":{"type":"boolean"},"createdAt":{"oneOf":[{"format":"date-time","type":"string"},{"type":"string"},{"type":"string","nullable":true}]}},"required":["id","name","hidden","welcomeMessage"],"description":"IGroup without accountId, keyword"},{"type":"object","properties":{"memberCount":{"type":"number"}},"required":["memberCount"]}]},"GroupType":{"type":"string","enum":["static","adaptive"]},"IGroupSettings":{"type":"object","properties":{"match":{"type":"string","enum":["AND","OR"]},"conditions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"conditionAttribute":{"type":"string"},"conditionOperator":{"type":"string","enum":["equals","not equals","contains","starts with","ends with","greater than","less than","is empty","is not empty","between","not between","is checked","is not checked","is in","is not in"],"description":"GroupOperator"},"conditionCategory":{"type":"string"},"conditionValue":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]}},"conditionSubOperator":{"type":"string","enum":["equals","not equals","contains","starts with","ends with","greater than","less than","is empty","is not empty","between","not between","is checked","is not checked","is in","is not in"],"description":"GroupOperator"},"conditionSubValue":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]}},"shouldLoadDefaultValue":{"type":"boolean"}},"required":["type","conditionAttribute","conditionOperator","conditionValue"],"description":"IGroupCondition"}}},"required":["match","conditions"]},"UpdateGroup.Request":{"$ref":"#/components/schemas/Partial-IGroup"},"Partial-IGroup":{"type":"object","properties":{"id":{"type":"number"},"accountId":{"type":"number"},"name":{"type":"string"},"hidden":{"type":"number"},"keyword":{"type":"string"},"welcomeMessage":{"type":"string"},"description":{"type":"string"},"parentWebinarId":{"type":"string"},"displayName":{"type":"string","nullable":true},"sortOrder":{"type":"number","nullable":true},"type":{"$ref":"#/components/schemas/GroupType"},"settings":{"$ref":"#/components/schemas/IGroupSettings"},"isTemporary":{"type":"boolean"},"createdAt":{"oneOf":[{"format":"date-time","type":"string"},{"type":"string"},{"type":"string","nullable":true}]}}}},"responses":{"BadRequestError":{"description":"BadRequestError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[400]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["bad_request_error"]},"name":{"type":"string","enum":["MTABadRequestError"]},"requestId":{"type":"string","format":"uuid"}}}}}},"UnauthorizedError":{"description":"UnauthorizedError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[401]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["unauthorized_error"]},"name":{"type":"string","enum":["MTAUnauthorizedError"]},"requestId":{"type":"string","format":"uuid"}}}}}},"ForbiddenError":{"description":"ForbiddenError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[403]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["forbidden_error"]},"name":{"type":"string","enum":["MTAForbiddenError"]},"requestId":{"type":"string","format":"uuid"},"reason":{}}}}}},"InternalServerError":{"description":"InternalServerError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[500]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["internal_server_error"]},"name":{"type":"string","enum":["MTAInternalServerError"]},"requestId":{"type":"string","format":"uuid"}}}}}}}},"paths":{"/groups/{groupId}":{"patch":{"tags":["Groups"],"summary":"Update Group","operationId":"groups_update_group","responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"description":"The maximum number of requests that the consumer is permitted to make per window","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"The number of requests remaining in the current rate limit window","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"The remaining window before the rate limit resets in milliseconds","schema":{"type":"integer"}},"Retry-After":{"description":"The number of seconds to wait before retrying the request","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The maximum number of requests that the consumer is permitted to make per window","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests remaining in the current rate limit window","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"The remaining window before the rate limit resets in milliseconds","schema":{"type":"integer"}},"X-Request-ID":{"description":"A unique identifier for the request","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGroup.Response"}}}},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"500":{"$ref":"#/components/responses/InternalServerError"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGroup.Request"}}},"required":true},"parameters":[{"name":"groupId","in":"path","required":true,"schema":{"type":"string"}}]}}}}
```

### List All Groups

Call the <mark style="color:green;">`GET`</mark> [`/groups`](#get-groups) endpoint to see the groups on your account.

{% hint style="warning" %}
This endpoint does **not** show [adaptive groups](/tutorials/manage-subscribers/group-subscribers/adaptive-groups.md) by default, see [List Adaptive Groups](/tutorials/manage-subscribers/group-subscribers/adaptive-groups.md#list-adaptive-groups-with-the-api) to learn more.
{% endhint %}

{% hint style="info" %}
This endpoint produces paginated results. You may need to make multiple queries to retrieve every group on your account.
{% endhint %}

Query responses include the following data:

* `page` - the current page of results being shown
* `pageSize` - number of groups shown per page
* `total` - the total number of groups on your account

#### Example Request

```bash
curl --location 'https://api.mobile-text-alerts.com/v3/groups' \
  --header 'Authorization: Bearer <APIKey>'
```

**Successful response:**

```json
{"data":
    {"rows":
    [{"id":187561,
        "name":"Test Group",
        "hidden":0,
        "displayName":null,
        "welcomeMessage":"",
        "sortOrder":null,
        "description":"First group created for testing.",
        "createdAt":"2025-05-29T19:04:14.000Z",
        "memberCount":0,"type":"static"},
    {"id":187572,
        "name":"API-Test",
        "hidden":0,
        "displayName":null,
        "welcomeMessage":"",
        "sortOrder":null,
        "description":null,
        "createdAt":"2025-05-29T14:47:26.000Z",
        "memberCount":0,"type":"static"}],
"page":0,"pageSize":25,"total":2}}
```

## GET /groups

> List Groups

```json
{"openapi":"3.0.0","info":{"title":"Mobile Text Alerts API","version":"8.0.0"},"servers":[{"url":"https://api.mobile-text-alerts.com/v3"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"apiKey"}},"schemas":{"ListGroups.Response":{"allOf":[{"$ref":"#/components/schemas/IApiResponsePaginated"},{"type":"object","properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"$ref":"#/components/schemas/IPublicGroup"}},"page":{"type":"number"},"pageSize":{"type":"number"},"total":{"type":"number"}},"required":["rows","page","pageSize","total"]}},"required":["data"]}]},"IApiResponsePaginated":{"allOf":[{"$ref":"#/components/schemas/IApiResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{}},"page":{"type":"number"},"pageSize":{"type":"number"},"total":{"type":"number"}},"required":["rows","page","pageSize","total"],"description":"PaginationData"}},"required":["data"]}]},"IApiResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"},"message":{"type":"string"},"data":{}},"required":[]},"IPublicGroup":{"allOf":[{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"hidden":{"type":"number"},"welcomeMessage":{"type":"string"},"description":{"type":"string"},"parentWebinarId":{"type":"string"},"displayName":{"type":"string","nullable":true},"sortOrder":{"type":"number","nullable":true},"type":{"$ref":"#/components/schemas/GroupType"},"settings":{"$ref":"#/components/schemas/IGroupSettings"},"isTemporary":{"type":"boolean"},"createdAt":{"oneOf":[{"format":"date-time","type":"string"},{"type":"string"},{"type":"string","nullable":true}]}},"required":["id","name","hidden","welcomeMessage"],"description":"IGroup without accountId, keyword"},{"type":"object","properties":{"memberCount":{"type":"number"}},"required":["memberCount"]}]},"GroupType":{"type":"string","enum":["static","adaptive"]},"IGroupSettings":{"type":"object","properties":{"match":{"type":"string","enum":["AND","OR"]},"conditions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"conditionAttribute":{"type":"string"},"conditionOperator":{"type":"string","enum":["equals","not equals","contains","starts with","ends with","greater than","less than","is empty","is not empty","between","not between","is checked","is not checked","is in","is not in"],"description":"GroupOperator"},"conditionCategory":{"type":"string"},"conditionValue":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]}},"conditionSubOperator":{"type":"string","enum":["equals","not equals","contains","starts with","ends with","greater than","less than","is empty","is not empty","between","not between","is checked","is not checked","is in","is not in"],"description":"GroupOperator"},"conditionSubValue":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]}},"shouldLoadDefaultValue":{"type":"boolean"}},"required":["type","conditionAttribute","conditionOperator","conditionValue"],"description":"IGroupCondition"}}},"required":["match","conditions"]}},"responses":{"BadRequestError":{"description":"BadRequestError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[400]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["bad_request_error"]},"name":{"type":"string","enum":["MTABadRequestError"]},"requestId":{"type":"string","format":"uuid"}}}}}},"UnauthorizedError":{"description":"UnauthorizedError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[401]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["unauthorized_error"]},"name":{"type":"string","enum":["MTAUnauthorizedError"]},"requestId":{"type":"string","format":"uuid"}}}}}},"ForbiddenError":{"description":"ForbiddenError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[403]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["forbidden_error"]},"name":{"type":"string","enum":["MTAForbiddenError"]},"requestId":{"type":"string","format":"uuid"},"reason":{}}}}}},"InternalServerError":{"description":"InternalServerError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[500]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["internal_server_error"]},"name":{"type":"string","enum":["MTAInternalServerError"]},"requestId":{"type":"string","format":"uuid"}}}}}}}},"paths":{"/groups":{"get":{"tags":["Groups"],"summary":"List Groups","operationId":"groups_list_groups","responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"description":"The maximum number of requests that the consumer is permitted to make per window","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"The number of requests remaining in the current rate limit window","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"The remaining window before the rate limit resets in milliseconds","schema":{"type":"integer"}},"Retry-After":{"description":"The number of seconds to wait before retrying the request","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The maximum number of requests that the consumer is permitted to make per window","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests remaining in the current rate limit window","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"The remaining window before the rate limit resets in milliseconds","schema":{"type":"integer"}},"X-Request-ID":{"description":"A unique identifier for the request","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListGroups.Response"}}}},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"500":{"$ref":"#/components/responses/InternalServerError"}},"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"schema":{"type":"number"}},{"name":"sortBy","in":"query","required":false,"schema":{"type":"string"}},{"name":"sortDirection","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc","ASC","DESC"]}},{"name":"order","in":"query","required":false,"schema":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"string","enum":["asc","desc","ASC","DESC"]}]},"minItems":2,"maxItems":2,"description":"The first item in the array must be the first item type and the second must be the second item type."}},{"name":"query","in":"query","required":false,"schema":{"type":"string"}},{"name":"filters","in":"query","required":false,"schema":{"type":"object","properties":{"includeAdaptive":{"type":"boolean"}},"required":[]}}]}}}}
```

## Manage Group Members

Subscribers can be [added](#add-subscriber-to-group) or [deleted](#delete-group-member) from your groups with the API endpoints documented below.

{% hint style="info" %}
If you need to add or delete many group members in a single request, see [Groups Bulk Add/Delete Subscribers](/tutorials/manage-subscribers/group-subscribers/groups-bulk-add-delete-subscribers.md) for bulk endpoints that can accept up to 1,000 records in a single request.
{% endhint %}

### Add Subscriber to Group

To add a subscriber to a group, you need both the `subscriberId` and the `groupId`. The `subscriberId` is passed in the request body, and the `groupId` is specified as a path parameter.

#### Example request:

In the example below, we add `subscriberId`: `108767117` to `groupId`: `187561`.

```bash
curl -X POST --location 'https://api.mobile-text-alerts.com/v3/groups/187561/subscribers' \
  --header 'Authorization: Bearer <APIKey>' \
  --header 'Content-Type: application/json' \
  --data '{"subscriberId":108767117}'
```

**Successful response:** `{"message":"Added subscriber 108767117 to group 187561."}`

{% hint style="info" %}
By default, when adding a subscriber to a group, the `addToDripCampaigns` field is set to `true`. Set this field to `false` if you don't want this subscriber included in drip campaigns.
{% endhint %}

## Add Subscriber to Group

> Required Fields: \`subscriberId\`\
> \
> Note: Field \`addToDripCampaigns\` is \`true\` by default.\
> \
> \
> undefined

```json
{"openapi":"3.0.0","info":{"title":"Mobile Text Alerts API","version":"8.0.0"},"servers":[{"url":"https://api.mobile-text-alerts.com/v3"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"apiKey"}},"schemas":{"CreateGroupMember.Response":{"$ref":"#/components/schemas/IApiResponse"},"IApiResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"},"message":{"type":"string"},"data":{}},"required":[]},"CreateGroupMember.Request":{"type":"object","properties":{"subscriberId":{"type":"number"},"addToDripCampaigns":{"type":"boolean"}},"required":["subscriberId"]}},"responses":{"BadRequestError":{"description":"BadRequestError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[400]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["bad_request_error"]},"name":{"type":"string","enum":["MTABadRequestError"]},"requestId":{"type":"string","format":"uuid"}}}}}},"UnauthorizedError":{"description":"UnauthorizedError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[401]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["unauthorized_error"]},"name":{"type":"string","enum":["MTAUnauthorizedError"]},"requestId":{"type":"string","format":"uuid"}}}}}},"ForbiddenError":{"description":"ForbiddenError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[403]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["forbidden_error"]},"name":{"type":"string","enum":["MTAForbiddenError"]},"requestId":{"type":"string","format":"uuid"},"reason":{}}}}}},"InternalServerError":{"description":"InternalServerError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[500]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["internal_server_error"]},"name":{"type":"string","enum":["MTAInternalServerError"]},"requestId":{"type":"string","format":"uuid"}}}}}}}},"paths":{"/groups/{groupId}/subscribers":{"post":{"tags":["Groups"],"summary":"Add Subscriber to Group","operationId":"groups_create_group_member","responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"description":"The maximum number of requests that the consumer is permitted to make per window","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"The number of requests remaining in the current rate limit window","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"The remaining window before the rate limit resets in milliseconds","schema":{"type":"integer"}},"Retry-After":{"description":"The number of seconds to wait before retrying the request","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The maximum number of requests that the consumer is permitted to make per window","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests remaining in the current rate limit window","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"The remaining window before the rate limit resets in milliseconds","schema":{"type":"integer"}},"X-Request-ID":{"description":"A unique identifier for the request","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGroupMember.Response"}}}},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"500":{"$ref":"#/components/responses/InternalServerError"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGroupMember.Request"}}},"required":true},"parameters":[{"name":"groupId","in":"path","required":true,"schema":{"type":"string"}}],"description":"Required Fields: `subscriberId`\n\nNote: Field `addToDripCampaigns` is `true` by default.\n\n\nundefined"}}}}
```

### Delete Group Member

Subscribers can be removed from a group by identifying them with the `groupId` and `subscriberId` in the path parameters to the <mark style="color:red;">`DELETE`</mark> [`/groups/{groupId}/subscribers/{subscriberId}`](#delete-groups-groupid-subscribers-subscriberid) endpoint.

#### Example request

In the example below, we delete `subscriberId`: `108767117` from `groupId`: `187561`.

```bash
curl --request DELETE --location 'https://api.mobile-text-alerts.com/v3/groups/187561/subscribers/108767117' \
  --header 'Authorization: Bearer <APIKey>'
```

**Successful Response:** `{"message":"Deleted subscriber 108767117 from group 187561."}`

## DELETE /groups/{groupId}/subscribers/{subscriberId}

> Remove Subscriber from Group

```json
{"openapi":"3.0.0","info":{"title":"Mobile Text Alerts API","version":"8.0.0"},"servers":[{"url":"https://api.mobile-text-alerts.com/v3"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"apiKey"}},"schemas":{"DeleteGroupMember.Response":{"$ref":"#/components/schemas/IApiResponse"},"IApiResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"},"message":{"type":"string"},"data":{}},"required":[]}},"responses":{"BadRequestError":{"description":"BadRequestError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[400]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["bad_request_error"]},"name":{"type":"string","enum":["MTABadRequestError"]},"requestId":{"type":"string","format":"uuid"}}}}}},"UnauthorizedError":{"description":"UnauthorizedError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[401]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["unauthorized_error"]},"name":{"type":"string","enum":["MTAUnauthorizedError"]},"requestId":{"type":"string","format":"uuid"}}}}}},"ForbiddenError":{"description":"ForbiddenError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[403]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["forbidden_error"]},"name":{"type":"string","enum":["MTAForbiddenError"]},"requestId":{"type":"string","format":"uuid"},"reason":{}}}}}},"InternalServerError":{"description":"InternalServerError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[500]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["internal_server_error"]},"name":{"type":"string","enum":["MTAInternalServerError"]},"requestId":{"type":"string","format":"uuid"}}}}}}}},"paths":{"/groups/{groupId}/subscribers/{subscriberId}":{"delete":{"tags":["Groups"],"summary":"Remove Subscriber from Group","operationId":"groups_delete_group_member","responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"description":"The maximum number of requests that the consumer is permitted to make per window","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"The number of requests remaining in the current rate limit window","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"The remaining window before the rate limit resets in milliseconds","schema":{"type":"integer"}},"Retry-After":{"description":"The number of seconds to wait before retrying the request","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The maximum number of requests that the consumer is permitted to make per window","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests remaining in the current rate limit window","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"The remaining window before the rate limit resets in milliseconds","schema":{"type":"integer"}},"X-Request-ID":{"description":"A unique identifier for the request","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteGroupMember.Response"}}}},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"500":{"$ref":"#/components/responses/InternalServerError"}},"parameters":[{"name":"groupId","in":"path","required":true,"schema":{"type":"string"}},{"name":"subscriberId","in":"path","required":true,"schema":{"type":"string"}}]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.mobile-text-alerts.com/tutorials/manage-subscribers/group-subscribers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
