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. This 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 is not 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 UserProperties cannot 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 CustomProperties in batched events:

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



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 is not successful, the body contains an error code and error message.



Authorization: SharedAccessSignature  
Content-Type: application/  


HTTP/1.1 201 Created  
Server: Microsoft-HTTPAPI/2.0  
Date: Tue, 23 Feb 2016 03:22:27 GMT  
Content-Length: 0