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/:cronJobIdRequest Parameters
Parameter | Description | Example |
---|---|---|
cronJobId | ID of the cron job you want to retrieve | 9 |
Response
Code | Description |
---|---|
200 | Cron job returned successfully |
404 | Cron job was not found |
500 | An error ocurred finding the cron job |
Example Usage
- TypeScript
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"
}