Skip to main content

Get Cron Job Info

caution

Cron jobs are currently in ALPHA and are not considered stable. This feature may change at any time, please use with caution.

Retrieves info about a specific cron job by ID and the associated execution history of this cron job

GET https://app.jiter.dev/api/cronjobs/:cronJobId

Request Parameters

ParameterDescriptionExample
cronJobIdID of the cron job you want to retrieve9

Response

CodeDescription
200Cron job returned successfully
404Cron job was not found
500An error ocurred finding the cron job

Example Usage

index.ts
import axios from "axios";

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

const getCronJob = async () => {
try {
const { data } = await axios.get(`${apiBaseUrl}/cronjobs/9`, {
headers: { "x-api-key": "YOUR_API_KEY" },
});

console.log("Cron job found 🎉", data);
} catch (error) {
console.log("Unable to find cron job", error);
}
};

getCronJob();

Example Success Response

{
"id": "9",
"history": [],
"status": "Active",
"destination": "https://your-app.com/webhooks/jiter",
"org": "3",
"payload": "{'action':'buyGroceriesReminder','values':['eggs','bacon','pasta','bread']}",
"expression": "* * * * *",
"nextExecutionStatus": "Pending",
"nextExecutionDate": "2022-10-25T18:27:00.000Z",
"createdAt": "2022-10-25T18:26:04.000Z",
"updatedAt": "2022-10-25T18:26:04.000Z"
}

Example Error Response

{
"message": "Unable to find cron job"
}