> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shannon.run/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /api/v1/tasks/{id}/control-state

> Query the pause/cancel control state for a task

## Endpoint

```http theme={null}
GET http://localhost:8080/api/v1/tasks/{id}/control-state
```

## Description

Returns the **current control state** for a workflow: whether it is paused, cancelled, and metadata about who triggered the action and when.

This is useful for:

* Building UIs that show **Pause / Resume** button states
* Polling from backend services to coordinate other systems

## Authentication

**Required**: Yes

Include API key in header:

```http theme={null}
X-API-Key: sk_test_123456
```

## Request

### Headers

| Header        | Required | Description            |
| ------------- | -------- | ---------------------- |
| `X-API-Key`   | Yes      | API authentication key |
| `traceparent` | No       | W3C trace context      |

### Path Parameters

| Parameter | Type   | Required | Description                    |
| --------- | ------ | -------- | ------------------------------ |
| `id`      | string | Yes      | Task ID (Temporal workflow ID) |

## Response

### 200 OK

```json theme={null}
{
  "is_paused": true,
  "is_cancelled": false,
  "paused_at": "2025-10-29T06:00:01Z",
  "pause_reason": "User requested pause",
  "paused_by": "user-123",
  "cancel_reason": "",
  "cancelled_by": ""
}
```

Notes:

* `paused_at` is an empty string when the workflow has never been paused.
* `is_cancelled` reflects logical cancel state from control signals, not just Temporal termination.

### 404 Not Found

```json theme={null}
{ "error": "Task not found" }
```

### 401 / 403

```json theme={null}
{ "error": "Unauthorized" }
```

or

```json theme={null}
{ "error": "Forbidden" }
```
