Azure SignalR Service data plane REST API - 2024-12-01

Version: 2024-12-01

Available APIs

API Path
get /api/auth/accessKey GET /api/auth/accessKey
Get service health status. HEAD /api/health
Close all of the connections in the hub. POST /api/hubs/{hub}/:closeConnections
Execute commands in transaction for all of connections. POST /api/hubs/{hub}/:execute
Generate token for the client to connect Azure SignalR service. POST /api/hubs/{hub}/:generateToken
Broadcast a message to all clients connected to target hub. POST /api/hubs/{hub}/:send
Close the client connection DELETE /api/hubs/{hub}/connections/{connectionId}
Check if the connection with the given connection ID exists HEAD /api/hubs/{hub}/connections/{connectionId}
Invoke a method on a connection. POST /api/hubs/{hub}/connections/{connectionId}/:invoke
Send message to the specific connection. POST /api/hubs/{hub}/connections/{connectionId}/:send
Remove a connection from all groups DELETE /api/hubs/{hub}/connections/{connectionId}/groups
Complete a streaming for the specific connection. POST /api/hubs/{hub}/connections/{connectionId}/streams/{streamId}/:complete
Send stream message to the specific stream for the connection. POST /api/hubs/{hub}/connections/{connectionId}/streams/{streamId}/:send
Check if there are any client connections inside the given group HEAD /api/hubs/{hub}/groups/{group}
Close connections in the specific group. POST /api/hubs/{hub}/groups/{group}/:closeConnections
Broadcast a message to all clients within the target group. POST /api/hubs/{hub}/groups/{group}/:send
List connections in a group. GET /api/hubs/{hub}/groups/{group}/connections
Remove a connection from the target group. DELETE /api/hubs/{hub}/groups/{group}/connections/{connectionId}
Add a connection to the target group. PUT /api/hubs/{hub}/groups/{group}/connections/{connectionId}
Check if there are any client connections connected for the given user HEAD /api/hubs/{hub}/users/{user}
Close connections for the specific user. POST /api/hubs/{hub}/users/{user}/:closeConnections
Broadcast a message to all clients belong to the target user. POST /api/hubs/{hub}/users/{user}/:send
Remove a user from all groups. DELETE /api/hubs/{hub}/users/{user}/groups
Remove a user from the target group. DELETE /api/hubs/{hub}/users/{user}/groups/{group}
Check whether a user exists in the target group. HEAD /api/hubs/{hub}/users/{user}/groups/{group}
Add a user to the target group. PUT /api/hubs/{hub}/users/{user}/groups/{group}

/api/auth/accessKey

GET

get /api/auth/accessKey

GET /api/auth/accessKey

Parameters
Name Located in Description Required Schema
api-version query The version of the REST APIs. Yes string
Responses
Code Description Schema
200 OK AccessKeyResponse
default Error response

/api/health

Summary

Get service health status.

Get service health status

HEAD /api/health

Parameters
Name Located in Description Required Schema
api-version query The version of the REST APIs. Yes string
Responses
Code Description
200 The service is healthy
default Error response

/api/hubs/{hub}/:closeConnections

POST

Summary

Close all of the connections in the hub.

Close all of the connections in the hub

POST /api/hubs/{hub}/:closeConnections

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
excluded query Exclude these connection IDs when closing the connections in the hub. No [ string ]
reason query The reason closing the client connections. No string
api-version query The version of the REST APIs. Yes string
Responses
Code Description Schema
204 No Content
default Error response ErrorDetail

/api/hubs/{hub}/:execute

POST

Summary

Execute commands in transaction for all of connections.

Execute commands in transaction for all of connections

POST /api/hubs/{hub}/:execute

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
filter query Following OData filter syntax to filter out the subscribers. No string
api-version query The version of the REST APIs. Yes string
commands body Commands to execute in transaction. Yes [ SignalRCommand ]
Responses
Code Description Schema
202 Accepted
default Error response ErrorDetail

/api/hubs/{hub}/:generateToken

POST

Summary

Generate token for the client to connect Azure SignalR service.

Generate token for the client to connect Azure SignalR service

