Tasks API
API endpoints for managing tasks in the Kubiya platform
Tasks API
The Tasks API provides endpoints to manage automation tasks in Kubiya. Tasks are used for managing workflows and automation processes, including infrastructure deployments, configuration management, and other DevOps operations.
List all tasks
Create a new task
List Tasks
Retrieve a list of all tasks in your organization.
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Content-Type | No | application/json |
Response
Create Task
Create a new task in your organization.
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Content-Type | Yes | application/json |
Request Body
Required Fields
name
: Name of the taskdescription
: Description of what the task does
Response
Get Task Details
Retrieve detailed information about a specific task.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
task_id | string | Yes | ID of the task to retrieve |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Content-Type | No | application/json |
Response
Update Task
Update an existing task with new parameters.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
task_id | string | Yes | ID of the task to update |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Content-Type | Yes | application/json |
Request Body
Response
Run Task
Execute a task with specific parameters.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
task_id | string | Yes | ID of the task to run |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Content-Type | Yes | application/json |
Request Body
Response
Example Usage
List Tasks
Create a Task
Get Task Details
Update a Task
Run a Task
Common Errors
HTTP Status | Description |
---|---|
400 | Bad Request - Missing required fields or invalid parameter |
401 | Unauthorized - Missing or invalid API key |
403 | Forbidden - API key doesn't have permission for this operation |
404 | Not Found - Task not found |
409 | Conflict - A task with this name already exists |
500 | Internal Server Error - Unexpected server error |
Data Types
Task
Field | Type | Description |
---|---|---|
id | string | Unique identifier for the task |
name | string | Human-readable name for the task |
description | string | Description of what the task does |
icons | string[] | Array of emoji icons representing the task |
readme | string | Markdown documentation for the task |
url | string | Source URL for the task (e.g., GitHub repository) |
providers | Provider[] | Infrastructure providers used by this task |
resources | Resource[] | Resources managed by this task |
variables | Variable[] | Variables that can be configured for this task |
secrets | Secret[] | Secrets used by this task |
Variable
Field | Type | Description |
---|---|---|
name | string | Variable name |
type | string | Data type (string, number, boolean, etc.) |
value | any | Current value (optional) |
default | any | Default value (optional) |
description | string | Human-readable description |
required | boolean | Whether this variable is required |
has_error | boolean | Whether there's an error with this variable |
error_detail | string | Detailed error message if has_error is true |
error_summary | string | Summary of the error if has_error is true |
Secret
Field | Type | Description |
---|---|---|
name | string | Secret name |
description | string | Human-readable description |
to_env | string | Environment variable name to map this secret to |
value | string | Secret value (masked in responses) |
Task Execution
While the Tasks API manages task definitions, execution of tasks is typically handled through the following mechanisms:
- Direct Execution: Tasks can be executed directly through the Execution API
- Event-Driven: Tasks can be triggered by webhook events
- Scheduled: Tasks can be executed on a schedule
The execution details and status tracking are handled through separate API endpoints.
Task Variables and Secrets
Tasks can have variables and secrets that control their behavior:
- Variables: Configuration options that can be set at task creation or execution time
- Secrets: Sensitive information (like API keys) that are securely stored and made available during task execution
Common Use Cases
Tasks in Kubiya are commonly used for:
- Application Deployments: Automate the deployment of applications to various environments
- Infrastructure Management: Provision and configure infrastructure resources
- CI/CD Integration: Integrate with continuous integration and deployment pipelines
- Automated Remediation: Fix common issues automatically when triggered by alerts
- Scheduled Maintenance: Perform routine maintenance tasks on a schedule
For detailed examples of task implementations, refer to the Task Examples Guide.