Scheduled Tasks API
API endpoints for managing scheduled tasks in the Kubiya platform
Scheduled Tasks API
The Scheduled Tasks API allows you to manage tasks that are scheduled to run at specific times or intervals. You can create, update, and delete scheduled tasks, as well as view their execution history.
Scheduled Tasks in Kubiya allow you to automate the execution of agents on a defined schedule. This API enables you to create, manage, and monitor scheduled tasks that run automatically at specified intervals.
Endpoints
Method | Path | Description |
---|---|---|
GET | /api/v1/scheduled_tasks | List all scheduled tasks |
GET | /api/v1/scheduled_tasks/{taskId} | Get scheduled task details |
POST | /api/v1/scheduled_tasks | Create a new scheduled task |
PUT | /api/v1/scheduled_tasks/{taskId} | Update a scheduled task |
DELETE | /api/v1/scheduled_tasks/{taskId} | Delete a scheduled task |
List Scheduled Tasks
Retrieve all scheduled tasks in your organization.
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
Get Scheduled Task Details
Retrieve details about a specific scheduled task.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
taskId | string | Yes | ID of the scheduled task |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
Create Scheduled Task
Create a new scheduled task.
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Content-Type | Yes | application/json |
Request Body
Response
Update Scheduled Task
Update an existing scheduled task.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
taskId | string | Yes | ID of the scheduled task to update |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Content-Type | Yes | application/json |
Request Body
Response
Delete Scheduled Task
Delete a scheduled task.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
taskId | string | Yes | ID of the scheduled task to delete |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
A successful delete operation returns an HTTP 200 status with no response body.
Schedule Format
The schedule is specified using cron syntax with the following format:
Common examples:
0 9 * * *
- Daily at 9 AM0 9 * * MON-FRI
- Weekdays at 9 AM0 0 1 * *
- Monthly on the 1st at midnight*/15 * * * *
- Every 15 minutes
Example Usage
Scheduled tasks are executed automatically based on their defined schedule. Make sure to test your tasks thoroughly before enabling them in production.
Common Errors
HTTP Status | Description |
---|---|
400 | Bad Request - Invalid schedule format or missing required fields |
401 | Unauthorized - API key is missing or invalid |
403 | Forbidden - The API key doesn't have permission to perform this action |
404 | Not Found - The specified scheduled task was not found |
500 | Internal Server Error - An unexpected error occurred on the server |
Next Steps
After setting up scheduled tasks, you can: