Package dev.evercatch
Class EvercatchClient
java.lang.Object
dev.evercatch.EvercatchClient
Evercatch API client for Java.
Example usage:
EvercatchClient client = new EvercatchClient("ec_live_abc123");
// Create a destination
Destination dest = client.createDestination(
CreateDestinationRequest.builder()
.name("Production")
.url("https://myapp.com/webhooks")
.providers(List.of("stripe", "sendgrid"))
.build()
);
// List recent events
List<Event> events = client.listEvents(
ListEventsRequest.builder()
.provider("stripe")
.limit(50)
.build()
);
-
Constructor Summary
ConstructorsConstructorDescriptionEvercatchClient(String apiKey) Creates a client using the default API base URL.EvercatchClient(String apiKey, String baseUrl) Creates a client with a custom base URL (useful for self-hosted instances or testing). -
Method Summary
Modifier and TypeMethodDescriptionCreates a new webhook destination.voidDeletes a destination.getDestination(String id) Retrieves a single destination by ID.Retrieves a single event by ID.getUsage()Returns current account usage statistics.Returns all webhook destinations for the account.listEvents(ListEventsRequest request) Lists webhook events with optional filters.voidreplayEvent(String eventId, List<String> destinationIds) Replays an event to the specified destinations.
-
Constructor Details
-
EvercatchClient
Creates a client using the default API base URL.- Parameters:
apiKey- your Evercatch API key (starts withec_live_orec_test_)
-
EvercatchClient
Creates a client with a custom base URL (useful for self-hosted instances or testing).- Parameters:
apiKey- your Evercatch API keybaseUrl- custom API base URL
-
-
Method Details
-
createDestination
Creates a new webhook destination.- Parameters:
request- destination configuration- Returns:
- the created
Destination - Throws:
EvercatchException- if the API request fails
-
listDestinations
Returns all webhook destinations for the account.- Returns:
- list of destinations
- Throws:
EvercatchException- if the API request fails
-
getDestination
Retrieves a single destination by ID.- Parameters:
id- destination ID- Returns:
- the matching
Destination - Throws:
EvercatchException- if the API request fails
-
deleteDestination
Deletes a destination.- Parameters:
id- destination ID- Throws:
EvercatchException- if the API request fails
-
listEvents
Lists webhook events with optional filters.- Parameters:
request- filter / pagination options (useListEventsRequest.builder().build()for defaults)- Returns:
- list of events
- Throws:
EvercatchException- if the API request fails
-
getEvent
Retrieves a single event by ID.- Parameters:
id- event ID- Returns:
- the matching
Event - Throws:
EvercatchException- if the API request fails
-
replayEvent
Replays an event to the specified destinations.Requires the Studio or Enterprise plan.
- Parameters:
eventId- ID of the event to replaydestinationIds- destination IDs to replay to- Throws:
EvercatchException- if the API request fails or the plan does not support replay
-
getUsage
Returns current account usage statistics.- Returns:
Usagesummary- Throws:
EvercatchException- if the API request fails
-