# Receive a run of the HCP Terraform run task. Called by HCP Terraform, not by clients

> Page: https://docs.plotwork.dev/api/post-integrations-hcp-terraform-run-task-org. Index of every page: https://docs.plotwork.dev/llms.txt

Called by HCP Terraform.

`POST /integrations/hcp-terraform/run-task/{org}`

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | Receive a run of the HCP Terraform run task. Called by HCP Terraform, not by clients. |
| What does it take? | A JSON body of type `object`. |
| What does it return? | Status 200 with a body of type [`RunTaskAck`](https://docs.plotwork.dev/api/schemas.md#runtaskack). |
| What can go wrong? | `400` the body is not a run task payload (run_task.payload_invalid); `401` the signature is missing or does not match (run_task.signature_invalid); `404` the organisation has no run task turned on (run_task.not_found); `413` the body is larger than 64 KiB; `429` too many requests; `503` the run task is not available on this server (run_task.unavailable). Every failure uses the one error envelope. |

## What it does

Called by HCP Terraform. Checks X-TFC-Task-Signature over the exact bytes first and answers at once: `verified` for the address check made when the run task is created, `accepted` for a run, which is drawn into the organisation's library and reported back to the run's callback after the answer.

## Path parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `org` | `string` | yes | The organisation's id, as the endpoint URL the portal shows names it. |

## Header parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `x-tfc-task-signature` | `string` | no | The HMAC-SHA512 of the exact body under the run task's HMAC key, in hex. A request without it is refused. |

## Request body

The body has the type `object`.

| Field | Type | Required | Description |
|---|---|---|---|

## Responses

| Status | Meaning | Body |
|---|---|---|
| 200 | Verified, or accepted. | [`RunTaskAck`](https://docs.plotwork.dev/api/schemas.md#runtaskack) |
| 400 | The body is not a run task payload (run_task.payload_invalid). | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 401 | The signature is missing or does not match (run_task.signature_invalid). | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 404 | The organisation has no run task turned on (run_task.not_found). | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 413 | The body is larger than 64 KiB. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 429 | Too many requests. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 503 | The run task is not available on this server (run_task.unavailable). | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |

## Response body

A 200 answer has the type [`RunTaskAck`](https://docs.plotwork.dev/api/schemas.md#runtaskack).

| Field | Type | Required | Description |
|---|---|---|---|
| `outcome` | `"verified" \| "accepted"` | yes | `verified`: the address check HCP Terraform makes when the run task is created. `accepted`: a run, which is drawn and reported back after this answer. |

## See also

| Doc | Why |
|---|---|
| [API reference](https://docs.plotwork.dev/api/reference.md) | Every endpoint, and the error envelope |
| [Schemas](https://docs.plotwork.dev/api/schemas.md) | Every request and response type |
| [Tool reference](https://docs.plotwork.dev/mcp/tools.md) | The operations as callable tools |
