---
title: "Add filtered connections to multiple groups."
method: POST
path: "/api/hubs/{hub}/:addToGroups"
tags: ["webpubsub"]
---

# Add filtered connections to multiple groups.

`POST /api/hubs/{hub}/:addToGroups`

Add filtered connections to multiple groups.

## Path parameters

- `hub` string, required

## Query parameters

- `api-version` string, required

## Request body

- AddToGroupsRequest — Request object to add connections to groups
  - `groups` string[], required — Target groups
  - `filter` string — Following OData filter syntax to filter out the subscribers receiving the messages

## Response `200`

The request has succeeded.

## Other responses

- `default` — The error response.

---

[API](https://skmtc.net/azure/apis/webpubsub-webpubsub.md) · [All operations](https://skmtc.net/azure/apis/webpubsub-webpubsub/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/webpubsub-webpubsub/versions/3c12a9fc6305/schema)
