Webhook v1
What is a Webhook
Put simply it’s a message sent to a URL whenever something happens.
Webhooks are a common communication mechanism used in many event-based systems. Inside Benzinga systems, an event is triggered when a piece of news is published or updated. For clients this means you can choose to have event data delivered from Benzinga to your system as soon as it happens inside our systems. This allows you to structure your system in a way that allows it to react to Benzinga Events without maintaining a connection or checking for updates.
Webhook Usage Examples
- News events sent to Discord Server.
- Benzinga Why Is It Moving (WIIM) published triggers AWS Lambda workflow.
- Benzinga news published triggers Zapier Zap.
- Press Release triggers machine-learning assisted trading bot.
REST API vs. Websocket Streaming vs Webhook
We offer pull-based REST APIs, streaming Websocket, and push-based Webhook delivery mechanisms.
The REST API is suitable for many use cases, but has the disadvantage of being subject to rate-limits and other complexity often found with REST APIs.
The Websocket offers an always-on connection that provides data real-time as soon as it becomes available in our system. Webhooks offer the same realtime delivery, but the connection is not maintained between deliveries. In most cases this means < 50ms of added latency which should be acceptable in most cases with the advantage of not needing to maintain an always-on connection and allowing clients to easily build event-driven systems.
Documentation
Example Webhook Receiver Code:
System Requirements
- Must accept
POST
requests on URL provided to Benzinga. - Must respond to Benzinga Webhook with HTTP status code
200-OK
,201-Created
,202-Accepted
or204-NoContent
. Any other will result in redelivery. - Re-delivery attempts will happen using exponential backoff starting from
500 ms
for up to5 minutes
at which point the system will retry every5 minutes
to resume deliveries. Please provide an email address to notification of issues. - Events undeliverable for more than 24 hours will expire (or based on client agreement).
- Must handle incoming webhook within
30 seconds
; payloads taking more than this time to deliver will timeout. If your system takes longer than this to process incoming deliveries you will need to store the payload and respond with a success status code to continue processing. - Must NOT send response body on success.
- Must NOT send response greater than 5 KiB on error response.
System Notes
- Benzinga will immediately cease deliveries and will not attempt redelivery if any status code in the range of
401-403
is received. - News events can sometimes happen in burst, the system will respect
429
rate limit status codes, but receivers should be capable of processing several events per second in peak periods dependending on content selections.
Delivery Details
HTTP POST
Can be delivered to any valid URL provided to Benzigna.
Headers
X-BZ-Delivery
: UUID string identifying delivery attempt; you can provide this for troubleshooting.User-Agent
: Identifies the system sending the message. ex.Benzinga-Dispatch/<id> v1.0.0
Content-Type
:application/json
. Identifies payload content type.
Body Fields:
Example:
Webhook Test API
- Webhook Test Trigger Use this API to trigger test payload deliveries to your Webhook endpoint.
Was this page helpful?