# Azure Web PubSub Service REST API API

> Azure Web PubSub Service REST API API on Apizie: 20 endpoints (Add filtered connections to multiple groups., Close the connections in the hub., Generate token for the client to connect Azure Web PubSub service., Remove filtered connections from multiple groups., …) returned as clean JSON through one API key. Send your own provider key in the x-upstream-key header. Call it over REST at https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/{endpoint} or from Claude, ChatGPT and Cursor through the Apizie MCP server. Free plan: 1,000 requests a month.

- Project key: `cloud:azure-webpubsub-web-pub-sub`
- Category: Cloud
- Status: byok
- Source: https://learn.microsoft.com/rest/api/azure/
- Page: https://zieapi.vercel.app/api/cloud/azure-webpubsub-web-pub-sub
- OpenAPI: https://zieapi.vercel.app/api/cloud/azure-webpubsub-web-pub-sub/openapi.json

WebPubSubServiceClient

## Endpoints

### Add filtered connections to multiple groups.
`POST https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/add-connections-to-groups` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | yes | HTTP or HTTPS endpoint for the Web PubSub service instance |
| api-version | string | no | The API version to use for this operation. |
| hub | string | yes | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. |
| body | object | yes | JSON request body |

### Close the connections in the hub.
`POST https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/close-all-connections` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | yes | HTTP or HTTPS endpoint for the Web PubSub service instance |
| api-version | string | no | The API version to use for this operation. |
| hub | string | yes | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. |
| excluded | array | no | Exclude these connectionIds when closing the connections in the hub. |
| reason | string | no | The reason closing the client connection. |

### Generate token for the client to connect Azure Web PubSub service.
`POST https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/generate-client-token` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | yes | HTTP or HTTPS endpoint for the Web PubSub service instance |
| api-version | string | no | The API version to use for this operation. |
| hub | string | yes | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. |
| userId | string | no | User Id. |
| role | array | no | Roles that the connection with the generated token will have. |
| minutesToExpire | integer | no | The expire time of the generated token. |
| group | array | no | Groups that the connection will join when it connects. |
| clientType | string | no | The type of client. Case-insensitive. If not set, it's "Default". For Web PubSub for Socket.IO, only the default value is supported. For… |

### Remove filtered connections from multiple groups.
`POST https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/remove-connections-from-groups` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | yes | HTTP or HTTPS endpoint for the Web PubSub service instance |
| api-version | string | no | The API version to use for this operation. |
| hub | string | yes | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. |
| body | object | yes | JSON request body |

### Broadcast content inside request body to all the connected client connections.
`POST https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/send-to-all` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | yes | HTTP or HTTPS endpoint for the Web PubSub service instance |
| api-version | string | no | The API version to use for this operation. |
| hub | string | yes | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. |
| excluded | array | no | Excluded connection Ids. |
| filter | string | no | Following OData filter syntax to filter out the subscribers receiving the messages. |
| messageTtlSeconds | integer | no | The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires.… |
| body | object | yes | JSON request body |

### Close the client connection.
`POST https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/close-connection` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | yes | HTTP or HTTPS endpoint for the Web PubSub service instance |
| api-version | string | no | The API version to use for this operation. |
| hub | string | yes | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. |
| connectionId | string | yes | Target connection Id. |
| reason | string | no | The reason closing the client connection. |

### Send content inside request body to the specific connection.
`POST https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/send-to-connection` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | yes | HTTP or HTTPS endpoint for the Web PubSub service instance |
| api-version | string | no | The API version to use for this operation. |
| hub | string | yes | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. |
| connectionId | string | yes | The connection Id. |
| messageTtlSeconds | integer | no | The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires.… |
| body | object | yes | JSON request body |

### Remove a connection from all groups.
`POST https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/remove-connection-from-all-groups` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | yes | HTTP or HTTPS endpoint for the Web PubSub service instance |
| api-version | string | no | The API version to use for this operation. |
| hub | string | yes | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. |
| connectionId | string | yes | Target connection Id. |

### Close connections in the specific group.
`POST https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/close-group-connections` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | yes | HTTP or HTTPS endpoint for the Web PubSub service instance |
| api-version | string | no | The API version to use for this operation. |
| hub | string | yes | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. |
| group | string | yes | Target group name, which length should be greater than 0 and less than 1025. |
| excluded | array | no | Exclude these connectionIds when closing the connections in the group. |
| reason | string | no | The reason closing the client connection. |

### Send content inside request body to a group of connections.
`POST https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/send-to-group` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | yes | HTTP or HTTPS endpoint for the Web PubSub service instance |
| api-version | string | no | The API version to use for this operation. |
| hub | string | yes | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. |
| group | string | yes | Target group name, which length should be greater than 0 and less than 1025. |
| excluded | array | no | Excluded connection Ids |
| filter | string | no | Following OData filter syntax to filter out the subscribers receiving the messages. |
| messageTtlSeconds | integer | no | The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires.… |
| body | object | yes | JSON request body |

