---
title: "Update task status (self-hosted)"
method: PATCH
path: "/self-hosted/{accountId}/tasks/{taskId}"
tags: ["Self-Hosted Runners"]
---

# Update task status (self-hosted)

`PATCH /self-hosted/{accountId}/tasks/{taskId}`

Updates task status, error and current step for a task (self-hosted)

## Path parameters

- `accountId` string, required
- `taskId` string, required

## Request body

- UpdateTaskStatusRequest
  - `status` 'pending' | 'running' | 'success' | 'failed' | 'canceled' | 'initializing' | 'queued' | 'planning' | 'planning_destroy' | 'applying' | 'destroying' | 'ready_for_apply' | 'ready_for_destroy' | 'destroyed' | 'destroy_plan_completed' | 'destroy_plan_failed' | 'destroy_failed' | 'discarded' | 'canceling_init' | 'canceling_plan' | 'canceling_planning_destroy' | 'canceling_apply' | 'canceling_destroy' | 'canceled_init' | 'canceled_plan' | 'canceled_planning_destroy' | 'canceled_apply' | 'canceled_destroy'
  - `error` TaskError — Error information if the task failed
    - `type` 'UNEXPECTED' — Type of error
    - `description` string — Error description
  - `currentStep` 'plan' | 'post_plan' | 'apply' | 'post_apply'
  - `workspaceRunId` string

## Response `200`

Task status updated successfully

## Other responses

- `400` — Bad Request Error
- `401` — Unauthorized Error
- `403` — Insufficient permissions
- `404` — Not Found Error
- `500` — Internal Server Error

---

[API](https://skmtc.net/firefly/apis/api-gateway.md) · [All operations](https://skmtc.net/firefly/apis/api-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/firefly/api-gateway/revisions/eea119b4113f/schema)