POST /api/hubs/{hub}/:generateToken

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
userId query User ID. No string
minutesToExpire query The expire time of the generated token. No integer
api-version query The version of the REST APIs. Yes string
Responses
Code Description Schema
200 OK ClientTokenResponse
default Error response ErrorDetail

/api/hubs/{hub}/:send

POST

Summary

Broadcast a message to all clients connected to target hub.

Broadcast a message to all clients connected to target hub

POST /api/hubs/{hub}/:send

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
excluded query Excluded connection IDs No [ string ]
api-version query The version of the REST APIs. Yes string
payload body The payload message. Yes PayloadMessage
Responses
Code Description Schema
202 Accepted ServiceResponse
default Error response ErrorDetail

/api/hubs/{hub}/connections/{connectionId}

DELETE

Summary

Close the client connection

Close the client connection

DELETE /api/hubs/{hub}/connections/{connectionId}

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
connectionId path The connection ID. Yes string
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
reason query The reason of the connection close. No string
api-version query The version of the REST APIs. Yes string
Responses
Code Description Schema
200 OK ServiceResponse
default Error response ErrorDetail

HEAD

Summary

Check if the connection with the given connection ID exists

Check if the connection with the given connection ID exists

HEAD /api/hubs/{hub}/connections/{connectionId}

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
connectionId path The connection ID. Yes string
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
api-version query The version of the REST APIs. Yes string
Responses
Code Description
200 OK
default Error response

/api/hubs/{hub}/connections/{connectionId}/:invoke

POST

Summary

Invoke a method on a connection.

Invoke a method on a connection

POST /api/hubs/{hub}/connections/{connectionId}/:invoke

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
connectionId path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
api-version query The version of the REST APIs. Yes string
payload body The payload message. Yes PayloadMessage
Responses
Code Description Schema
200 OK ClientInvocationResponse
default Error response ErrorDetail

/api/hubs/{hub}/connections/{connectionId}/:send

POST

Summary

Send message to the specific connection.

Send message to the specific connection

POST /api/hubs/{hub}/connections/{connectionId}/:send

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
connectionId path The connection ID. Yes string
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
api-version query The version of the REST APIs. Yes string
payload body The payload message. Yes PayloadMessage
Responses
Code Description Schema
202 Accepted ServiceResponse
default Error response ErrorDetail

/api/hubs/{hub}/connections/{connectionId}/groups

DELETE

Summary

Remove a connection from all groups

Remove a connection from all groups

DELETE /api/hubs/{hub}/connections/{connectionId}/groups

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
connectionId path Target connection ID Yes string
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
api-version query The version of the REST APIs. Yes string
Responses
Code Description Schema
200 OK ServiceResponse
default Error response ErrorDetail

/api/hubs/{hub}/connections/{connectionId}/streams/{streamId}/:complete

POST

Summary

Complete a streaming for the specific connection.

Complete a streaming for the specific connection

POST /api/hubs/{hub}/connections/{connectionId}/streams/{streamId}/:complete

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
connectionId path The connection ID. Yes string
streamId path The stream ID. Yes string
reason query An error for completion. No string
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
api-version query The version of the REST APIs. Yes string
Responses
Code Description Schema
202 Accepted ServiceResponse
default Error response ErrorDetail

/api/hubs/{hub}/connections/{connectionId}/streams/{streamId}/:send

POST

Summary

Send stream message to the specific stream for the connection.

Send stream message to the specific stream for the connection

POST /api/hubs/{hub}/connections/{connectionId}/streams/{streamId}/:send

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
connectionId path The connection ID. Yes string
streamId path The stream ID. Yes string
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
completed query Indicated current item is the last item of the stream. No boolean
api-version query The version of the REST APIs. Yes string
Responses
Code Description Schema
202 Accepted ServiceResponse
default Error response ErrorDetail

/api/hubs/{hub}/groups/{group}

HEAD

Summary

Check if there are any client connections inside the given group

Check if there are any client connections inside the given group

HEAD /api/hubs/{hub}/groups/{group}

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
group path Target group name, which length should be greater than 0 and less than 1025. Yes string
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
api-version query The version of the REST APIs. Yes string
Responses
Code Description
200 OK
404 Not Found
default Error response

/api/hubs/{hub}/groups/{group}/:closeConnections

POST

Summary

Close connections in the specific group.

Close connections in the specific group

