Create Event Subscription

post

/v1/besu/event-subscriptions

Creates a callback-based subscription for newHeads or filtered logs events, with optional block ranges, retry settings, OAuth, and TLS configuration. It returns the newly created subscription, including its ID and running status.

Request

There are no request parameters for this operation.

Supported Media Types
Request Body - application/json ()
Root Schema : schema
Type: object
Request to create a Besu event subscription. Supports recoverable event types only: `newHeads` and `logs`. `logsFilter` is only valid when `type=logs`. `nonEmptyBlocksOnly` is only valid when `type=newHeads`.
Show Source
Nested Schema : EventSubscriptionLogsFilter
Type: object
Log filter criteria for a logs event subscription. Topic positions are ordered. Nested topic arrays (OR topic sets) are not supported.The filter is validated with eth_getLogs when the subscription is created.
Show Source
  • Minimum Length: 42
    Maximum Length: 42
    Pattern: ^0x[0-9a-fA-F]{40}$
    Contract address whose logs are included.
  • topics
    Maximum Number of Items: 4
    Ordered topic filters; use null entries as wildcards for positional topics.
Nested Schema : EventSubscriptionOAuthConfig
Type: object
OAuth 2.0 configuration for callback authentication.
Show Source
  • Default Value: true
    Controls OAuth token request client-auth placement. When true, sends `clientId:clientSecret` in an HTTP Basic Authorization header to the token endpoint. When false, sends client_id and client_secret form fields in the token request body.
  • OAuth 2.0 client identifier registered for the callback endpoint.
  • OAuth 2.0 client secret used for token acquisition.
  • Default Value: client_credentials
    Allowed Values: [ "client_credentials", "refresh_token" ]
    OAuth 2.0 token grant used for callback access-token acquisition. client_credentials obtains an access token with the configured client credentials. refresh_token uses the supplied refreshToken and retains any replacement refresh token returned by the identity provider.
  • Required when grantType=refresh_token; pre-provisioned OAuth refresh token used to mint callback access tokens.
  • Space-delimited OAuth scopes requested during token exchange.
  • EventSubscriptionTlsConfig
    TLS or mTLS configuration for callback delivery. If mTLS is used, both clientCert and clientKey must be provided together.
  • EventSubscriptionTlsConfig
    TLS or mTLS configuration for callback delivery. If mTLS is used, both clientCert and clientKey must be provided together.
  • OAuth 2.0 token endpoint used to obtain access tokens for callbacks.
Match All
OAuth 2.0 configuration for callback authentication.
Show Source
Nested Schema : EventSubscriptionTlsConfig
Type: object
TLS or mTLS configuration for callback delivery. If mTLS is used, both clientCert and clientKey must be provided together.
Show Source
Nested Schema : topics
Type: array
Maximum Number of Items: 4
Ordered topic filters; use null entries as wildcards for positional topics.
Show Source
Examples

Back to Top

Response

Supported Media Types

201 Response

Returns the created event subscription.
Body ()
Root Schema : EventSubscriptionResponse
Type: object
Event subscription configuration and current lifecycle state.
Show Source
Nested Schema : EventSubscriptionCursor
Type: object
Event processing position for an event subscription.
Show Source
Examples

400 Response

Validation failed.
Body ()
Root Schema : ErrorResponse
Type: object
Error response returned by the service.
Show Source
Nested Schema : upstreamError
Type: object
Additional Properties Allowed: true
Complete error object returned by the Besu node, including code, message, and data fields, when available.
Examples

500 Response

Unexpected service error.
Body ()
Root Schema : ErrorResponse
Type: object
Error response returned by the service.
Show Source
Nested Schema : upstreamError
Type: object
Additional Properties Allowed: true
Complete error object returned by the Besu node, including code, message, and data fields, when available.
Examples

503 Response

Event subscriptions are unavailable.
Body ()
Root Schema : ErrorResponse
Type: object
Error response returned by the service.
Show Source
Nested Schema : upstreamError
Type: object
Additional Properties Allowed: true
Complete error object returned by the Besu node, including code, message, and data fields, when available.
Examples

Back to Top