> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.simplified.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.simplified.com/_mcp/server.

# Flows · Runs · Approve or reject a task the run is waiting on

POST https://api.simplified.com/api/v1/workflows/run/{run_id}/update-task-status
Content-Type: application/json

Resolves a human-approval gate so a blocked run can continue.

Takes the waiting task's `reference_task_name` and a status: `COMPLETED`
approves and the run proceeds, `FAILED` rejects and the run fails. An optional
`data` object is passed into the workflow, which is how a rejection reason
reaches later steps.

The run must genuinely be waiting on that task, and the reference name must
match, or the call is a 400.

`resource: workflow://run-control` covers how to find the waiting task.


Reference: https://docs.simplified.com/api-reference/workflows/runs/approve-workflow-task

## Authentication

- `Authorization` header (required) (prefixed with ` Api-Key   `) — Header authentication of the form `Api-Key  <token>`
- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `run_id` (string, required) — UUID of a single workflow execution, from `flows_startWorkflow` (returned as `workflow_id`) or `flows_listWorkflowRuns` (returned as `id`). NOT the small integer workflow-definition ID.

### Body (application/json)

This endpoint expects an ApproveWorkflowTaskRequest.

- `task_reference_name` (string, required) — Reference name of the waiting task, as shown in the `tasks` array of `flows_getWorkflowRun` (expand `tasks` on `flows_getWorkflowRunStatus` for a slimmer view).
- `status` (enum, required) — `COMPLETED` releases the gate and lets the run continue. `FAILED` fails the task, which usually fails the whole run.
  - Allowed values: `COMPLETED`, `FAILED`
- `data` (map from string to any, optional) — Optional output to attach to the task, available to downstream tasks as that task's result.

## Response

### 200

Task status updated; the run continues or fails accordingly.

## Errors

### 400 Bad Request Error

Task is not waiting, or the reference name is unknown.

- `any`

### 404 Not Found Error

No such run in this workspace.

- `any`

## Examples

### Approve a review gate

**Request**

```json
{
  "task_reference_name": "human_review_ref",
  "status": "COMPLETED"
}
```

**Response**

```json
{}
```

**SDK Code**

```python Approve a review gate
import requests

url = "https://api.simplified.com/api/v1/workflows/run/run_id/update-task-status"

payload = {
    "task_reference_name": "human_review_ref",
    "status": "COMPLETED"
}
headers = {
    "Authorization": "Api-Key  <apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Approve a review gate
const url = 'https://api.simplified.com/api/v1/workflows/run/run_id/update-task-status';
const options = {
  method: 'POST',
  headers: {Authorization: 'Api-Key  <apiKey>', 'Content-Type': 'application/json'},
  body: '{"task_reference_name":"human_review_ref","status":"COMPLETED"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Approve a review gate
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.simplified.com/api/v1/workflows/run/run_id/update-task-status"

	payload := strings.NewReader("{\n  \"task_reference_name\": \"human_review_ref\",\n  \"status\": \"COMPLETED\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Api-Key  <apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Approve a review gate
require 'uri'
require 'net/http'

url = URI("https://api.simplified.com/api/v1/workflows/run/run_id/update-task-status")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Api-Key  <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"task_reference_name\": \"human_review_ref\",\n  \"status\": \"COMPLETED\"\n}"

response = http.request(request)
puts response.read_body
```

```java Approve a review gate
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.simplified.com/api/v1/workflows/run/run_id/update-task-status")
  .header("Authorization", "Api-Key  <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"task_reference_name\": \"human_review_ref\",\n  \"status\": \"COMPLETED\"\n}")
  .asString();
```

```php Approve a review gate
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.simplified.com/api/v1/workflows/run/run_id/update-task-status', [
  'body' => '{
  "task_reference_name": "human_review_ref",
  "status": "COMPLETED"
}',
  'headers' => [
    'Authorization' => 'Api-Key  <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Approve a review gate
using RestSharp;

var client = new RestClient("https://api.simplified.com/api/v1/workflows/run/run_id/update-task-status");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Api-Key  <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"task_reference_name\": \"human_review_ref\",\n  \"status\": \"COMPLETED\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Approve a review gate
import Foundation

let headers = [
  "Authorization": "Api-Key  <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "task_reference_name": "human_review_ref",
  "status": "COMPLETED"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.simplified.com/api/v1/workflows/run/run_id/update-task-status")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Reject a review gate

**Request**

```json
{
  "task_reference_name": "human_review_ref",
  "status": "FAILED",
  "data": {
    "reason": "Copy is off-brand"
  }
}
```

**Response**

```json
{}
```

**SDK Code**

```python Reject a review gate
import requests

url = "https://api.simplified.com/api/v1/workflows/run/run_id/update-task-status"

payload = {
    "task_reference_name": "human_review_ref",
    "status": "FAILED",
    "data": { "reason": "Copy is off-brand" }
}
headers = {
    "Authorization": "Api-Key  <apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Reject a review gate
const url = 'https://api.simplified.com/api/v1/workflows/run/run_id/update-task-status';
const options = {
  method: 'POST',
  headers: {Authorization: 'Api-Key  <apiKey>', 'Content-Type': 'application/json'},
  body: '{"task_reference_name":"human_review_ref","status":"FAILED","data":{"reason":"Copy is off-brand"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Reject a review gate
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.simplified.com/api/v1/workflows/run/run_id/update-task-status"

	payload := strings.NewReader("{\n  \"task_reference_name\": \"human_review_ref\",\n  \"status\": \"FAILED\",\n  \"data\": {\n    \"reason\": \"Copy is off-brand\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Api-Key  <apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Reject a review gate
require 'uri'
require 'net/http'

url = URI("https://api.simplified.com/api/v1/workflows/run/run_id/update-task-status")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Api-Key  <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"task_reference_name\": \"human_review_ref\",\n  \"status\": \"FAILED\",\n  \"data\": {\n    \"reason\": \"Copy is off-brand\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Reject a review gate
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.simplified.com/api/v1/workflows/run/run_id/update-task-status")
  .header("Authorization", "Api-Key  <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"task_reference_name\": \"human_review_ref\",\n  \"status\": \"FAILED\",\n  \"data\": {\n    \"reason\": \"Copy is off-brand\"\n  }\n}")
  .asString();
```

```php Reject a review gate
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.simplified.com/api/v1/workflows/run/run_id/update-task-status', [
  'body' => '{
  "task_reference_name": "human_review_ref",
  "status": "FAILED",
  "data": {
    "reason": "Copy is off-brand"
  }
}',
  'headers' => [
    'Authorization' => 'Api-Key  <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Reject a review gate
using RestSharp;

var client = new RestClient("https://api.simplified.com/api/v1/workflows/run/run_id/update-task-status");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Api-Key  <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"task_reference_name\": \"human_review_ref\",\n  \"status\": \"FAILED\",\n  \"data\": {\n    \"reason\": \"Copy is off-brand\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Reject a review gate
import Foundation

let headers = [
  "Authorization": "Api-Key  <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "task_reference_name": "human_review_ref",
  "status": "FAILED",
  "data": ["reason": "Copy is off-brand"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.simplified.com/api/v1/workflows/run/run_id/update-task-status")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```