### List connections in a group.
`GET https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/list-connections-in-group` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | yes | HTTP or HTTPS endpoint for the Web PubSub service instance |
| api-version | string | no | The API version to use for this operation. |
| hub | string | yes | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. |
| group | string | yes | Target group name, whose length should be greater than 0 and less than 1025. |
| maxpagesize | integer | no | The maximum number of connections to include in a single response. It should be between 1 and 200. |
| top | integer | no | The maximum number of connections to return. If the value is not set, then all the connections in a group are returned. |
| continuationToken | string | no | A token that allows the client to retrieve the next page of results. This parameter is provided by the service in the response of a… |

### Add a connection to the target group.
`POST https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/add-connection-to-group` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | yes | HTTP or HTTPS endpoint for the Web PubSub service instance |
| api-version | string | no | The API version to use for this operation. |
| hub | string | yes | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. |
| group | string | yes | Target group name, which length should be greater than 0 and less than 1025. |
| connectionId | string | yes | Target connection Id |

### Remove a connection from the target group.
`POST https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/remove-connection-from-group` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | yes | HTTP or HTTPS endpoint for the Web PubSub service instance |
| api-version | string | no | The API version to use for this operation. |
| hub | string | yes | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. |
| group | string | yes | Target group name, which length should be greater than 0 and less than 1025. |
| connectionId | string | yes | Target connection Id. |

### Grant permission to the connection.
`POST https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/grant-permission` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | yes | HTTP or HTTPS endpoint for the Web PubSub service instance |
| api-version | string | no | The API version to use for this operation. |
| hub | string | yes | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. |
| permission | string | yes | The permission: current supported actions are joinLeaveGroup and sendToGroup. |
| connectionId | string | yes | Target connection Id. |
| targetName | string | no | The meaning of the target depends on the specific permission. For joinLeaveGroup and sendToGroup, targetName is a required parameter… |

### Revoke permission for the connection.
`POST https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/revoke-permission` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | yes | HTTP or HTTPS endpoint for the Web PubSub service instance |
| api-version | string | no | The API version to use for this operation. |
| hub | string | yes | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. |
| permission | string | yes | The permission: current supported actions are joinLeaveGroup and sendToGroup. |
| connectionId | string | yes | Target connection Id. |
| targetName | string | no | The meaning of the target depends on the specific permission. For joinLeaveGroup and sendToGroup, targetName is a required parameter… |

### Close connections for the specific user.
`POST https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/close-user-connections` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | yes | HTTP or HTTPS endpoint for the Web PubSub service instance |
| api-version | string | no | The API version to use for this operation. |
| hub | string | yes | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. |
| userId | string | yes | The user Id. |
| excluded | array | no | Exclude these connectionIds when closing the connections for the user. |
| reason | string | no | The reason closing the client connection. |

### Send content inside request body to the specific user.
`POST https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/send-to-user` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | yes | HTTP or HTTPS endpoint for the Web PubSub service instance |
| api-version | string | no | The API version to use for this operation. |
| hub | string | yes | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. |
| userId | string | yes | The user Id. |
| filter | string | no | Following OData filter syntax to filter out the subscribers receiving the messages. |
| messageTtlSeconds | integer | no | The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires.… |
| body | object | yes | JSON request body |

### Remove a user from all groups.
`POST https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/remove-user-from-all-groups` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | yes | HTTP or HTTPS endpoint for the Web PubSub service instance |
| api-version | string | no | The API version to use for this operation. |
| hub | string | yes | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. |
| userId | string | yes | Target user Id. |

### Add a user to the target group.
`POST https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/add-user-to-group` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | yes | HTTP or HTTPS endpoint for the Web PubSub service instance |
| api-version | string | no | The API version to use for this operation. |
| hub | string | yes | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. |
| group | string | yes | Target group name, which length should be greater than 0 and less than 1025. |
| userId | string | yes | Target user Id. |

### Remove a user from the target group.
`POST https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/remove-user-from-group` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | yes | HTTP or HTTPS endpoint for the Web PubSub service instance |
| api-version | string | no | The API version to use for this operation. |
| hub | string | yes | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. |
| group | string | yes | Target group name, which length should be greater than 0 and less than 1025. |
| userId | string | yes | Target user Id. |

## Example
```
curl "https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/add-connections-to-groups" \
  -H "x-api-key: $APIZIE_KEY" \
  -H "x-upstream-key: $PROVIDER_KEY"
```

## FAQ

### How do I call the Azure Web PubSub Service REST API API?
Create a free Apizie key, then send POST https://zieapi.vercel.app/v1/cloud:azure-webpubsub-web-pub-sub/add-connections-to-groups with the header x-api-key. Every endpoint returns { project, data, timestamp }.

### Is the Azure Web PubSub Service REST API API free on Apizie?
Yes. The Free plan includes 1,000 requests a month at 100 requests a minute, no credit card. Azure Web PubSub Service REST API itself also needs your own key from azure.com.

### Can AI agents use the Azure Web PubSub Service REST API API?
Yes. Add the Apizie MCP server (https://zieapi.vercel.app/mcp) to Claude, ChatGPT, Cursor or VS Code, then ask in plain language. The agent calls run_scraper with project key cloud:azure-webpubsub-web-pub-sub.

### What is the status of the Azure Web PubSub Service REST API API?
Needs your own provider key (bring your own key)
