Send batch events

Sends a new batched message event to an Event Hub. Batching reduces the number of messages that are transmitted by merging information from multiple messages into a single batch of messages. It reduces the number of connections established, and reduces network bandwidth by reducing the number of packet headers that are sent over the network.

Sending a batch of messages isn't that different from sending a single event to an Event Hub. To enable sending batch events to an Event Hub using the REST API, the following requirements must be met:

  1. Implement the logic to create batched messages.

  2. The message body must be a valid JSON payload and follow a convention to describe each message.

  3. Set the Content-Type header to application/


Method Request URI
POST https://{servicebusNamespace}{eventHubPath}/messages

Request Headers

See Common parameters and headers for headers and parameters that are used by all requests related to Event Hubs.

Additional Request Headers

Request Header Required or Optional Description
Content-Type Required Set to application/

Request Body

JSON payload that contains the content of multiple messages. For example:


The BrokerProperties and UserPropertiesproperties can't be set in headers when sending batch events (they will be ignored). Instead, send them as part of the request body. For example, setting BrokerProperties in batched events:

[{"Body":"Message1", "BrokerProperties":{"CorrelationId","32119834-65f3-48c1-b366-619df2e4c400"}},{"Body":"Message2"},{"Body":"Message3"}]  

Setting UserProperties in batched events:

[{"Body":"Message1", "UserProperties":{"Alert":"Strong Wind"}}, {"Body":"Message2"}, {"Body":"Message3"}]  


The response includes an HTTP status code, a set of response headers, and a response body.

Response Codes

Code Description
201 Success.
401 Authorization failure.
500 Internal error.

Response Body

If the request is successful, the response body is empty. If the request isn't successful, the body contains an error code and error message.




You can also use an Azure Active Directory token for the Authorization header as noted in the Common parameters and headers. For example: Authorization: Bearer <Azure AD token>.

Authorization: SharedAccessSignature  
Content-Type: application/  
[{"Body":"Message1", "UserProperties":{"Alert":"Strong Wind"}},{"Body":"Message2"},{"Body":"Message3"}]  


HTTP/1.1 201 Created  
Content-Type: application/xml; charset=utf-8  
Server: Microsoft-HTTPAPI/2.0  
Date: Tue, 23 Feb 2016 03:22:27 GMT  
Content-Length: 0