Tasks API
API endpoints for managing tasks in the Kubiya platform
Tasks API
The Tasks API allows you to manage tasks that can be executed by AI teammates. You can create, update, and delete tasks, as well as view their execution history.
Endpoints
Method | Path | Description |
---|---|---|
GET | /api/v1/tasks | List all tasks |
GET | /api/v1/tasks/{taskId} | Get task by ID |
POST | /api/v1/tasks | Create a new task |
PUT | /api/v1/tasks/{taskId} | Update a task |
DELETE | /api/v1/tasks/{taskId} | Delete a task |
POST | /api/v1/tasks/plan/{taskId} | Plan a task |
POST | /api/v1/tasks/apply/{taskId} | Apply a task |
GET | /api/v1/tasks/logs/{taskId} | Get task logs |
POST | /api/v1/tasks/inline | Create an inline task |
POST | /api/v1/tasks/inline/plan | Run plan inline task |
GET | /api/v1/tasks/resources/{taskId} | Get task resources |
GET | /api/v1/usecases | List all use cases |
GET | /api/v1/usecases/{useCaseId} | Get use case by ID |
List Tasks
Retrieve all tasks in your organization.
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
Get Task by ID
Retrieve details for a specific task.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
taskId | string | Yes | ID of the task |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
Create Task
Create a new task.
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Content-Type | Yes | application/json |
Request Body
Response
Update Task
Update an existing task.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
taskId | 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
Delete Task
Delete a task.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
taskId | string | Yes | ID of the 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.
Plan Task
Plan a task.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
taskId | string | Yes | ID of the task to plan |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
Apply Task
Apply a task.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
taskId | string | Yes | ID of the task to apply |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
Get Task Logs
Retrieve logs for a specific task.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
taskId | string | Yes | ID of the task |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
Create Inline Task
Create an inline task.
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Content-Type | Yes | application/json |
Request Body
Response
Run Plan Inline Task
Run a plan for an inline task.
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Content-Type | Yes | application/json |
Request Body
Response
Get Task Resources
Retrieve resources for a specific task.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
taskId | string | Yes | ID of the task |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
List Use Cases
Retrieve all use cases.
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
Get Use Case by ID
Retrieve details for a specific use case.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
useCaseId | string | Yes | ID of the use case |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
Example Usage
Tasks are the core building blocks of automation in Kubiya. Make sure to test your tasks thoroughly before applying them in production.
Common Errors
HTTP Status | Description |
---|---|
400 | Bad Request - Invalid request body 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 task or use case was not found |
500 | Internal Server Error - An unexpected error occurred on the server |
Next Steps
After setting up tasks, you can: