Skip to main content

Get Many Events

GET https://app.jiter.dev/api/events

You can retrieve up to 1,000 events per query and filter them based on the parameters below.

Request Query Parameters

ParameterDescriptionExample
statusStatus of the events you would like to retrieveOne of OR an array of: Pending, Cancelled, Queued, Sent, Failed To Send, Failed To Queue
scheduledStartDateAn ISO timestamp in the future to get any events scheduled after this time'2022-10-05T21:15:30.258Z'
scheduledEndDateAn ISO timestamp in the future to get any events scheduled before this time'2022-10-05T22:15:30.258Z'
sentAtStartDateAn ISO timestamp in the past to get any events sent after this time'2022-10-05T23:15:30.258Z'
sentAtEndDateAn ISO timestamp in the past to get any events sent before this time'2022-10-05T24:15:30.258Z'
failedAtStartDateAn ISO timestamp in the past to get any events that failed after this time'2022-10-05T25:15:30.258Z'
failedAtEndDateAn ISO timestamp in the past to get any events that failed before this time'2022-10-05T26:15:30.258Z'
note

If an event has a sentAt or failedAt date, it will only be retrieved if that date is within the last 7 days. If you would like to search for events farther back than this, please send us some feedback with your use case!

Response

CodeDescription
200Events returned successfully
400sentAtStartDate is outside of the searchable range
500Unable to get events

Example Usage

index.ts
import axios from "axios";

const apiBaseUrl = "https://app.jiter.dev/api";

const getManyEvents = async () => {
const query = new URLSearchParams({
scheduledStartDate: "2022-10-27T04:50:26.573Z",
status: "Pending", // For multiple statuses, use: ["Pending", "Sent"].toString()
}).toString();

try {
const { data } = await axios.get(`${apiBaseUrl}/events?${query}`, {
headers: { "x-api-key": "YOUR_API_KEY" },
});

console.log("Events found 🎉", data);
} catch (error) {
console.log("Unable to find events", error);
}
};

getManyEvents();

Example Success Response

[
{
"id": "9",
"scheduledTime": "2022-10-27T04:50:26.573Z",
"destination": "https://your-app.com/webhooks/jiter",
"org": "5",
"status": "Pending",
"payload": "{'action':'buyGroceries','values':['eggs','bacon','pasta','bread']}",
"createdAt": "2022-10-05T19:51:27.000Z",
"updatedAt": "2022-10-05T19:51:27.000Z"
},
{
"id": "10",
"scheduledTime": "2022-10-27T04:50:26.573Z",
"destination": "https://your-app.com/webhooks/jiter",
"org": "5",
"status": "Pending",
"payload": "{'action':'buyGroceriesAgain','values':['eggs','bacon','pasta','bread']}",
"createdAt": "2022-10-05T20:51:27.000Z",
"updatedAt": "2022-10-05T20:51:27.000Z"
},
{
"id": "11",
"scheduledTime": "2022-10-27T04:50:26.573Z",
"destination": "https://your-app.com/webhooks/jiter",
"org": "5",
"status": "Pending",
"payload": "{'action':'buyGroceriesOneMoreTime','values':['eggs','bacon','pasta','bread']}",
"createdAt": "2022-10-05T20:53:27.000Z",
"updatedAt": "2022-10-05T20:53:27.000Z"
}
]

Example Error Response

{
"message": "Unable to get events"
}