POST /api/hubs/{hub}/groups/{group}/:closeConnections

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
group path Target group name, which length should be greater than 0 and less than 1025. Yes string
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
excluded query Exclude these connection IDs when closing the connections in the hub. No [ string ]
reason query The reason closing the client connections. No string
api-version query The version of the REST APIs. Yes string
Responses
Code Description Schema
204 No Content
default Error response ErrorDetail

/api/hubs/{hub}/groups/{group}/:send

POST

Summary

Broadcast a message to all clients within the target group.

Broadcast a message to all clients within the target group

POST /api/hubs/{hub}/groups/{group}/:send

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
group path Target group name, which length should be greater than 0 and less than 1025. Yes string
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
excluded query Excluded connection IDs No [ string ]
api-version query The version of the REST APIs. Yes string
payload body The payload message. Yes PayloadMessage
Responses
Code Description Schema
202 Accepted ServiceResponse
default Error response ErrorDetail

/api/hubs/{hub}/groups/{group}/connections

GET

Summary

List connections in a group.

List connections in a group

GET /api/hubs/{hub}/groups/{group}/connections

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
group path Target group name, whose length should be greater than 0 and less than 1025. Yes string
maxpagesize query The maximum number of connections to include in a single response. It should be between 1 and 200. No integer
top query The maximum number of connections to return. If the value is not set, then all the connections in a group are returned. No integer
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
continuationToken query 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 previous request when there are additional results to be fetched. Clients should include the continuationToken in the next request to receive the subsequent page of data. If this parameter is omitted, the server will return the first page of results. No string
api-version query The version of the REST APIs. Yes string
Responses
Code Description Schema
200 OK GroupMemberPagedValues
default Error response ErrorDetail

/api/hubs/{hub}/groups/{group}/connections/{connectionId}

DELETE

Summary

Remove a connection from the target group.

Remove a connection from the target group

DELETE /api/hubs/{hub}/groups/{group}/connections/{connectionId}

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
group path Target group name, which length should be greater than 0 and less than 1025. Yes string
connectionId path Target connection ID Yes string
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
api-version query The version of the REST APIs. Yes string
Responses
Code Description Schema
200 OK ServiceResponse
default Error response ErrorDetail

PUT

Summary

Add a connection to the target group.

Add a connection to the target group

PUT /api/hubs/{hub}/groups/{group}/connections/{connectionId}

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
group path Target group name, which length should be greater than 0 and less than 1025. Yes string
connectionId path Target connection ID Yes string
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
api-version query The version of the REST APIs. Yes string
Responses
Code Description Schema
200 OK ServiceResponse
404 Not Found
default Error response ErrorDetail

/api/hubs/{hub}/users/{user}

HEAD

Summary

Check if there are any client connections connected for the given user

Check if there are any client connections connected for the given user

HEAD /api/hubs/{hub}/users/{user}

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
user path The user ID. Yes string
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
api-version query The version of the REST APIs. Yes string
Responses
Code Description
200 OK
404 Not Found
default Error response

/api/hubs/{hub}/users/{user}/:closeConnections

POST

Summary

Close connections for the specific user.

Close connections for the specific user

POST /api/hubs/{hub}/users/{user}/:closeConnections

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
user path The user ID. Yes string
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
excluded query Exclude these connection IDs when closing the connections in the hub. No [ string ]
reason query The reason closing the client connections. No string
api-version query The version of the REST APIs. Yes string
Responses
Code Description Schema
204 No Content
default Error response ErrorDetail

/api/hubs/{hub}/users/{user}/:send

POST

Summary

Broadcast a message to all clients belong to the target user.

Broadcast a message to all clients belong to the target user

POST /api/hubs/{hub}/users/{user}/:send

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
user path The user ID. Yes string
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
api-version query The version of the REST APIs. Yes string
payload body The payload message. Yes PayloadMessage
Responses
Code Description Schema
202 Accepted ServiceResponse
default Error response ErrorDetail

/api/hubs/{hub}/users/{user}/groups

DELETE

Summary

Remove a user from all groups.

Remove a user from all groups

DELETE /api/hubs/{hub}/users/{user}/groups

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
user path Target user ID Yes string
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
api-version query The version of the REST APIs. Yes string
Responses
Code Description Schema
204 No Content
default Error response ErrorDetail

/api/hubs/{hub}/users/{user}/groups/{group}

DELETE

Summary

Remove a user from the target group.

Remove a user from the target group

DELETE /api/hubs/{hub}/users/{user}/groups/{group}

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
group path Target group name, which length should be greater than 0 and less than 1025. Yes string
user path Target user ID Yes string
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
api-version query The version of the REST APIs. Yes string
Responses
Code Description Schema
204 No Content
default Error response ErrorDetail

HEAD

Summary

Check whether a user exists in the target group.

Check whether a user exists in the target group

HEAD /api/hubs/{hub}/users/{user}/groups/{group}

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
group path Target group name, which length should be greater than 0 and less than 1025. Yes string
user path Target user ID Yes string
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
api-version query The version of the REST APIs. Yes string
Responses
Code Description
200 OK
404 Not Found
default Error response

PUT

Summary

Add a user to the target group.

Add a user to the target group

PUT /api/hubs/{hub}/users/{user}/groups/{group}

Parameters
Name Located in Description Required Schema
hub path Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Yes string
group path Target group name, which length should be greater than 0 and less than 1025. Yes string
user path Target user ID Yes string
application query Target application name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. No string
ttl query Specifies the seconds that the user exists in the group. If not set, the user lives in the group for 1 year at most. If a user is added to some groups without ttl limitation, only the latest updated 100 groups will be reserved among all groups the user joined without TTL. If ttl = 0, only the current connected connections of the target user will be added to the target group. No integer
api-version query The version of the REST APIs. Yes string
Responses
Code Description Schema
200 OK ServiceResponse
default Error response ErrorDetail

Models

AccessKeyResponse

The response object containing the dynamic access key for signing client tokens.

Name Type Description Required
AccessKey string The string value of the access key for SignalR app server to sign client tokens. No
KeyId string The ID of the access key. No

ByteReadOnlyMemoryIAsyncEnumerable

Name Type Description Required
ByteReadOnlyMemoryIAsyncEnumerable object

ClientInvocationResponse

The response object for client invocation rest API

Name Type Description Required
result The result of the invocation returned from the client (optional) No
protocol string The protocol used by the client (optional, available if not json or mspack) No

ClientTokenResponse

The response object containing the token for the client

Name Type Description Required
token string The token value for the WebSocket client to connect to the service No

CloseConnection

Name Type Description Required
CloseConnection

ErrorDetail

The error object.

Name Type Description Required
code string One of a server-defined set of error codes. No
message string A human-readable representation of the error. No
target string The target of the error. No
details [ ErrorDetail ] An array of details about specific errors that led to this reported error. No
inner InnerError No

GroupMember

Name Type Description Required
connectionId string A unique identifier of a connection.
Example: "connection1"
Yes
userId string The user ID of the connection. A user can have multiple connections.
Example: "user1"
No

GroupMemberPagedValues

Represents a page of elements as a LIST REST API result.

Name Type Description Required
value [ GroupMember ] Yes
nextLink string (uri) An absolute URL that the client can GET in order to retrieve the next page of the collection. No

InnerError

Name Type Description Required
code string A more specific error code than was provided by the containing error. No
inner InnerError No

JoinGroup

Name Type Description Required
JoinGroup

LeaveGroup

Name Type Description Required
LeaveGroup

PayloadMessage

Name Type Description Required
target string Yes
arguments [ ] No

SendMessage

Name Type Description Required
SendMessage

ServiceResponse

Name Type Description Required
statusCode integer Enum: 100, 101, 102, 103, 200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304, 305, 306, 307, 308, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 421, 422, 423, 424, 426, 428, 429, 431, 451, 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, 511 No
code string No
level string Enum: "Info", "Warning", "Error" No
scope string Enum: "Unknown", "Request", "Connection", "User", "Group" No
errorKind string Enum: "Unknown", "NotExisted", "NotInGroup", "Invalid" No
message string No
jsonObject No
isSuccess boolean No
stream ByteReadOnlyMemoryIAsyncEnumerable No

SignalRCommand

Name Type Description Required
type string Enum: "SendMessage", "JoinGroup", "LeaveGroup", "CloseConnection" Yes